On Fri, Jul 15, 2016 at 01:49:49PM +0200, Gerd Hoffmann wrote:
Finally, one high level observation is that we know there are a number of quirks in various vgabios emulators. For example, we know some emulators don't handle certain 32bit instructions when in 16bit mode (hence scripts/vgafixup.py), we know some versions of Windows use an emulator that doesn't like some stack relative instructions (hence the vgabios is compiled without -fomit-frame-pointer), and we know Windows Vista doesn't like the extra stack in high ram (the skifree bug). Any thoughts on what happens with these quirks if the main seabios code hooks int10?
Good question. Do the emulators (both win, xorg) use the int10 vector set by seabios in the first place? Or go they load the vgabios and run it, including the initialization, and use whatever entry point the init code sets up? I suspect it is the latter. But needs investigation and testing.
I think they just call the existing int10 handler. In general, it's not safe to rerun the vga init code. Also, if they did run the init it would lead to extra copies of the SeaVGABIOS version banners in the debug logs, which I don't recall seeing.
Also a serial console for windows guests isn't that useful, so I wouldn't worry too much about windows emulator issues.
It's not uncommon (at least on real hardware) to add sgabios to a system for the boot menus, but then use a regular OS at runtime. The problem with the vga emulation quirks is that they often result in mysterious system failures.
Have you considered implementing the serial support as a kind of "serial seavgabios" instead of directly in seabios? That would have the advantage of pulling in all the existing vgabios quirk handling.
-Kevin