Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Old 8086 version of pcc spotted (cross-compiles to DOS) (Miscellaneous)

posted by bocke(R), 01.03.2012, 19:23

> bcc/Dev86 is okay but not perfect. Yes, there's an older DOS-hosted version
> (0.16.2), but it's fairly minimal, small model (64k + 64k) .COM output
> only. And I'm not sure the libc is 100% complete, but it's good enough for
> average things. I compiled "unproto" with it recently, so at least you can
> use "-ansi" now.
>

I don't know about its status, but I guess it was mostly meant to be a crosscompiling toolset for ELKS (early Linux kernel subset for 8086-80286). The limitations are the limitations of the original executable format bcc was orignally written for (Minix a.out format). I think this (DOS version) was ported by Robert de Bath. But I don't know how complete it is (haven't played with it). He doesn't seem to work with ELKS or DOS these days. Most of the updates are to boot loader generation code (he still maintains dev86). This is what dev86 is mostly used on *nix platforms these days.

Anyway I don't know how complete is DOS C library. But it comes with a small elks "emulator" to run elks binaries natively. This *might* be used as a stub to port old *nix software, but haven't tried. At least not under DOS. I think I managed to make something similar for Linux some time ago (compiled elks app with stub merged in).

Btw, it seems ELKS is revived in past several weeks. No new features or anything, just bug fixes and general code cleanup. I think this is still only available from git. So, if you played with it earlier, check out the mailing list or git repository. :)

Btw, I don't have any connection to ELKS and haven't contributed any code. I just played around with it. It looked interesting to hack on. But my assembly knowlegde is too weak to make something usefull out of it. I did try porting some C applications (mostly ancient usenet sources and some embedded utilities) with varying success. IE, 8086 version of libc doesn't have math (8087 or emulation) library implemented. A lot of stuff won't work without math library. For example, lua 1.0 seems to compile ok, but can't be linked because of the absence of -lm. And C library is not standardized anyway. ELKS doesn't have stable API. So if you can't hack on as86 (at&t syntax, uses int 80h for system calls like linux), you're much out of luck on extending it.

> Well, admittedly, there's less of a need to port PCC because DJGPP and
> OpenWatcom already exist. And while their DOS support isn't very active
> these days, they're already pretty robust and bug-free. (But yeah, GCC uses
> lots of RAM these days, sadly.)
>

Well, yes. But...

DJGPP C library haven't been touched since 2003. Only updates come frome libsupp. But nothing official. Ports can be a little hacky and not stable. They are mostly crosscompiled nowadays. Or compiled under Windows. No or very little native developement. I tried using gcc 4.6 with djdev 2.03 libs, but had better luck with GCC 3.3.6. It's still modern enough (at least C backend) and supports some of C99. So most stuff compiles ok. GCC 3.3.6 port seems much less memory intensive and stable. The other ports are of varying quality. For example bash port is pretty much buggy.

OpenWatcom, on the other side, is still dependent on DOS4GW and includes some propriatry elements. Yes, there is also DOS32A but it often crashes dosemu and dosbox. Most of OW binaries depend on DOS4GW and toolchain is maybe too large. It would be nice to have a small toolchain without misc utilites and crosscompilers/installer. Only the basic libs and toolchain. On the other side, I'm so used to unix C toolchains I can't get around to use wlink, or even wmake or wcc sometimes. But it does seem to be more stable than DJGPP GNU ports and it has pretty ok C lib. And it has 16-bit backend.

And both toolchains have a hacky implementations of dlls.

> Desmet C is too minimal, it definitely doesn't have full ANSI libs. But
> it's okay, I guess, and certainly easier to modify or bootstrap than
> others. The only problem is (IMHO) trying to decide which .ZIP to download
> from the website. Apparently the guy had several versions and never
> finished cleaning up any of them. Also some are more complete than others.

I think I looked at the source some time ago. I think it was hell to even look at it. :-|

Most of the available versions are non-ANSI. The version he worked on is one of the ones with some ANSI support. But I don't how much it conforms with ANSI. Probably some ANSI draft, because those versions are from late 80's. Most probably before C89/C90 standard. He didn't update the page for years so it's hard to know if he made some success with it.

I didn't play with it much though. Yes, it seems minimal, but that might be interesting for legacy purposes where small size is of concern. Btw, it seems to have 8086-80386 support in later versions.

 

Complete thread:

Back to the forum
Board view  Mix view
15112 Postings in 1359 Threads, 247 registered users, 17 users online (0 registered, 17 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum