简体   繁体   English

Linux内核模块中的Linux Real Mode Interface

[英]Linux Real Mode Interface in a linux kernel module

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. 我有一个我需要在嵌入式系统上不时调用的BIOS功能,并且使用LRMI我能够从用户空间程序成功调用它。 Now I want to do the same from a loadable kernel module. 现在我想从可加载的内核模块中做同样的事情。

Is there any way to do this? 有没有办法做到这一点? Some other library maybe? 还有其他一些图书馆?

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). 它与处理器所处的模式有关(这是受保护模式,在bios初始化所有资源后打开)。 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. 为了再次使用BIOS中断,您必须使用v8086模式,即处理器模拟16位实模式机器时。 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 以下是进入虚拟模式的方法: 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. 我不知道你将如何以编程方式执行此操作,因为您可能不会。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM