在对 Linux 操作系统的网络驱动进行了研究后,设计和实现了一种基于驱动代码分离的驱动框架,将驱动程序分为在用户态执行的部分和在内核态运行的内核模块部分,用户态的驱动部分主要是调用频率较低的性能无关的代码,如设备的状态信息获得等;在内核态运行的驱动内核模块包括驱动代码中的关键部分,如中断响应、数据传输等。以PCnet32网络驱动为例,实现了驱动程序代码在用户空间和内核空间的分离,在一定程度上实现了驱动的隔离,减少了由驱动引起的漏洞破坏操作系统的可能性,同时减少了内核中运行的驱动代码,也满足了驱动性能的要求,达到了保护操作系统可靠性的目的。%After studied the network driver of Linux operating system, a framework of driver based on factorization between kernel and user-space has been designed and implemented. The driver is divided into user-space part and kernel part, the codes in user-space are less called and independent of performance, e.g. the device status information etc; the codes in kernel are the key part, e.g. interrupt handler and data transformation etc. The isolation of driver is implemented based on the factorization of network driver PCnet32, the possibility of crash caused by driver bug is reduced and the amount of codes in kernel is reduced too. The factorization achieves the goal of ensuring the security and performance of operating systems.
展开▼