Re:Show HN: A simple way to write standalone C programs for ...
by qx89l4 on Wednesday October 02, 2019 @12:17PM
(#21138112)
I'm not sure if defaulting to 32-bit instructions would still allow calling BIOS, but good point!
In this case the design goal was to show the easiest way to jump into C and start building the actual application, so I just tried to avoid any trickery (even enabling the A20 line)
Re:Show HN: A simple way to write standalone C programs for ...
by PixelOfDeath on Wednesday October 02, 2019 @12:29PM
(#21138263)
You just set your chosen segment register(s) in protect mode, jump back to real mode, and then can use this segment register(s) in combination with the 32bit prefix to make a 32 bit memory access. All other segment registers are untouched and you can call into the bios just fine.
Presumably it would work just fine in the "Unreal mode"[1] - one which is very similar to real, with the added benefit of being 32bit address space, and 32bit instructions by default
[1] https://en.wikipedia.org/wiki/Unreal_mode