I remember using DJGPP back in the 1990s before I had been exposed to Linux and feeling that it was a strange beast. Compared to the Microsoft C Compiler and Turbo C++, the tooling was bloated and alien to DOS, and the resulting binaries were huge. But DJGPP provided a complete development environment for free, which I got from a monthly magazine, and I could even look at its source code if I wished. You can’t imagine what a big deal that was at the time.
But even if I could look under the cover, I never did. I never really understood why was DJGPP so strange, slow, and huge, or why it even existed. Until now. As I’m in the mood of looking back, I’ve spent the last couple of months figuring out what the foundations of this software were and how it actually worked. Part of this research has resulted in the previous two posts on DOS memory management. And part of this research is this article. Let’s take a look!
Julio Merino
Having access to tools such as this, including the source code, must’ve been a huge deal to a lot of people, even if ti was “strange, slow, and huge” as the author notes.
So, the bottom line is:
DJGPP allowed running Unix applications on DOS (GNU to be more precise).
However, it did this without help from the DOS kernel, nor had the ability to stay in memory when the job was done. So basically every small application, including things like “echo” or “more” had to include a mini Unix “kernel” inside them, and had to go inside DPMI and come out after running.
That was the expensive part.
Thank you for the clarification. I encountered this when i first tried to learn programming on the family’s cyrix computer. I ended up paying a local bbs operator to obtain visual basic 3 on floppies instead. Trip down memory lane.
sukru,
I only ever used DJGPP to write & compile DOS software, well before I had any experience with unix. I don’t really remember anything of what you are describing. I don’t know if the unix stuff was there and I didn’t realize it, or was it just part of an optional unix library? Regardless, I was not using unix apis at that time. As I recall, DJGPP needed to have some internal plumbing to make 16bit DOS kernel calls from a 32bit environment. This would have required a “kernel” regardless of supporting unix software.
I think it was quite a bit later when I started using cygwin and mingw to run unix software (on windows).
Alfman,
If you are under Windows, it probably handles a significant part of if already. (32-bit DOS Extender).
And for a comparison…
This is what I get for “echo” on my machine, for example:
It is a 97K executable along with 136K extender (go32-v2.exe)
Whereas the entire DOS kernel (SYS.COM) was smaller than those.
I don’t have an environment to test such old software and I don’t think I ever had access to another 32bit dos compiler to compare against.
But curiosity prompted me to test today’s output…
I tried compiling 32bit briefly until I saw that my system doesn’t have 32bit dependencies.
I didn’t bother testing on windows, someone else already did…
https://github.com/MichalStrehovsky/sizegame
sukru,
Unless I’m remembering it incorrectly, the DJGPP binaries were stand alone and didn’t require a separate dos extender (just the standard XMS driver).
I remember correctly!
https://www.hzdr.de/FWR/VB/TUTORIALS/djgppfaq.html
I wonder how much smaller older DJGPP binaries were when a separate DOS extender was being used.
Alfman,
Thanks, I assumed they needed the separate extender.
In any case, if there is an existing one in memory (like Windows), it should potentially (very highly likely) cut down the startup time, though.
Hrm. Most of my memories were of trying to get unix binaries to work on windows ( this is before I discovered cygwin, or possibly after if they were missing some odd utility I found). So I’d attempt to compile, find that the build was broken in DJGPP, reboot in linux, try to build it in linux, see that it worked, and go back to windows to trouble shoot. I think I did manage to get one or two to actually compile that were initially broken, but a lot of things just didn’t work because of some assumptions made about a *nix environment that weren’t automatically solved by DJGPP.
I never viewed DJGPP as a portability tool, though I guess many people were using it for that. I was just using it as a 32bit DOS compiler. DJGPP in combination with RHIDE (osnews covered not long ago) were really fantastic free alternatives to borland’s IDE & compiler.
https://blogsystem5.substack.com/p/the-ides-we-had-30-years-ago-and