Offcoding device drivers
Posted: Wed Aug 27, 2008 11:21 am
Hi...
I was thinking of a kernel which would try to reduce the amount of work that a device driver does. We generally have a lot of abstractions in kernels which make it possible to write device drivers without doing much work.. You just have to learn to interface it properly with the kernel for the proper class of your driver.
In addition to this I had an idea of letting the kernel perform the common mechanical tasks that a device driver would perform, by the kernel. As an example, the keyboard driver needs to poll the status port for a ready bit (either to read or to write). This could be scheduled asynchronously within the kernel by telling the kernel about the port and the bit that is to be checked.
This would help in improving the kernel performance. Since all the polling activities are performed by the kernel (like for keyboard, serial port, hdd etc..) , there could be some sort of scheduling policy implemented for them. I guess this would reduce the overhead of polling in case of device drivers, since now the polling has been taken over by an intelligent entity - the kernel.
Plus, the kernel could do some kind of profiling in which if one of the device polling succeeds may be after a longer interval (say 20ms) then, it would not waste that much time in polling since it knows that it won't get the result in less than 20ms. This would naturally improve the performance.
By polling i mean to mention the small scale polling that takes place even in presence of interrupts, like that of keyboard. I don't know how big an overhead it is. But i guess for all sorts of devices this kind of polling exists.
Please comment on this...
I was thinking of a kernel which would try to reduce the amount of work that a device driver does. We generally have a lot of abstractions in kernels which make it possible to write device drivers without doing much work.. You just have to learn to interface it properly with the kernel for the proper class of your driver.
In addition to this I had an idea of letting the kernel perform the common mechanical tasks that a device driver would perform, by the kernel. As an example, the keyboard driver needs to poll the status port for a ready bit (either to read or to write). This could be scheduled asynchronously within the kernel by telling the kernel about the port and the bit that is to be checked.
This would help in improving the kernel performance. Since all the polling activities are performed by the kernel (like for keyboard, serial port, hdd etc..) , there could be some sort of scheduling policy implemented for them. I guess this would reduce the overhead of polling in case of device drivers, since now the polling has been taken over by an intelligent entity - the kernel.
Plus, the kernel could do some kind of profiling in which if one of the device polling succeeds may be after a longer interval (say 20ms) then, it would not waste that much time in polling since it knows that it won't get the result in less than 20ms. This would naturally improve the performance.
By polling i mean to mention the small scale polling that takes place even in presence of interrupts, like that of keyboard. I don't know how big an overhead it is. But i guess for all sorts of devices this kind of polling exists.
Please comment on this...