hjalfi
Experienced Member
I have a compiler which I would like to port to produce DOS 32-bit executables (the Amsterdam Compiler Kit). (It already produces 16-bit DOS executables but that's not quite good enough to make it self hosting.) I've been looking at how to do 32-bit code on DOS and yikes.
AFAICT, the simplest way is to require the use of a DPMI host to do all the annoying 32-bit stuff. My understanding is that I will end up with a 16-bit DOS executable containing a stub program that initialises DPMI, switches to 32-bit protected mode, and then loads the bulk of the program from the tail of EXE file. (And, presumably, manually relocates it.) The DPMI host then takes care of all the mode switching so that I can just call normal DOS interrupts from 32-bit mode and everything should Just Work.
Does this pass sanity checking? I haven't worked with 32-bit DOS before. Sadly I have to write all my own tools, including the linker backend. As a model I'm intending to totally rip off DJGPP's bootstrap loader; if anyone knows of any better (i.e. simpler) source to look at I'd love to know.
AFAICT, the simplest way is to require the use of a DPMI host to do all the annoying 32-bit stuff. My understanding is that I will end up with a 16-bit DOS executable containing a stub program that initialises DPMI, switches to 32-bit protected mode, and then loads the bulk of the program from the tail of EXE file. (And, presumably, manually relocates it.) The DPMI host then takes care of all the mode switching so that I can just call normal DOS interrupts from 32-bit mode and everything should Just Work.
Does this pass sanity checking? I haven't worked with 32-bit DOS before. Sadly I have to write all my own tools, including the linker backend. As a model I'm intending to totally rip off DJGPP's bootstrap loader; if anyone knows of any better (i.e. simpler) source to look at I'd love to know.