On Mon, May 19, 2014 at 05:56:02PM +0100, David Woodhouse wrote:
On Mon, 2014-05-19 at 11:20 -0400, Kevin O'Connor wrote:
On Mon, May 19, 2014 at 02:27:38PM +0100, David Woodhouse wrote: A couple of months back I looked through the sgabios assembler. It looks mostly straight-forward. The only thing that was marginally complex was its ability to keep a cache of background attributes.
However, I note that sgabios already talks about having support for SMM traps to talk to an EFI console, so perhaps that's the way forward.
I wasn't aware of that. Do you have a link?
https://code.google.com/p/sgabios/source/browse/trunk/design.txt#219
"Optionally the serial port input/output can be replaced with a SMI trigger that calls into an EFI BIOS in order to tie into its own console input and output routines rather than directly hitting the serial port. In this particular case it's assumed that all logging is handled in the EFI module that will be called. BIOS int 15h, ax = 0d042h is used to trigger SMI. The parameters passed will need to be changed to be specific to the EFI or SMI handler put in place. In the example in SMBIOS, for output, ebx = 0xf00d0000 | (char << 8), and for input, ebx = 0xfeed0000, with the character, if any, returned in the eax register with ZF set and eax=0 if no character was available."
I don't see any reference to "int 15h, ax=0xd042" as a standard. So, maybe the author of the above text also wrote their own EFI module which used that magic value?
sgabios doesn't do anything like that today. Most apps that anyone cares about (ie, modern bootloaders) are well behaving - they output their vga text using the int 10h bios interrupts. Sgabios hooks these interrupts to provide service.
In my tests, the only thing I've found which does direct text writes to the 0xa0000-0xc0000 framebuffer are really old dos programs. Even freedos uses the standard bios interface.
Hm, OK. Again I got that from sgabios's design.txt:
Known Bugs
With some versions of DOS [...]
With that predicate, I'm sure any conclusion is true.
Simple usages of freedos and msdos 6.22 appear to use the standard vgabios interface. (As a simple test case, I have seabios put the vga in graphics mode and then see what breaks - see below - most things still work.)
-Kevin
--- a/src/bootsplash.c +++ b/src/bootsplash.c @@ -44,7 +44,7 @@ enable_vga_console(void)
/* Enable VGA text mode */ memset(&br, 0, sizeof(br)); - br.ax = 0x0003; + br.ax = 0x006a; call16_int10(&br);
// Write to screen.