Grub and getting into Real Mode (low-level assembly language programming)

本秂侑毒 提交于 2019-12-21 12:38:50

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!