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.
我一直在玩玩具操作系统,并一直使用grub作为我的引导加载程序。最近在尝试使用VGA时,我发现我无法使用硬件中断。我发现这是因为我被grub挂入了保护模式。
Does anybody know how to get back into real mode without having to get rid of grub?
有没有人知道怎么回到实模式而不必摆脱grub?
2 个解决方案
#1
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.
如果您使用GRUB作为引导加载程序,则可以使用intcall(在COMBOOT API中指定)在您的情况下调用BIOS函数int 0x10来访问VESA VBE。
But this will not help if you need to access the VGA hardware registers.
但是,如果您需要访问VGA硬件寄存器,这将无济于事。
#2
1
you mean writeport(value,$3c9)?
你的意思是writeport(价值,$ 3c9)?
>mov 03c9,AH
>out value,AL
or similar in INTEL asm(NASM)
或者类似于INTEL asm(NASM)
3c9 3c8 IIRC are VGA registers.
3c9 3c8 IIRC是VGA寄存器。
#1
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.
如果您使用GRUB作为引导加载程序,则可以使用intcall(在COMBOOT API中指定)在您的情况下调用BIOS函数int 0x10来访问VESA VBE。
But this will not help if you need to access the VGA hardware registers.
但是,如果您需要访问VGA硬件寄存器,这将无济于事。
#2
1
you mean writeport(value,$3c9)?
你的意思是writeport(价值,$ 3c9)?
>mov 03c9,AH
>out value,AL
or similar in INTEL asm(NASM)
或者类似于INTEL asm(NASM)
3c9 3c8 IIRC are VGA registers.
3c9 3c8 IIRC是VGA寄存器。