为什么我不能从保护模式调用BIOS中断? [英] Why can't I call BIOS interrupts from protected mode?

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

问题描述

对.今天,我已经花了三个多小时的时间来了解为什么在保护模式下不能调用bios ISR.一旦设置好IDT,我就知道它不一定是IVT的常规地址,而且在保护模式下,段也没有固定的大小,等等.但是我仍然不明白为什么你不能创建一个4GB的存储空间.段,将您的IDT段映射到BIOS IVT,将所有内容设置在环0中并进行调用.那不行吗?

Right. I've spent over three hours today trying to understand why you can't call a bios ISR when in protected mode. I get that once you set and IDT it wont necessarily be in the usual address for the IVT plus segments dont have a fixed size in Protected mode, etc.. But I still don't get why can't you jsut create a single 4GB segment, map your IDT segments to the BIOS IVT, set everything in ring 0 and call them. Shouldn't that work?

大多数文章都说:请记住,您不能在保护模式下使用BIOS中断!"没有探究该主题,或者是极具描述性的主题,并引用陷阱,异常,图片重新映射,权限不足以及段寄存器存在问题等作为其背后的原因.

Most articles either say: "Remember you cant use BIOS interrupts in protected mode!" without exploring the subject or are extremely descriptive and cite traps, exceptions, pics remmaping, lack of rights and problems with segment registers as the reason behind it.

如果有人可以提出一个更人性化的解释,那将非常有帮助...我毫不怀疑文章说了什么,我只是想了解为什么它是如此痛苦"!

It would be extremely helpful if someone could come up with a more human-friendly explanation... I'm not doubting what the articles say, I just want to understand why it is such a 'pain'!

提前谢谢!

推荐答案

我认为最大的问题是在假定处理器处于实模式的情况下编写BIOS例程.如果从不受支持的上下文中调用它们,则不能确保BIOS例程的行为符合预期.它们可能会自行失败,也可能会弄乱处理器状态并使您退出保护模式.

I think the biggest problem is that the BIOS routines were written assuming the processor is in real mode. If you call them from an unsupported context, you can't be sure the BIOS routines will behave as expected. They could fail on their own, or they could mess up the processor state and kick you out of protected mode.

这篇关于为什么我不能从保护模式调用BIOS中断?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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