OSD Home

## GCC

What's not to like about GCC? :)

- Free
- Open source
- Targets x86, PowerPC, 680x0, ARM, Hitachi SuperH, MIPS, and other (mainly 32-bit) CPUs
- Hosted under DOS, Windows, Linux and other OSes
- Much more flexible than commercial compilers
- High quality; fewer bugs than commercial compilers

### DJGPP (GCC for DOS): http://www.delorie.com/djgpp

DJGPP mirror sites:

US, New Hampshire JAPAN, Tokyo Austria, Vienna | Russia Spain, Madrid Germany, Koblenz

The absolute minimum you need to download (NNNN is version number):

`v2gnu/gccNNNNb.zip` (C compiler) `v2gnu/bnuNNNNb.zip` (binutils) | `v2/djdevNNN.zip` (library files)

It is strongly recommended that you download these as well:

`v2/faqNNNb.zip` (DJGPP FAQ) `v2gnu/gzpNNNNb.zip` (gzip) `v2gnu/tarNNNNb.zip` (tar) | `v2misc/csdpmiNb.zip` (DPMI server) `v2gnu/makNNNNb.zip` (GNU Make) `v2apps/rhideNNb.zip` (RHIDE) `v2gnu/sedNNb.zip` (sed)

Support: news:comp.os.msdos.djgpp. You can also read this newsgroup via Google, or via mailing list (see the DJGPP FAQ).

### CygWin (GCC for Win32): http://cygwin.com

### MinGW32 (GCC for Win32): http://mingw.sourceforge.net/

MinGW32 is smaller than CygWin because it does not have the CygWin DLL or UNIX compatability baggage.

### GCC for Linux

GCC comes with most Linux distributions. Check the CDs or download site from where you got Linux.

## Other 32-bit C compilers

### Borland C 5.5 for Win32: http://www.borland.com/bcppbuilder/freecompiler/

You must register with Borland to download this compiler. It compiles code much more quickly than MinGW. This compiler can not be used to make 16-bit programs.

### Watcom C: http://www.openwatcom.org

FTP: http://downloads.openwatcom.org/ftp/11.0c/zips/

To develop 32-bit programs under DOS, download these files:

`core_all.zip` (core binaries; all hosts) `clib_hdr.zip` (C runtime library header files) `clib_a32.zip` (C runtime libraries; all 32-bit targets) | `core_binw.zip` (Core binaries; DOS host) `c_binw.zip` (C compiler; DOS host) `clib_d32.zip` (C runtime libraries; 32-bit DOS)

You will also need the free CauseWay DOS extender: http://www.devoresoftware.com/freesource/cwsrc.htm. Get files `cwsystem.lnk`, `cwdstub.exe`, and `cwstub.exe` from this archive, put them in the `binw` directory, and add the following line to file `binw\wlink.lnk`:

            @%watcom%\binw\cwsystem.lnk

Now you can link 32-bit DOS executables by saying

            wlink SYSTEM causeway ...

### Digital Mars: http://www.digitalmars.com/download/freecompiler.html

### LCC32: http://www.cs.virginia.edu/~lcc-win32/

## 16-bit C compilers

### Turbo C 2.01, Turbo C++ 1.01: http://bdn.borland.com/museum/

### Watcom C: http://www.openwatcom.org

FTP: http://downloads.openwatcom.org/ftp/11.0c/zips/

To develop 16-bit programs under DOS, download these files:

`core_all.zip` (core binaries; all hosts) `clib_hdr.zip` (C runtime library header files) `clib_a16.zip` (C runtime libraries; all 16-bit targets) | `core_binw.zip` (Core binaries; DOS host) `c_binw.zip` (C compiler; DOS host) `clib_d16.zip` (C runtime libraries; 16-bit DOS)

### Digital Mars: http://www.digitalmars.com/download/freecompiler.html

### Micro C: ftp://ftp.dunfield.com/mc321pc.zip

### Pacific C: http://www.hitech.com.au/products/pacific.html

### Dev86-DOS: http://www.cix.co.uk/~mayday/welcome.html

### Dev86: http://www.cix.co.uk/~mayday/welcome.html

Dev86 is the only Linux compiler I know of that makes 16-bit code.

## Other compilers

### Free Pascal (32-bit): http://www.freepascal.org/

### Turbo Pascal 1.0, 3.02, and 5.5: http://bdn.borland.com/museum/

### French version of TurboPascal 7.0: ftp://212.73.230.16/borland/gratuit/turbo_pascal_701_fr.zip

### GNAT (GNU Ada): ftp://cs.nyu.edu/pub/gnat/

## Assemblers

### NASM: http://nasm.sourceforge.net/

NASM produces 16- or 32-bit code, and can be used with Linux, DOS, Windows, or OS/2.

### MASM32: http://www.movsd.com/masm.htm

### TASM (Borland's assembler) is commercial software (!)

Free source code is not very useful if you must buy the software tools needed to build it.

### MASM (Microsoft's assembler)

MASM is available from Microsoft as part of a service pack for Visual C++ 6.0

## Linkers

Linker comparison chart similar to Dark Fiber's

- Microsoft linkers: http://www.easystreet.com/~jkirwan/pctools.html.
- The `ld` linker comes with GCC, including DJGPP and MinGW32
- ALINK (and ALIB): http://alink.sourceforge.net. These are meant to be companion tools for NASM. OBJ, LIB, Win32 COFF, and Win32 RES input formats; .COM, .EXE, Win32 .EXE, and .DLL outputs.
- JLOC: http://my.execpc.com/~geezer/johnfine/index.htm#zero

## Debuggers

Note that OS kernels can't be debugged like regular applications.

- GDB is the GNU debugger; get it where you get GCC. It is a command-line program, but a variety of graphical front-ends are available.
- Turbo Debug for Borland C 5.5: http://www.borland.com/bcppbuilder/turbodebugger/ (registration required)
- OllyDebug for Windows: http://home.t-online.de/home/Ollydbg/

## Bochs PC simulator

- Home site: http://bochs.sourceforge.net

## Disk tools

- John Fine's PARTCOPY: http://my.execpc.com/~geezer/johnfine/index.htm#partcopy
- Mtools lets you use a file as a simulated DOS disk:
  - Linux/UNIX source: http://www.tux.org/pub/tux/knaff/mtools (Actually, Linux users don't need Mtools...)
  - Win32 binaries of MTOOLS: http://kos.enix.org/~d2/mtools-3.9.6-w32.tar.gz (requires CYGWIN1.DLL)
- RAWRITE
  - for Windows: http://uranus.it.swin.edu.au/~jn/linux/rawwrite.htm
  - for DOS: http://www.tux.org/pub/dos/rawrite/ [*]

[*] WARNING: DOS RAWRITE writes anywhere from 3 sectors to one entire track at a time. If used to install a bootsector, it will overwrite the sectors beyond the bootsector (e.g. the first FAT). RawWrite for Windows may behave in the same way.

## Other tools

ELF binutils for DJGPP:

- http://elfbinutils.narod.ru/
- http://membres.lycos.fr/placr/binutils.html

Note that the GRUB bootloader will load a kernel in any file format by using the a.out kludge -- the kernel need not be ELF.

ALIB: http://alink.sourceforge.net

Convert TASM code to AT&T: ftp://x2ftp.oulu.fi/pub/msdos/programming/convert/ta2asv08.zip

Convert NASM code to AT&T: http://www.niksula.cs.hut.fi/~mtiihone/intel2gas

"An Introduction to GCC" http://www.network-theory.co.uk/docs/gccintro/

## REPORT BUGS OR ERRORS IN THIS DOCUMENT