Watcom

From OSDev.wiki
Revision as of 16:40, 8 March 2007 by Combuster (talk | contribs) (Rough import from osfaq)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Convert

The Watcom compiler suite is a powerful (reputed to produce the best optimized code for 16 and 32 bits programs by demosceners and game coders in end '90s) compiler/assembler/make/linker suite that comes with tools for binary files manipulations.

I stopped using Watcom in favour for GCC. Watcom only does x86 output. If I ever get my kernel working I'll try a Watcom port and post all the methods I used to get it working -REV

How can I tell Watcom to produce XXX files?

Natively, all Watcom C/C++ compilers can produce is OMF (.obj) files by default. These can be linked with the Watcom linker into an ELF file but not plain binary. Its reccomended you use some other linker.

What are the differences between Watcom 11.0c and Open Watcom 1.3?

Nothing really, both compile the code almost the same except a few new features are added.

Such as? --[Kemp|TheKemp]

Why is my final executable not in fact executable?

Watcom has a habit of inserting additional function calls in your code which are not necessarily available in the final binary. To work around this add the '-s' switch to the command line you call the compiler with, this switch removes stack overflow checking. However the 32-bit C (Wcc386) and C++ (Wpp386) insert function calls that the processor will flag as invalid and if the interrupt controllers are not fixed the CPU will triple fault. This does not seem to a trouble with the 16-bit compilers. I am still trying to figure out how to bypass these calls.

Linking Watcom produced object files and linking them with JLOC causes some problems at runtime

Watcom makes DS follow the DS:DGROUP and if you do not want that structure your going to have to fiddle with Jloc.