[Lazarus] Why development remains constant for msdos?

Nikolay Nikolov nickysn at gmail.com
Mon Sep 23 16:47:02 CEST 2013


On 22.9.2013 г. 14:59 ч., Florian Klämpfl wrote:
> Am 22.09.2013 13:46, schrieb Junior:
>> Why development remains constant for msdos?
> Because somebody wants to do so. No more, no less.
As the person working on the i8086-msdos port, here's the story how it 
all started: I wanted to learn how FPC code generators work by porting 
it to a new architecture, but I didn't have any computer in my home with 
a CPU that isn't supported already (well, except for 6502 :) ). So 
porting to a new architecture would require buying some exotic hardware 
from eBay (say, an Itanium or SPARC64) that'll likely be already 
obsolete in a few years anyway. And one day it occurred to me that I 
could try an i8086 port. It seemed perfect to me for the following reasons:

1) while, you may consider 16-bit x86 dead, it never really died in the 
sense that every modern x86 processor (including 64-bit ones) supports 
it in real mode. In fact, unless you have an UEFI system, 16-bit code is 
always executed at some point during the boot process, because that's 
how the BIOS boots the system - it loads the first sector from the hard 
disk at address 0000h:7C00h and jumps to it in 16-bit real mode. In 
fact, modern machines are able to boot DOS and it works without issues. 
If it didn't, boot loaders of modern operating systems wouldn't work 
either. So, in 5 years, everybody will have a machine that is able to 
execute i8086 code (and thus, able to test and maintain the port), but 
that may not be the case for e.g. Itanium or SPARC64. Also, there are 
plenty of virtual machines available, where you can install DOS and test 
it. There's also DOSBox. In fact, you can run the FPC testsuite for 
i8086-msdos on any 32-bit or 64-bit linux _or_ windows via DOSBox.
2) I didn't need to learn an entirely new instruction set and OS API, 
since I'm already familiar with them, so I could focus only on the 
compiler itself.
3) There isn't a 16-bit x86 pascal compiler that is free/open source. 
Borland Pascal is proprietary and while you can download old versions 
for free from the Embarcadero museum site, the latest version available 
gratis is 5.5. You can't legally use 7.0, unless you bought it back then 
and even if you did, you don't have the sources to the compiler, so you 
can't fix bugs in it and improve it.
4) Since x86 compatibility goes all the way back to 16-bit, if FPC would 
support it could claim to be the first compiler which supports the full 
x86 range going all the way from 16-bit up to 64-bit. It's something 
unique and cool :)
OpenWatcom may be the only other compiler that is able to do it, since 
they haven't dropped 16-bit support and are supposedly working on 
64-bit, but their 64-bit port is still not ready AFAIK. And of course 
GCC and LLVM are extremely unlikely to do such a crazy thing as a 16-bit 
port. :)

It all started semi-seriously, I just wanted to see how difficult it 
would be to do the port, but I soon reached the point of no return, 
where I had almost got it working and I just had to keep working on it 
in order to get that next feature going, etc. And also, I'm having a lot 
of fun, while working on it. I also bought some vintage 16-bit machines 
from eBay for the extra fun and motivation :)

As for people still using DOS, there's still a community of people using 
it for fun or for nostalgia reasons. Check out:

http://www.bttr-software.de/forum/forum.php

There's also the FreeDOS project, which was already mentioned by another 
poster: http://www.freedos.org/

Also note that DOS has always been supported by FPC via the go32v2 dos 
extender (ok, it might have been go32v1 when fpc was started), but it 
has always been 32-bit and thus requiring at least a 386. Only the 
16-bit DOS support is new.

Nikolay




More information about the Lazarus mailing list