Linux 内核模块中的 Linux 实模式接口
我有一个需要在嵌入式系统上不时调用的 BIOS 函数,并且使用 LRMI 我能够从用户空间程序成功调用它。现在我想从可加载内核模块中执行相同的操作。
有什么办法可以做到这一点吗?也许还有其他图书馆?
I have a BIOS function I need to call from time to time on an embedded system, and using LRMI I was able to call it successfully from a user space program. Now I want to do the same from a loadable kernel module.
Is there any way to do this? Some other library maybe?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它与处理器所处的模式有关(保护模式,在 BIOS 初始化所有资源后打开)。为了再次使用 BIOS 中断,您必须使用 v8086 模式,即处理器模拟 16 位实模式机器。然后,您可以设置寄存器并使用虚拟模式程序调用中断。
以下是进入虚拟模式的方法: http://www.brokenthorn.com/Resources/OSDev23.html
您也可以尝试切换到实模式,但这涉及重置处理器。我不知道你将如何以编程方式执行此操作,因为你可能做不到。
It has to do with the mode the Processor is in (which is protected mode, which turns on after bios initializes all of the resources). In order to use BIOS interrupts again, you will have to use v8086 mode, which is when the processor emulates a 16bit real mode machine. You can then set your registers and call your interrupt with a virtual mode program.
Here's how to get into virtual mode: http://www.brokenthorn.com/Resources/OSDev23.html
You could also try and switching into Real mode, but this involves resetting the processor. I don't know how you would do this programmatically, since you probably can't.