#holiday activities (last week ongoing).
I learned how to compile DOS COM executables with the latest GCC. It can be done with a trivial LD script, i.e. dump to 0x100. It has a memory topology of single 16-bit code and data segment.
I also learned that event with ELF toolchain “-nostdlib” is still required because crt0.o is not compatible with MS-DOS.
I also implemented couple of features for this “not for profit MS-DOS framework”:
- At launch visit in the protected mode and load GDT with code segment according to real-mode, limit for data segment set to 4GB, and return back to the real mode. CPU will just use the latest cached descriptors. This means that BIOS calls continue to work but data can be accessed with the full 32-bit address space, because x86 has opcode prefixes in real mode for 32-bit registers.
- Setup 320x240 256 color planar mode based on tweaking various VGA registers (invented by Michael Abrash originally). It has square pixels and can address multiple, and can page flip by setting the new address to CRT index port.
Not sure what I’m going to do with this next but no rush with MZ EXE (I have idea how approach that w/o sacrificing modern tools) because 64 kB is enough for some time, and I have no data limit ;-)
#x86 #dos #assembly #intel #86box #gcc