BIOS在保护模式下中断 [英] BIOS Interrupts in protected mode

查看:275
本文介绍了BIOS在保护模式下中断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个操作系统项目中,使用isolinux(syslinux 4.5)作为引导程序,并使用组织在0x200000的multiboot标头来加载我的内核.

I'm working on an operating system project, using isolinux (syslinux 4.5) as bootloader, loading my kernel with multiboot header organised at 0x200000.

据我所知,内核已经处于32位保护模式.我的问题:有没有更简单的方法来访问BIOS中断? (基本上我想要0x10:D)

As I know the kernel is already in 32-bit protected mode. My question: Is there any easier way to get access to BIOS Interrupts? (Basically I want 0x10 :D)

加载后,我的内核会设置自己的GDT和IDT条目,并进一步重新映射IRQ.因此,是否可能在内核加载并设置VGA/SVGA模式(VBE 2.0模式)之后立即跳入实模式.然后,在继续使用内核并进入保护模式后,我将在其中使用VBE 2.0物理缓冲区地址写入屏幕吗?如果是,怎么办?我尝试了很多,但是没有成功:(

After loading, my kernel sets up its own GDT and IDT entries and further remaps IRQs. So, is it possible to jump into real mode just after the kernel is loaded and set up VGA/SVGA modes (VBE 2.0 mode). Then after I'll proceed with my kernel and jump into protected mode where I use VBE 2.0 physical buffer address to write onto screen? If yes how? I tried a lot but didn't get success :(

旁注: 我在互联网上进行了很多搜索,发现syslinux 1.x +提供了_intcall api,但我对此不是100%肯定. 请参考"syslinux 4.5 \ com32 \ lib \ sys \ initcall.c"

Side note: I searched a lot on internet and found that syslinux 1.x+ provides _intcall api, I'm not 100% sure about it. Refer to "syslinux 4.5\com32\lib\sys\initcall.c"

推荐答案

简短的回答是. BIOS调用被设计为在实模式下运行,并且不遵守受保护模式所设置的限制,因此不允许您使用它们,如果尝试,CPU将会发生三重故障.

The short answer is no. BIOS calls are designed to operate in real mode and don't respect restraints set by protected mode, so you're not allowed to use them and the CPU will triple-fault if you try.

但是,x86处理器提供虚拟8086模式,该模式可用于模拟在以下操作系统中运行的x86处理器16位实模式. OSDev Wiki和论坛提供了有关此主题的大量信息.如果采用这种方式,通常最好将内核映射到上半部分(Linux使用0xC0000000),以避免干扰VM86代码.

However, x86 processors provide Virtual 8086 mode, which can be used to emulate an x86 processor running in 16-bit real mode. The OSDev wiki and forums provide a wealth of information on this topic. If you go this route, it is generally a good idea to map the kernel to the higher half (Linux uses 0xC0000000) to avoid interfering with VM86 code.

这篇关于BIOS在保护模式下中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆