问题
I've been working on a toy OS and have been using grub as my boot loader. Recently when trying to use VGA I found that I couldn't use hardware interrupts. This I found was because I had been slung into protected mode by grub.
Does anybody know how to get back into real mode without having to get rid of grub?
回答1:
If you are using GRUB as your boot loader you could use the intcall
(as specified in the COMBOOT API) to call BIOS function int 0x10 in your case to access the VESA VBE.
But this will not help if you need to access the VGA hardware registers.
回答2:
you mean writeport(value,$3c9)?
>mov 03c9,AH
>out value,AL
or similar in INTEL asm(NASM)
3c9 3c8 IIRC are VGA registers.
来源:https://stackoverflow.com/questions/97946/grub-and-getting-into-real-mode-low-level-assembly-language-programming