|
|
|
|
|
by amelius
3323 days ago
|
|
Honest question: what is so complicated about writing device drivers, whose sole purpose typically is to transport data from input to output, and vice versa? Also, shouldn't drivers be sandboxed to prevent stability problems from affecting the rest of the system? |
|
I don't think it's the device driver part that makes it complicated. It's implementing something that is a collection of interdependent state machines in an asynchronous fashion, and doing that in a way that performs well and is reliable and safe.
In their specific example of a USB driver, here's what's in the paper:
"It receives a large number of un-coordinated events sent from different sources such as OS, hardware and other drivers, in tricky situations when the system is suspending or powering down. It can receive unexpected events from disabled or stopped devices, noncompliant hardware and buggy drivers. The hub driver can fail requests from incorrect hardware or buggy function drivers. However,it is important that the USB hub itself handles all events and does not crash or hang itself."
But it doesn't have to be a device driver. They give the example of elevator control in the paper as another collection of state machines that interact.
>shouldn't drivers be sandboxed to prevent stability problems
That would be a microkernel, which has it's own set of problems. There are ways to implement user mode drivers for Windows, Linux, etc, but they are currently limited in functionality and performance.