| 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. |