Linux 内核模块中的 Linux 实模式接口

发布于 2024-09-04 17:42:03 字数 114 浏览 3 评论 0原文

我有一个需要在嵌入式系统上不时调用的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温柔女人霸气范 2024-09-11 17:42:03

它与处理器所处的模式有关(保护模式,在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文