Consider using Digital Mars C compiler for things like the BIOS. It should have full support for x86 segmentation etc. It is now fully open source: https://github.com/DigitalMars/Compiler