New Device Driver System/Architecture
Posted: Sun Mar 26, 2006 3:34 pm
With all the trouble about device drivers you get when developing an OS, I've recently found myself thinking about it and wondering if there wasn't a better solution. And indeed, I found something, a mere idea only, that could make the os developer's life a lot easier. Anyway, here it goes:
When the kernel detects a new device on the PCI, USB, etc. bus or when it does the startup check and gets a list of devices, it sends the driver a short message, in order to start the communication. This message could be anything (HELLO, HI, e.g.) and then the device driver sends an answer, and this answer is an URL (typically on the device manufacturer host, or some mirror). Then, the kernel loads the content of this URL. The resulting document must be an XML document, well-formed and valid upon a given DTD scheme which must be followed by the hardware manufacturers.
What follows here is somewhat implementation specific, and it assumes a microkernel/hybrid design. The kernel has a device driver program that is then loaden into memory and executed (as you would do normally with other device drivers). But this device driver is different, as you always load the same one, ideally the only driver you shall ever write. As a parameter, the program receives the XML document. After that, when a system call occurs and the driver is required to do something, it looks the action up in the XML document and does what it is told to do there. The same happens when the device sends an event, the driver has like a database containing everything it needs in order to operate.
So, the basic idea is that the developer must now only provide a single driver which is kind-of self-adapting to the circumstances. The system is also platform-independant, as the variable data is only XML, and only the driver must be ported.
This is like the basic architecture of the system. I hope one could understand it. In order to improve the performance of the system, one could store the XML document on the local harddisk and check it on the internet every month or so (or when the ethernet card is idle).
The keyword 'ethernet card' brings us to the bootstrap process of the system. The ethernet card or modem cannot be loaden in the same way, as it must run first to get information (a typical example of a bootstrap). But even then, it can follow the same procedure. One could have the most basic ethernet driver loaden as a module by GRUB and then as first thing, the ethernet driver updates itself et voil?.
This is where my ideas end. I hope you don't think something like 'calm down, B. Gates' or anything similar of me , but I must nevertheless admit that I've been thinking about this since a month and I haven't found really big drawbacks apart from the bootstrap problem. I also hope you could understand everything (I sometimes use a weird english ). But anyway, if only one or two device manufacturers would follow this 'standard', others would soon follow...
Hope you're interested,
Robin Hollenstein (call me Robin or Candamir, whatever you like )
PS: If this is crap, tell me
When the kernel detects a new device on the PCI, USB, etc. bus or when it does the startup check and gets a list of devices, it sends the driver a short message, in order to start the communication. This message could be anything (HELLO, HI, e.g.) and then the device driver sends an answer, and this answer is an URL (typically on the device manufacturer host, or some mirror). Then, the kernel loads the content of this URL. The resulting document must be an XML document, well-formed and valid upon a given DTD scheme which must be followed by the hardware manufacturers.
What follows here is somewhat implementation specific, and it assumes a microkernel/hybrid design. The kernel has a device driver program that is then loaden into memory and executed (as you would do normally with other device drivers). But this device driver is different, as you always load the same one, ideally the only driver you shall ever write. As a parameter, the program receives the XML document. After that, when a system call occurs and the driver is required to do something, it looks the action up in the XML document and does what it is told to do there. The same happens when the device sends an event, the driver has like a database containing everything it needs in order to operate.
So, the basic idea is that the developer must now only provide a single driver which is kind-of self-adapting to the circumstances. The system is also platform-independant, as the variable data is only XML, and only the driver must be ported.
This is like the basic architecture of the system. I hope one could understand it. In order to improve the performance of the system, one could store the XML document on the local harddisk and check it on the internet every month or so (or when the ethernet card is idle).
The keyword 'ethernet card' brings us to the bootstrap process of the system. The ethernet card or modem cannot be loaden in the same way, as it must run first to get information (a typical example of a bootstrap). But even then, it can follow the same procedure. One could have the most basic ethernet driver loaden as a module by GRUB and then as first thing, the ethernet driver updates itself et voil?.
This is where my ideas end. I hope you don't think something like 'calm down, B. Gates' or anything similar of me , but I must nevertheless admit that I've been thinking about this since a month and I haven't found really big drawbacks apart from the bootstrap problem. I also hope you could understand everything (I sometimes use a weird english ). But anyway, if only one or two device manufacturers would follow this 'standard', others would soon follow...
Hope you're interested,
Robin Hollenstein (call me Robin or Candamir, whatever you like )
PS: If this is crap, tell me