Looking for 16-bit c compiler for x86

user639642 picture user639642 · May 19, 2011 · Viewed 9.6k times · Source

I am working on porting uc/OS-II from DOS to x86 (real mode). I need:

  1. A compiler to generate real mode 16-bit x86 assembly

  2. An assembler to assemble the generated assembly into an object file

  3. A linker to link the object files together and output an executable (raw binary, COFF, PE, or ELF formats are fine)

  4. A standard library without invoking any DOS services (int 21h), only depend on BIOS service.

I am wondering whether there is any tool-chain could do it.

Answer

Jim Mischel picture Jim Mischel · May 19, 2011

Check out the FreeDOS project. They have developer tools that include compilers, assemblers, and linkers. You'll probably have to modify the standard library, though, so that it uses BIOS calls rather than int 21h.