Hi,
twrl wrote:
So far so good, but how do I know they're there when I discover a mountable volume with more drivers on it?
In general, I like the "pull" model where it's a hierarchical tree, and the parent is responsible for "pulling in" any children. For example:
PCI bus enumeration might find a USB controller, a video card and a network card and start those drivers.The USB controller driver might enumerate USB devices, find a mass storage device and a keyboard and start those drivers.The USB mass storage device driver might find 3 partitions, determine their file systems and start them.
The USB keyboard driver might start the virtual terminal layer.
The video driver might detect a monitor and try to start the virtual terminal layer (and find it already started by keyboard).
The network card might start a TCP/IP stackTCP/IP stack might start a HTTP server
The virtual terminal layer (after getting enough devices for input and output) starts a login prompt.The login prompt (after successful login) starts the user's GUI.
twrl wrote:
Or choose between them if I have multiple drivers available?
If there are multiple drivers, choose the most specific driver. For example, if there's a "generic OHCI USB controller driver" and an "vendorID 0x1234, deviceID 0x1234 OHCI USB controller driver" you'd choose the one with the matching vendorID/deviceID where possible. If there are multiple device drivers with equally specific details, then complain that the OS failed to uninstall one before the other was installed (e.g. add a warning to your logs or something), then start the driver with the most recent time stamp.
Also note that I'd setup the file system's directory structure to suit the search order - e.g. a directory for each "PCI class ID"; containing none or more directories for "vendor ID", etc. You'd search for the file "class_0x0033/vendor0x1234/device0x1234.drv"; then "class_0x0033/vendor0x1234.drv"; then "class_0x0033.drv". This makes it impossible to have multiple drivers with equally specific details.
Cheers,
Brendan