This thesis introduces how to develop kernel level device drivers on Linux platform in detail. On the basis of comparing proc file system with dev file system, we choose PCI devices and USB devices as instances to introduce the method of writing device drivers for character devices by using these two file systems. Key words: Linux; device driver; kernel space; PCI; USB Linux operation system can work in two modes. One is in user space, the other is in kernel space. When we want to write a device driver, we should decide what functions can be implemented by using module and what can be done in user space. As an general principle, all that can be programmed in user space should not be fulfilled in kernel space. Although sometimes writing a user space device driver is a wise alternative to kernel hacking, user space drivers can’t finish too much tasks. In case that we can’t accomplish our driver in user space ,or when we emphasize the importance of real time and stability, a kernel level device driver is needed.
猜您喜欢
评论