Okay: this is it: Why don't we all create a Portable Driver Interface? I'm willing to work on it and produce a specification, seeing as I'm currently in a design phase for my kernel, and a method has pretty much presented itself to me. I haven't really read through the specification for the EDI, seeing as it doesn't really seem to have a large base of implementation.
Not only that, but for extremely original kernel designs, like mine, I assume it really isn't able to efficiently cover the requirements.
Several days ago I drafted something along these lines:
1. Drivers should be as absolutely bare-minimum as is possible.
2. Drivers, seeing as a PDI would be used on foreign system, should require very little documentation. They should be Implementation oriented, so as to allow people who incorporate them privately not to have to worry about the 'little stuff'. Therefore, the only thing that should need documentation is the INTERFACE to the driver.
3. Extending from this is the obvious need to define a set of rules that constrict the amount of complexity the interface for the driver should present.
- 1. A driver must only implement the bare minimum for Read/Write operations, and must always have a presentation interface for Vendor ID, etc.
- 2. If the driver is for a device that has extra features, these must be included in the interface documentation, and again, only the bare minimum needed to allow the Kernel to take advantage of such should be presented.
This implies that the driver simply presents a set of functions for low level manipulation of its device, and the kernel developer is responsible for making all the flashy, versatile stuff. This constraint on the amount of complexity a driver can present helps to reduce the anounf of inherent erroneous code the driver coder can produce, and places the possibility of errors in the hands of the Kernel dev'er.
Why is that a good thing? Because, if I were to take source form somewhere and use it in my kernel (which I avoid scrupulously), I want to be sure I'm not really taking a fully developed, yet buggy system. If all the driver I'm taking has are functions like open(), close(), read() and write(), getDriverInfo(), sendCommandWait(), and things like that, I'm more free to customize my system to take full advantage of the driver, as
I see fit. The driver is in essence, a tool, that simple tells you that the device CAN do, but gives you no particular route that you must use to DO it.
I find this to be the absolute best method to implement driver portability. It encourages pure freedom of design.
I'm not sure how well this will be received, but I think it's for the best.
When I DO post it up, it will have good documentation, and sample code, seeing as I have ulterior motives for having done it: I intend to try to increase compatibility with my OS all round.
You can be sure it will be solid.