Hi,
kan wrote:Carbonbased u said :
Are there plans for a generic driver interface?
What do u mean by that? r u asking me a question? or r u saying it sarcastically?
I think you asked Frizz "Do u drivers use any Standard Interface?" after he offered his own OS's code, and Carbonbased looked at Frizz's source and found that the floppy driver code was built directly into Frizz's kernel. After that I assume Carbonbased was wondering if Frizz was planning to implement a standard device driver interface.
kan wrote:do u know any most widely accepted STANDARD for drivers?
Is UDI universally accepted?
There is no
widely accepted standard for drivers. UDI isn't used by any OS AFAIK (although I might be wrong - there could be a few little OS projects trying to use it).
The main problem I see is that different OS's do things differently, so the device drivers need to be written (or modified) to account for these differences.
For example, for my OS device drivers run as CPL=3 processes that aren't really any different to normal applications. The device drivers use asynchronious messaging, IO port access is emulated, IRQ's are "virtualized". There's other differences for specific drivers too - like storage device drivers need to be able to read/write N bytes at any logical address, where on most OS's they deal with whole sectors only. Printers and scanners are treated like write-only or read-only storage devices (ie. the same as hard disks). Video, sound, keyboard, mouse, etc use completely different device driver interfaces (they communicate with the OS's "user interface" module rather than the "virtual file system" module). Then there's differences in memory management, scheduling, etc that must be accounted for.
Then there's the "device manager", which is responsible for detecting the devices and starting the device drivers. The device manager handles all resource assignment (and can dynamically change a device's resources without telling the device driver). It's also used to stop (and replace) device drivers. When the device manager starts a PCI or Plug and Play device driver it sends the device driver a message containing details on all of the resources that the device driver can use. For other device drivers (legacy ISA devices) the driver needs to tell the device manager which resources it needs access to before it can actually use them.
Given all of the above, the chance of me finding device drivers elsewhere that will come close to working is extremely small, and the chance of my device drivers being useful for any other OS is also very small. Device drivers designed for any OS are going to have similar problems if you attempt to port them to a different OS.
In general, it would also be possible to recycle any other OS's drivers, but to do this your OS would need to contain everything that the other OS's drivers need. This can mean your kernel becomes a mostly compatible version of the other OS's kernel. IMHO this would be a complete waste of time (you might as well use that other OS's kernel and drivers instead of writing your own OS).
To me, this means that the only sane option is to create device drivers specifically for your OS.
Cheers,
Brendan