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).
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?
Driver design
Re:Driver design
What information is only available in real mode??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...
Re:Driver design
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
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.
The interrupts themselves are still available (With the above caveat) if you drop into V86 mode.
Re:Driver design
Then you can let the drivers read the BDA but not change it...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).