Linux real-mode interface in the Linux kernel module

I have a BIOS function that I need to call from time to time in the embedded system, and using LRMI, I was able to successfully call it from a user space program. Now I want to do the same from a loadable kernel module.

Is there any way to do this? Maybe some other library?

+3
source share
1 answer

It is associated with the mode in which the processor is located (which is protected mode, which is turned on after the BIOS initializes all resources). To use BIOS interrupts again, you will need to use v8086 mode, that is, when the processor emulates a 16-bit real-mode machine. Then you can set your registers and trigger an interrupt using the virtual mode program.

Here's how to get into virtual mode: http://www.brokenthorn.com/Resources/OSDev23.html

You can also try switching to Real mode, but this includes rebooting the processor. I do not know how you will do this programmatically, since you probably cannot.

0
source

Source: https://habr.com/ru/post/1749418/


All Articles