Page 1 of 1

module driver interface

Posted: Wed Sep 26, 2007 6:09 pm
by Meshounah
What would be the easiest way of implementing a dynamic driver loading interface? my idea was to have certain parts of the kernel blank and load the driver into these blank spots. What do you think?

Posted: Wed Sep 26, 2007 6:32 pm
by frank
You could reserve a certain section of the address space for the drivers. ie all of the space between 0xD0000000 and 0xDFFFFFFF is designed for use with drivers. Then you could use relocatable code to put the drivers at the right locations.

Posted: Wed Sep 26, 2007 6:41 pm
by Meshounah
ok that makes sense thanks(my kernel isn't that far but that was bugging me)

Posted: Wed Sep 26, 2007 10:58 pm
by Dex
The simplest way, is just have a list of address to fake drivers, if you have no driver load, it just returns with a error code (eg: no driver loaded).
When you load a driver as a relocatable module, just replace the address in the list with the load address of the driver.