节点文献

一种嵌入式驱动程序辅助生成工具的设计与实现

Design and Implement of a Tool for Embedded Device Driver Automatic Generation

【作者】 杨震

【导师】 陈向群;

【作者基本信息】 北京大学 , 计算机软件与理论, 2008, 硕士

【摘要】 随着嵌入式系统的广泛应用,新的嵌入式设备层出不穷,为这些设备快速编写正确的驱动程序因而越来越困难。一方面,设备寄存器相关的操作代码(如:位操作代码)编写繁琐且容易出错,并且不精确的设备文档影响了驱动程序员熟悉设备的寄存器信息和访问方式。另一方面,由于嵌入式系统缺乏统一的标准,已有的为每个平台上的每个设备分别编写驱动程序的开发方式不易复用。通过接口描述语言描述设备驱动程序所需的信息,实现驱动程序开发的自动化和复用有助于解决上述问题。为了能够快速准确的开发驱动程序,本文设计实现了一个嵌入式驱动程序辅助生成的框架,主要包含一个简洁易读、支持复用和平台无关性的驱动程序接口描述语言(EDDI)和一个可以自动生成硬件相关代码的转换器。EDDI采用类XML的标记式语言的语法规则,使得EDDI描述文件简洁易读。针对驱动程序中硬件操作相关代码繁琐易出错的特点,设备的EDDI描述文件详细描述编写硬件相关代码所需的寄存器信息、硬件平台信息以及为实现设备的基本功能所需的寄存器操作序列,通过转换器自动生成硬件相关操作的代码供驱动程序员使用。EDDI从寄存器、硬件平台特性、设备基本功能三个方面描述设备,当驱动程序所需的设备基本功能改变时,寄存器和硬件平台特性描述可以复用;当设备被置于不同硬件平台时,寄存器和设备基本功能描述可以复用。除此之外,EDDI通过对操作系统提供的驱动程序所需的核心服务接口进行统一建模,针对不同类型的操作系统和硬件平台提供相应的头文件和库文件进行支持,实现EDDI描述文件的平台无关性。本文提出的驱动程序辅助生成工具在S3C4480开发板上,UCOS操作系统中进行了实验,为三星S3C4480的UART串口控制器和RTC实时钟编写驱动程序。实验结果表明本文设计是可行的。

【Abstract】 As the widely use of embedded systems, many new embedded devices come up. However, it becomes more and more difficult to develop drivers accurately and quickly for these devices. On one hand, it is tedious and error-prone to write low-level code for accessing devices and their registers, such as bit operation code. Imprecise device documents prevent driver developers to master the device. On the other hand, there is no common standard on embedded systems. Driver developers need to create different drivers for each device on each hardware platform, and it is hard to reuse these drivers. Thus automatic driver generation and code reuse are helpful to alleviate these problems through describing devices using interface description language.In order to support quick and accurate driver development, this thesis designs a framework for driver automatic generation, which includes the design of a simple, resuable and platform-independent driver interface description language named EDDI and a translater which can generate driver code using descriptions written in EDDI.EDDI is an XML-like notation language, to make the EDDI description file simple and easy to read. Since hardware-relevant code is tedious and error-prone, the thesis has designed a translater to translate EDDI description files which describe the target device in detail to driver stub code for driver developer. EDDI describes the device about its registers, hardware platform and basic functions. When the description about either basic function or hardware platform changed, the other descripitons can still be reused. Besides, EDDI includes the modeling for functions provided by operating systems and provides corresponding header files and library files depending on different kinds of operating systems and hardware platforms, which makes EDDI description file hardware independent.The thesis also performs an experiment with S3C44B0 and UCOS. With the help of the driver generation assistant tool, device drivers are generated to enable UART and RTC on Samsung S3C44B0. Experimental results show that the design is applicable.

  • 【网络出版投稿人】 北京大学
  • 【网络出版年期】2008年 10期
  • 【分类号】TP311.52
  • 【下载频次】258
节点文献中: 

本文链接的文献网络图示:

本文的引文网络