Tag Archives: code

To DrawWindow() or JustWriteToStdOut() ..

I knew one of the first mental showdowns when porting FrontDoor would always be the windows part. The visual windows that is, those silly “beautifully” framed squares displayed on the screen while just about any part of FrontDoor is running.

And now, I’m at a crossroads. There are a few ways of doing this, of course. There always are. The problem is that I’m not so keen on spending my time on something that nobody really wants or needs, when I would be much better off spending my time implementing new (to FrontDoor) protocols, methods, concepts.

I have ideas on how to do this much better than it’s currently implemented. It has to do with pipes and streams and similar concepts. But again … where is time best spent?

Gah! It’s the dreaded “Direct Console Output” problem #WTF :)

The last few days have seen progress. Some very widely used libraries have been ported (that is not to say they will actually work of course, but it’s a damn good start).

When “going back” to a unified library (RTL) as the one found in FreePascal, it’s actually sometimes more work than continuing using your own code. So I’m trying to keep this somewhat balanced. One “issue” with FreePascal is actually the number of platforms it supports. Because of this, it needs to do some thing in a fairly generic manner. That isn’t to say it’s slow or bad, but I often want to be one layer closer to the operating system (specially if it gives the application some sort of edge vs the generic stuff).

And there is a *lot* of code to port …

Not to mention the dreaded “Direct to screen writes” that used to be a requirement for DOS programs, unless you wanted the user to enter retirement before the BIOS screen updates had finished. No, that was not a joke, the PC BIOS screen handling code sucked, in a word. Fortunately, there were alternatives, and since FrontDoor has already been ported once to OS/2 (i.e. “not DOS”), some consideration has already been taken for the portability issues. But it’s not all that exciting to sit down and re-invent the weel … I’d much rather spend my time implementing things FrontDoor isn’t doing at the moment.

Oh well. Another few thousand lines of codes done. G’night!

Virtual COM Port for 64-bit QEMU Hosts and Guests

So QEMU looks like it’s the answer to many things when it comes to virtualization, regardless of your needs for a Guest OS. This post is not about whether or not QEMU is the greatest thing since sliced bread though, which may disappoint you if you’re a QEMU fan. I’ve spent the better part of three days reading up on virtual devices in QEMU Guests, more speficially serial (or “COM”) ports.

And I need, of course, “something”, that will expose a serial port to the Guest, and on the Host side, it needs to connect to “other systems”. The connecting to other systems part is fairly simple. When told to, it needs to “call” a remote system using TCP/IP and establish a connection. Once connected, it needs to act as a bridge between the remote system and the virtual serial port that the Guest is using.

You would think that using your favorite search engine and looking for “Virtual Serial Port” or “Virtual Ports in QEMU” would yield a barrage of hits, with detailed instructions on how someone has already done this. That’s what I was thinking anyway. Three days later, it turns out that this is not the case. There are many projects that, by name and first impressions, look very promising. But they all come up short in one way or another. And I do need this to be simple, because the problem is not complex in itself. The best candidate so far is something called “tcpser” (originally written Jim Brain). It also emulates a modem (to some extent) so that the application in the QEMU Guest can issue an “ATDT thedestination.com” to establish a data connection. I also ran across a few forks and improved versions.

There is only one problem with tcpser, or rather, with the equipment I often develop on: Most modern laptops have no physical serial ports. tcpser wants to talk to /dev/ttyS0 or COM1 (or any other physical serial port) because it needs to read line status like DCD/CD/DTR/DSR and so on.

If you can find a Virtual COM Port emulator for 64-bit Linux or 64-bit Windows that actually behaves like a serial port, then you’re better at “internet searching” than me :) But for the time being, I’m trying to see if I somehow can fake the appearance of a port to tcpser and then take it from there. This is not was I was supposed to be working at in regards to the Reboot project, but then again, sometimes you dig way too deep for your own good :)

If you want the “requirements list” for what I need, here you go:

  • Must be able to establis a raw Telnet session with system over Internet
  • Must not be suffering from problems with “special characters”
  • Must not require the remote system to be hardwired
  • Must not require the remote port to be hardwired
  • Must support ATDT as the signal to create the connection
  • Must somehow honor DTR to disconnect
  • Must work with QEMU
  • Must work with 64-bit Linux, as a minimum requirement (Host)

There’s something going on …

So I guess I took another three years to think about this, judging from the previous post(s) :-) But this time, I have actually managed to make some “progress”. That is, if you consider reviving a 30 year old DOS program progress.

I have been able to get FreeDOS up and running under VirtualBox. I have been able to locate my old copies of Borland Pascal, TASM, MASM, VirtualPascal, and Watcom. I was also very glad to see that there’s something called Open Watcom these days. That may prove to be very useful for this mission. The OS/2 stuff will have to wait for just a bit, I need to compile all the DOS stuff and see that the code actually still works.

The first version of FrontDoor was released in 1986 (and I managed to locate the original announcement). If I’m not mistaken, the first version of FrontDoor with mailer capabilities was out in 1987. That’s 30 years ago!