Mail Archives: djgpp/1998/01/26/03:23:39
At 11:35 1/24/1998 -0800, Eric Lange wrote:
>I need to do some 32-bit programming under DOS, but not with DPMI
>compliance. So far, I have been doing all of my development using MASM
>6.11, because only an assembler gives me the flexibility I need.
>However, my development time is too long, and I need to develop an SDK
>for other users (my application is an OS-extender).
>
>I want to be able to develop in C/C++ for obvious reasons. But, all I
>need the compiler to do is generate 32-bit code under some set of
>assumptions. I also want the linker to allow me to replace all of the
>startup code, so I can load it any way I choose. Basically, I just need
>to know the compiler assumptions.
>
>For example:
>
>* All code in a single code segment (just need to know the size)
>* All heap, global and static in a single DS
>* All stack in a single SS (DS == SS is okay)
All these are true.
>
>I believe that just about any compiler (including GCC for DJGPP) can do
>this. It's the linker that needs to provide me with flexibility. I do
>not need any of the OS-service libraries (I won't use StdIO.H, Malloc.H,
>or Stream.H), and I won't need any DPMI services. I just need 32-bit
>compiled code linked with my own assembly objects. Does the DJGPP
>linker allow me to have some sort of linker definition file? Does it
>provide the flexibility I need? Is there another linker out there that
>does? For Watcom, Microslop, or Borland? Any experience with this?
You probably can do this. If you invoke the linker directly (see the info
page for `ld'), you can omit the startup code, etc, etc. The tricky part is
getting all your code in the same format. GAS, the backend to GCC, produces
COFF object files. I believe MASM can produce COFF as well, so that may
work. Otherwise, you can convert your asm to AT&T syntax and submit it to
GAS. It may be possible to mess with the assembler and linker to get them to
use some other format, but I suspect that would be non-trivial.
Nate Eldredge
eldredge AT ap DOT net
- Raw text -