行政院國家科學委員會專題研究計畫 成果報告
建立一個以 Linux 及 ARM 為核心之軟硬體平台供嵌入式系統
設計研究之用
計畫類別: 個別型計畫 計畫編號: NSC93-2213-E-110-047- 執行期間: 93 年 08 月 01 日至 94 年 07 月 31 日 執行單位: 國立中山大學資訊工程學系(所) 計畫主持人: 江明朝 計畫參與人員: 李志遠、蔡文嘉、謝彥彬 報告類型: 精簡報告 處理方式: 本計畫可公開查詢中 華 民 國 94 年 10 月 30 日
`
`
`
ÍixêÝ3yñ×Í8{¿¬|¿y.ßC@~ßõ¯bny¶áP Ù'@~ÍiÞ½¥yÉLinuxmT|ARM x?¿¬§ã×ÛÎ . LinuxêP{Æ>"|yU|yóCXÝI5v¸¬&Ý Ø× ©¿¬'.h¸|¯'ï3tyÝ` /">b[£Ý'× ±ÝTà8Ñ. Linux bAh9Ý8FO¼Linux½ݺà3¶áP ÙÝ'@~îï3¶áPÙ'îARMμ&t 2àÝ×Íýã§ ãÞLinuxCARMÝ)|¯&ƸàARM?¿¬¯IC'>0Æ)® î? |Íi¨²×Í?¥ÝêÝÎ ÝÇò.ß3¶áPÙ8{]« 'ÝæKeywords: Linux, ARM, SoC, Boot Loader, U-Boot, Embedded Linux, Embedded System, DTV, OpenGL ES, EGL, Qt, Nano-X, IPsec.
Abstract
The main purpose of this project is to establish a hardware/software platform for both the students and the researchers to conduct long-term research projects in embedded system design. Our focus in this project is on porting Linux kernel to ARM-based evaluation board. One reason is that in recent years, Linux has been widely used as an embedded operating system in embedded system design because its combination of reliability, performance, good tool chains, portability, and configurability made it a powerful tool for creating new applications quickly and effectively, and ARM is an industry-standard core for embedded system design. The other is that the combination of Linux and ARM made it easier to collaborate with a group of faculty working on the IC design using ARM-based evaluation board. Another purpose of this project that we consider as important or even more important is to build up students’ capability in embedded system design, not only in hardware, but also in software.
Keywords: Linux, ARM, SoC, Boot Loader, U-Boot, Embedded Linux, Embedded System, DTV, OpenGL ES, EGL, Qt, Nano-X, IPsec.
1
Introduction
In recent years, Linux [1] has been widely used as an embedded operating system in the embedded system design. One reason is that Linux is not wedded to just one CPU architecture. Another is that Linux is highly reliable, scalable, modular, and flexible, which makes it well suited to the extreme diversity of embedded systems. Then, there is the fact that Linux is open-source, so it is much easier to get your embedded widget to act like it is supposed to. Also, Linux’s zero royalty model makes all this great stuff affordable, even in the simplest devices. Example applications using Linux as an embedded operating system can be found in [2, 3, 4, 5].
As reported in [6], since 1999, use of embedded Linux has gone from zero adoption to taking second place, in terms of market share, behind Wind River. Experts estimate that embedded Linux will take over the number-one market share position by the end of 2002. Although this is probably not true, it is at least very close to. Furthermore, [7] reports that, in terms of developer use for future projects, 30.2% of embedded developers expect to use Linux in their next embedded project, while 30.6% say they will use Windows Embedded operating systems. However, Embedded Linux has nearly double the growth rate.
On the other side, technology advances in the IC design and manufacturing process has made SoC the most important trend for embedded system design in recent years. However, one of the major problems the designers of an SoC need to face is to choose the right components for the SoC to be designed. Because of the cost consideration, it is almost impossible to build a general-purpose SoC that is also cost-effective. Also, the question of which components are to be implemented in hardware and which components are to be implemented in software has to be answered. How fast is a component fast enough in terms of both cost and performance? These issues include:
• How fast the CPUs need to be to handle all the tasks efficiently? • How much memory is needed?
• How many buses are needed?
• How fast the buses need to be to support all the interconnections between the CPUs and the peripherals?
Questions such as these need to be answered. How do we choose the right components at the very beginning before we eventually started the design of the SoC become even more important. To answer this question, what we need is a framework and tools to estimate the performance and cost of the to-be-designed SoC before we eventually started the design phase.
To make the situation even worse, [8] reports that in recent years, the functions demanded for embed-ded systems have grown tremendously that development time is increasingly difficult to predict and control. This complexity, coupled with constantly evolving specifications, has forced designers to con-sider intrinsically flexible implementations, those they can change rapidly. For this reason, and because hardware-manufacturing cycles are more expensive and time-consuming, software based implementa-tion has become more popular. Processors’ increased computaimplementa-tional power and correspondingly in-creased size and cost let designers move increasingly more functionality to software. In this respect, pure hardware solution is no longer possible. Even if it is possible, it is probably not flexible enough.
Also, the time-to-market constraint has become especially demanding in recent years. Introducing an embedded system to the marketplace early can make a big difference in the system’s profitability, since market windows for products are becoming quite short, with such windows often measured in months. Eventually, the average time-to-market constraint has been reported as having shrunk to only 8 months [9]!
Adding to the difficulty of meeting the time-to-market constraint is the fact that embedded system com-plexities have grown tremendously, and designers are being asked to do more in less time.
Compared with embedded systems years ago, the complexity of embedded systems has grown up to the point that it is almost impossible to build up an efficient embedded system without an embedded operating system. Embedded Linux [9] has been a viable option as an embedded operating system. The main purpose of this project is thus to establish a hardware/software platform for the students and the researchers to conduct long-term research projects in embedded system design based on Linux and ARM. Our focus in this project is on porting Linux kernel to ARM-based evaluation board. Another purpose of this project that we consider as important or even more important is to build up students’ capability in embedded system design, not only in hardware, but also in software.
The reason we do not consider using off-the-shell operating system is because we believe that it is important for the students involved in this project to get hands-on experience in porting an operating system from one platform to another by actually porting one, Linux in this case. The experience is rewarding because it can be applied to other operating systems, and we expect that being able to port an operating system from one platform to another is so important for the embedded system design because of the extreme diversity of embedded systems.
2
Methods
In this section, we turn our discussion to how we proceed with this project. We begin with the methods that we adopted to port Linux 2.6.8.1 to ARM920T-S3C2410 evaluation board (see Fig. 1). We then mention just a few of the projects that we are currently working on.
2.1
Porting Linux Kernel
One of our primary goals in porting the Linux kernel is to provide a robust and efficient operating system support for the applications to be discussed later. Another is to build up a testbed for long-term research projects in embedded system design.
The procedure is outlined as follows:
1. Choose the evaluation board. We choose Microtime ARM920T-S3C2410 evaluation board be-cause this made it easier to collaborate with a group of faculty working on the IC design using the same ARM-based evaluation board.
2. Choose the Linux kernel. We choose Linux 2.6.8.1 because it was the latest version of the Linux kernel at the time when we started this project and it supports the ARM architecture.
Figure 1: Microtime Create ARM920T-S3C2410 evaluation board.
3. Understand the booting procedure for ARM920T-S3C2410. This is so that we know how and where to load the Linux kernel and to make it easier for debugging.
4. Start with a minimized version of the Linux kernel in the sense that all unnecessary subsystems are left out except the serial console. This is so that we can eventually send all the messages to the serial console during booting and to make it easier for debugging.
5. Once we are able to send all the messages to the serial console, our approach is to port the Linux kernel incrementally, that is, component by component.
6. Create the root filesystem that is required by the Linux kernel. Our decision is to use the root filesystem developed by Microtime, which is for 2.4 Linux kernel, if possible, during the early stage while we are porting the Linux kernel. Only at the later stage, did we create our own root filesystem, which is for 2.6 Linux kernel.
Instead of using the boot loader (no source code) that comes with the ARM920T-S3C2410 evaluation board, we have also ported U-Boot, a boot loader for embedded boards based on PowerPC, ARM, MIPS, and several other processors, which can be installed on a boot ROM and used to initialize and test the hardware or to download and run application code.
2.2
On-Going Projects
In this section, we mention just a few of the projects, in a variety of areas, that we are currently working on. All of these projects use Linux as the embedded operating system.
Figure 2: Versatile Platform Baseboard for ARM926EJ-S.
2.2.1 Windowing Systems for Embedded Systems
In line with the joint project entitled “Hardware/Software Technique and Integration for 3D Graphics Acceleration in Digital Television (DTV)” with Himax on the design and implementation of 3D Graph-ics Accelerators, OpenGL ES Common/Common-Lite Profile (OpenGL ES) [10, 11], and OpenGL ES Native Platform Graphics Interface (EGL) [12, 11], our goal of this subproject is to provide the glue— both the operating systems (Linux) and the windowing systems (Qt and Nano-X)—that connects all the subsystems together.
One of the key reasons we choose Qt and Nano-X is because Qt has been used to build thousands of successful commercial applications worldwide while Nano-X provides Xlib-like API implementation, which allows X11 binaries to run unmodified using the Nano-X server. Another reason is that they both allow applications to be built and tested on the Linux desktop.
Although the development board for this subproject—Versatile Platform Baseboard for ARM926EJ-S (see Fig. 2)—is quite different from the ARM920T-S3C2410 evaluation board, the lessons we learned from porting the Linux kernel to the ARM920T-S3C2410 evaluation board can be easily applied to the ARM926EJ-S development board.
2.2.2 Security for Embedded Systems
Our goal of this project is to port Openswan—an implementation of IPsec [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24] for Linux—to the ARM920T-S3C2410 board.
IPsec (IP Security) is a set of protocols developed by the IETF to support secure exchange of packets at the IP layer. IPsec supports two encryption modes: Transport and Tunnel. Transport mode encrypts only the payload of each packet, but leaves the header untouched. Tunnel mode encrypts both the header and the payload. On the receiving side, an IPsec-compliant device decrypts each packet.
3
Results
As we stated in the proposal of this project, except a one-semester course in Linux Device Drivers [25], all of the students involved in this project have never had any experience on porting a Linux kernel. However, the tasks we have achieved include:
• We have successfully ported Linux 2.6.8.1 to the ARM920T-S3C2410 evaluation board for long-term research projects and as a testbed for the projects we discussed above.
• We have successfully ported U-Boot, a widely used boot loader for embedded systems, to the ARM920T-S3C2410 evaluation board.
• Students now have a better understanding of the ARM architecture.
• Students have built up capability in porting an operating system from one platform to another. • Students have a better understanding on how the Linux kernel works and how to adapt its workings
to their needs or interests.
• Students have a better understanding of GNU tool chains that is required in the development of an embedded system based on the GNU tools chains.
• Students have an overall idea regarding how an embedded system software is developed.
• Students not involved in this project can now use the ARM920T-S3C2410 evaluation board to develop applications in a variety of areas.
4
Conclusion
As we stated earlier, we have successfully ported the 2.6.8.1 version of the Linux kernel and U-Boot, a widely used boot loader for embedded systems, to the ARM920T-S3C2410 evaluation board. We also mentioned a few of the on-going projects, all of which use Linux as the embedded operating system. We have shown that the lessons we learned from this project can be easily applied to other platforms. We consider the capability of being able to apply the lessons learned to new platforms even more important because of the extreme diversity of embedded systems.
References
[1] J. O’gorman, Operating Systems with Linux. New York, New York: Palgrave, 2001.
[2] T. Bollinger, “Linux in Practice: an Overview of Applications,” IEEE Software, vol. 16, pp. 72–79, Jan-Feb 1999.
[3] S. Zou, G. Zhang, and G. Wu, “The Application of Embedded Real-time Linux in Intelligent Insulation On-line Monitoring,” Proceedings of International Symposium, pp. 201–204, Nov 2001.
[4] A. Perera, T. Sundic, A. Pardo, R. Gutierrez-Osuna, and S. Marco, “A portable Electronic Nose Based on Embedded PC Technology and GNU/Linux: Hardware, Software and Applications,” IEEE Sensors Journal, vol. 2, pp. 235–246, Jun 2002.
[5] H. Kim, S. Park, J. Kim, M. Kim, and K. Rim, “TMO-Linux: a Linux-based Real-time Operating System Supporting Execution of TMOs,” Proceedings of the Fifth IEEE International Symposium, Apr-May 2002.
[6] C. Hallabaugh, Embedded Linux: Hardware, Software, and Interfacing. New York, New York: Addison Wesley, 2002.
[7] R. Lehrbaum, “Linux, Windows Neck-and-neck in Embedded,” Embedded Systems Developer Survey, vol. 2, 2002.
[8] A. Sangiovanni-Vincentelli and G. Martin, “Platform-Based Design and Software Design Method-ology for Embedded Systems,” IEEE Design & Test of Computers, vol. 18, pp. 23–33, Nov-Dec 2001.
[9] F. Vahid and T. Givargis, Embedded System Design: A Unified Hardware/Softwrae Introduction. New York, New York: Wiley, 2002.
[10] “OpenGL ES Common/Common-Lite Profile Specification Version 1.1.02 (annotated).” The Khronos Group Inc., 2004. http://www.opengles.org/opengles/spec.html. [11] “OpenGL ES 1.1 & EGL Reference Manual,” 2004. http://www.opengles.org/
opengles/spec.html.
[12] “EGL 1.1—OpenGL ES Native Platform Graphics Interface 1.1 Specification.” The Khronos Group Inc., 2004. http://www.opengles.org/opengles/spec.html.
[13] S. Kent and R. Atkinson, “Security Architecture for the Internet Protocol,” RFC 2401, Nov 1998. [14] S. Kent and R. Atkinson, “IP Authentication Header,” RFC 2402, Nov 1998.
[15] C. Madson and R. Glenn, “The Use of HMAC-MD5-96 within ESP and AH,” RFC 2403, Nov 1998.
[16] C. Madson and R. Glenn, “The Use of HMAC-SHA-1-96 within ESP and AH,” RFC 2404, Nov 1998.
[17] C. Madson and N. Doraswamy, “The ESP DES-CBC Cipher Algorithm With Explicit IV,” RFC 2405, Nov 1998.
[18] S. Kent and R. Atkinson, “IP Encapsulating Security Payload (ESP),” RFC 2406, Nov 1998. [19] D. Piper, “The Internet IP Security Domain of Interpretation for ISAKMP,” RFC 2407, Nov 1998. [20] D. Maughan, M. Schertler, M. Schneider, and J. Turner, “Internet Security Association and Key
Management Protocol (ISAKMP),” RFC 2408, Nov 1998.
[22] R. Glenn and S. Kent, “The NULL Encryption Algorithm and Its Use With IPsec,” RFC 2410, Nov 1998.
[23] R. Thayer, N. Doraswamy, and R. Glenn, “IP Security Document Roadmap,” RFC 2411, Nov 1998.
[24] H. Orman, “The OAKLEY Key Determination Protocol,” RFC 2412, Nov 1998.