How to use real mode BIOS / VESA calls from GRUB?
Asked Answered
A

2

0

I am developing a simple Grub module which would enable some additional video settings/initializations at the early stage of the boot process. My actual best idea would be to use some VESA calls for the task.

Unfortunately, recently I've found real mode calls are unavailable from the Grub.

But the GRUB can do really complex operations which are probably unimaginable without the help of the BIOS.

How is it possible? How could I call the bios from the grub?

Antidromic answered 10/6, 2015 at 5:13 Comment(0)
R
1

As far as I can see, grub uses the function grub_bios_interrupt to call 16-bit interrupts. This function internally uses the prot_to_real function to switch to real mode and real_to_prot to switch back. I'm guessing you should be able to use these functions too, but perhaps you would need to wrap them in a function like grub_bios_interrupt does.

Rosaceous answered 14/6, 2015 at 7:31 Comment(0)
C
0

You could just use a BIOS extender. They allow you to use real mode interrupts from protected mode! I haven't used them myself, though I've heard they really work. An example is SudoBIOS which was able to boot MikeOS in protected mode, although I can't vouch for it myself.

Catch answered 11/6, 2015 at 18:30 Comment(3)
A bios extender, from a grub module?? Are you sure?Antidromic
Why not? You just have to follow the instructions for installing one. For example, SudoBIOS is built as a flat binary(?) that needs to be loaded at 0x2000. I don't think GRUB can do that, so you'd need load it your self. It might take a little work to get it running, but it would be worth it.Catch
Not a good idea, actually. GRUB owns the interrupt table and may overwrite your “BIOS extender’s” table at a whim.Swatter

© 2022 - 2024 — McMap. All rights reserved.