Driver design

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Unwritten Axiom

Driver design

Post by Unwritten Axiom »

I was writing my serial port driver, when I noticed it had to read information from tables in the BIOS. Then I realized that some drivers may need to access information only available in real mode...
I was thinking I could have the bootloader load in some real mode drivers specified in a config file and run their initialization routines before switching to protected mode, but that would make a major security hole in the system (by allowing custom drivers to start in real mode). :o
Also, I'm not sure how to implement the drivers... Should they each have the same functions, or have one function to find out the capabilities of the driver and which other functions are available?
Peter_Vigren

Re:Driver design

Post by Peter_Vigren »

Unwritten Axiom wrote: I was writing my serial port driver, when I noticed it had to read information from tables in the BIOS. Then I realized that some drivers may need to access information only available in real mode...
What information is only available in real mode??
Unwritten Axiom

Re:Driver design

Post by Unwritten Axiom »

I noticed it while reading that it had to access BIOS memory. I was thinking that some other drivers may not only get info from BIOS memory but the BIOS interrupts as well (I don't remember what device I was thinking of, but I know three was one).
Curufir

Re:Driver design

Post by Curufir »

So long as you don't trash the BIOS data areas by allocating memory over them then that data is still available to you in pmode.

The interrupts themselves are still available (With the above caveat) if you drop into V86 mode.
Peter_Vigren

Re:Driver design

Post by Peter_Vigren »

Unwritten Axiom wrote: I noticed it while reading that it had to access BIOS memory. I was thinking that some other drivers may not only get info from BIOS memory but the BIOS interrupts as well (I don't remember what device I was thinking of, but I know three was one).
Then you can let the drivers read the BDA but not change it...
Post Reply