Page 1 of 1

Driver design

Posted: Sat Jul 26, 2003 10:08 am
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?

Re:Driver design

Posted: Sat Jul 26, 2003 12:39 pm
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??

Re:Driver design

Posted: Sat Jul 26, 2003 1:01 pm
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).

Re:Driver design

Posted: Sat Jul 26, 2003 1:05 pm
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.

Re:Driver design

Posted: Sat Jul 26, 2003 1:06 pm
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...