ARM is the world's largest semiconductor intellectual property supplier, with nearly 200 semiconductor companies as customers. Currently, 80% of GSM phones, 99% of CDMA phones, and future 3G phones all use embedded processors based on ARM cores. According to statistics from Gartner Inc., an organization that provides research and analysis information, in June 2003, ARM ranked first among global semiconductor IP suppliers in 2002, accounting for 19.8% of the market share and sales revenue of 180 million US dollars, a 10% increase over 2001.
At present, in addition to mobile terminal processors such as TI OMAP, Intel's Xscale and Motorola's IMX series that use ARM cores, there are also semiconductor companies such as Samsung, Atmel, Sharp, OKI and Philip that design some general-purpose ARM core processors that can be widely used in various embedded systems. The more common ones on the market now include S3C44B0, 4510,2410,AT91 series and Intel PXA255.
ARM processor is a 32-bit design, but also equipped with a 16-bit instruction set. Software can be encoded in 16 bits, which can save about 35% of the memory space compared to the equivalent 32-bit code. ARM processors currently include ARM7, ARM9, ARM9E, ARM10,
ARM11 series products and ARM7 from partners Intel Xscale and Strong ARM series, which are suitable for low-end network equipment, terminals, various general-purpose embedded applications and industrial control. ARM9 is suitable for smart phones, PDAs and advanced control management and instrumentation applications. Intel Xscale series products provide high performance and price ratio, low power consumption, and are suitable for applications such as smart wireless terminals, PDAs, home networks and network storage devices.
Embedded operating system is an important software foundation of ARM CPU
From 8-bit/16-bit single-chip microcomputers to 32-bit embedded processors represented by ARM CPU cores, embedded operating systems will replace traditional manually compiled monitoring programs or schedulers and become important b
asic components. Embedded operating systems can provide device management for ARM CPU cores and peripherals, such as core initialization, MMU (memory management unit), timers, interrupts, serial ports, SPI, GPIO, Ethernet,
graphics interfaces, etc. Embedded operating systems provide task scheduling, memory management, interrupt processing, synchronization and mutual exclusion mechanisms, file systems and network functions. More importantly, embedded operating systems can shield applications, allowing application programmers to develop application software at the operating system level and easily port them to different embedded processors based on ARM cores.
Embedded operating systems generally have a certain degree of real-time performance, are easy to cut and scale, and can be suitable for various ARM CPUs from ARM7 to Xscale and various grades of applications. Embedded operating systems can use widely popular ARM development tools, such as ARM's SDT/ADS and Real View, IAR EW, etc. They can also use open source software, such as GCC/GDB, KDE or
Eclipse development environment. There are also special development tools from commercial manufacturers on the market, such as Tornado, μC/View, μC/KA, CODE/Lab, Metroworks, etc.
This article analyzes three widely used embedded operating systems on ARM CPUs in China, namely μC/OS-II, μCLinux and embedded Linux. The latter two belong to Linux. The former is for microprocessors without MMU, such as ARM7 TDMI core, while the latter can be applied to most microprocessors with MMU, such as ARM920T. Of course, the article will also cover other embedded operating systems that support ARM CPUs.
μC/OS-II embedded real-time kernel
The Embedded Real-Time Operating System μC/OS-II, written by Jean Labrosse and translated by Shao Beibei, has been published by Electric Power Press (first edition) and Aeronautics and Astronautics University Press (second edition) and has been distributed nearly 10,000 copies. It is believed that thousands of students, teachers and engineers are using μC/OS-II. In the past year (2003), there have been dozens of μC/OS-II related papers in magazines such as Electronic Products World, Electronic Design Applications and Microcontroller and Embedded System Applications and various academic conferences. Hundreds of devices around the world are already using μC/OS-II, including mobile phones, routers, uninterruptible power supplies, aircraft, medical equipment and industrial control equipment. In China, more than 10 companies including Hong Kong Quanzhi, Shouke Xidian and Ankong Technology have purchased product licenses.
μC/OS-II has been ported to various ARM CPUs, including ARM7TDMI, ARM9 and Strong ARM, and supports ARM core CPUs from companies including Atmel, Hynix, Intel, Motorola, Philips, Samsung, Sharp, etc. The porting of μC/OS-II is also quite easy, and the CPU-related codes are packaged in three files, os_cpu.h, os_cpu_a.asm, and os_cpu_c.c. In addition, Mr. Jean Labrosse's application notes AN-1011 and AN-1012 provide detailed descriptions of the porting process for ARM7 and AN-1337 for ARM9.
μC/OS-II has more than 60 system calls, covering tasks, timers, semaphores, event flags, mailboxes, queues and memory management. It has included the functions of traditional embedded operating system kernels (such as PSOS, VRTX), and also supports mutual exclusion semaphores (Mutual Exclusion Semaphone), which is a technology only available in embedded operating system kernels in the 1990s, such as Vxworks and VRTXsa.
Because μC/OS-II is a preemptive real-time kernel, there is no difference in performance between μC/OS-II and commercial embedded real-time kernels. μC/OS-II has no user state and kernel state, and the response of tasks (threads) or interrupts and task switching can be very fast, which is mainly related to different ARM CPUs. The latest 2.7x version also adds an algorithm to avoid modifying the stack pointer in OSINTCEXSW() during porting. This ensures that μC/OS-II runs more stably on different CPUs and is more convenient to port.
In short, μC/OS-II is an embedded operating system kernel that is very easy to learn (there is a very good book with clear explanations), has a simple structure, complete functions, and strong real-time performance. It is suitable for various embedded applications as well as teaching and scientific research in colleges and universities.
In addition to the kernel, μC/OS-II currently also has the commercial file system μC/FS, the graphics system μC/GUI, and the task debugging tools μC KA and μC View. μC/OS-II itself currently also has
TCP/IP. If necessary, you can purchase commercial TCP/IP, such as InterNiche (www.iniche.com), or use free TCP/IP projects such as LWIP (http://www.sics.se/~adam/lwip/), but they cannot compare with commercial codes in terms of functionality or stability.
Finally, it should be noted that μC/OS-II is not free software. Anyone who wants to learn to use μC/OS-II needs to purchase the book "Embedded Real-Time Operating System μC/OS-II". Products that use μC/OS-II need to purchase a product production license. Those who purchase this license can also get technical support and upgrade services during the development period.
IAR PowerPAC Operating System
IAR PowerPac for ARM is an integrated 32-bit RTOS and middleware family developed by IAR, a well-established European Swedish tool company. It includes a real-time operating system that takes up very little memory and a general file system. There are also USB protocol stacks and TCP/IP v4 network protocol stacks. IAR PowerPAC is suitable for a variety of embedded applications in different industries, such as test and measurement, industrial control, telecommunications, medical and consumer electronics.
IAR PowerPac for ARM can be seamlessly integrated with IAR Embedded Workbench, providing a complete development environment even for the most complex applications. IAR PowerPac is a feature-rich real-time operating system (RTOS) that includes a high-performance file system. As well as additional USB and TCP/IP, Web Server software packages. IAR PowerPac is seamlessly integrated with IAR Embedded Workbench, providing a wealth of example projects and board support packages for ARM devices from different manufacturers.
IAR PowerPac and protocol stack
IAR provides the PowerPac real-time operating system and file management system, USB protocol stack, and TCP/IP protocol stack. Its licensing method is to charge license fees per engineer seat, without further royalties, reducing the risk for end users.
μCLinux operating system
μCLinux is a miniaturized Linux operating system tailored for microprocessor chips without MMU. In the ARM CPU series, if you want to use the Linux operating system on ARM7 TDMI, ARM940T and other ARM core CPU products, you can only use μCLinux. Of course, μCLinux also supports other mid- and low-end embedded processors such as Motorola Dragonball and Coldfire.
μCLinux maintains the main features of the traditional Linux operating system, including stable and powerful network and file system support. μCLinux cuts out a large amount of the Linux kernel to reduce its size, making it suitable for small-capacity, low-cost embedded systems such as 512k RAM and 1M Flash.
The μCLinux project started with the Linux 2.0.38 kernel, and the first project was the Motorola 68EZ328. Currently there are some ported versions supported by 2.4 Linux, such as S3C2500, 44B0 and other ARM chips. You can find these on the μCLinux official website www.uclinux.org. μCLinux has recently been mainly developing various 2.4.x version ports in order to keep up with the mainstream development trend of the Linux community (because Linux 2.6 will begin to become the mainstream kernel this year).
Another important reason for the miniaturization of the μCLinux system is the use of the μCLib library to replace the Linux Glib library. The use of μCLib can greatly reduce the code size of the application. For small and medium-sized embedded applications, the μCLib function can meet the needs, so even some embedded LINUX systems using the Linux 2.4 kernel currently use the μCLib library. In μCLinux, since there is no memory protection mechanism, the application code is generally statically linked, and the Flat file execution format is used in μCLinux (Linux is Coff or Elf format). Both μCLinux and the application code can support solidification and be stored in the Flash storage medium, without the need for a Flash to RAM copy like Linux. All of these make μCLinux more like a traditional embedded operating system.
μCLinux is mainly designed for embedded processors without MMU, so it also loses the characteristics of Linux operating system with MMU, such as static loading mentioned above (Linux supports dynamic application loading). μCLinux operates memory directly on physical memory, so any program exception may cause kernel crash. μCLinux uses Vfovk() to support multiple processes, but requires parent-child process coordination and synchronization. The file system of μCLinux is relatively old, and the supported CPUs and reference designs are relatively few. The development and maintenance of the community are also relatively slow. More importantly, no software company at home or abroad has commercial μCLinux software products and services to support it. At present, the official website of μCLinux rarely sees giant companies like IBM and Intel, and there are only 2~3 small hardware or solution providers. This is a certain risk for its use in commercial product development.
Embedded Linux operating system
What we are going to discuss here is the Linux operating system with MMU function that can be embedded on ARM CPU, which can also be called embedded Linux operating system. When Finnish student Linux Torvalds wrote the first Linux version in 1991, he could never have imagined that Linux would be widely noticed and applied all over the world today. As an important field of Linux application, embedded system is developing rapidly due to its extensiveness and diversity.
Unlike Microsoft's software, Linux is not owned, maintained and developed by a single company. There are multiple Linux distributions in the market. All distributions contain the same Linux kernel, basic tools and applications. Different distributions differ mainly in additional tool chains, applications, configurations and various kernel patches. Embedded Linux has been improved and enhanced mainly in terms of real-time enhancement, kernel simplification and reduction, and support for multiple CPU structures (such as ARM CPU). [page]
There are two approaches to using Linux in embedded systems.
The first is to assemble it yourself (called DIY kernel). You can find all Linux codes at www.kernel.org, or go directly to the source code tree of ARM CPU at www.ARMLinux.org.uk to find the porting of the Linux version you need under ARM. Some semiconductor companies, such as Samsung and Motorola, also give away a CD on their own websites or when selling their own ARM evaluation boards, which contains a minimum Linux kernel system that can support their evaluation boards. If this minimum kernel does not include the GCC/GDB tool chain, you may have to download all the source code from the GNU website, and then compile and generate the ARM tool chain and application library of the version you need. This process is quite time-consuming and difficult. It should also be pointed out that the configuration of this DIY kernel, adding applications and drivers is also non-standard and complicated. This is the particularity of embedded systems. For example, some ARM-based applications are small interconnected devices on the network. They need multiple Ethernets, USB hosts, and small NOR Flash file systems. For an ARM handheld terminal, it is concerned with LCD touch screens, infrared or Bluetooth interfaces, USB client terminals, fast startup, dynamic power management, and NADA FLASH. In this way, you need to download various patches, applications, and tools from dozens of Linux-related websites, and repeatedly compile and debug them with the kernel you have obtained to make sure that they work stably and reliably on the ARM CPU hardware evaluation board you are using. This process is completed without any technical support. Of course, if you can get a "minimum kernel" from a semiconductor company or an open source website, and the components it contains (such as drivers, applications, and file systems) are similar to your application, and the code is reliable, or you get timely and correct guidance from Linux netizens, then you are lucky. It is said that a well-known telecommunications equipment manufacturer spent 2 years and 1.5 million US dollars to develop its own Linux in a project, and finally had to stop.
The second is to choose a commercial embedded Linux operating system platform. The commercial embedded Linux version is optimized for embedded processors, such as ARM, and has supported evaluation boards and major device drivers from various semiconductor manufacturers. Commercial embedded Linux includes file systems, applications, real-time extensions, and technical support and training services. Currently, well-known commercial embedded Linux products abroad include: MontaVista Linux, Bluecat Linux, Timesys Linux, Metrowork Linux (formerly Lineo), Vlinux (Korea) and Redhat Linux, etc. There are also Red Flag, Chinasoft, and Xinhua embedded Linux in China.
MontaVista Linux was launched in 1999 by MontaVista Software Corporation, which is currently the world's best supplier of embedded Linux operating systems and tools. MontaVista has a world-leading position in Linux technical key points such as real-time performance, cross-development tools, high availability, and dynamic power management of embedded Linux.
The latest version of MontaVista Linux is 5.0, which uses Linux 2.6.18 and is a commercial version optimized and customized for 8 CPU series (including ARM and Xscale). It includes the latest O(1) real-time scheduler, preemptible kernel, microsecond high-resolution timer, Eclipse-based DevRocket 5 development environment, support for configuration and debugging of applications, kernel and file system (solidification), as well as testing and analysis tools, pure Windows, Linux and Solaris development hosts, and device driver support for more than 200 evaluation boards and application systems.
Choosing a commercial embedded Linux such as MontaVista Linux allows users to focus their time and money on application software and specific hardware interfaces and device drivers. Using commercial embedded Linux, you can get a certain period of time (usually 1 year) of technical support, upgrades and training (this is very important because Linux is changing every day).
Currently, except for domestic products, the price of commercial embedded Linux is still very expensive, ranging from several thousand to tens of thousands of US dollars depending on the configuration and service time. Most domestic users can hardly afford it financially and psychologically. Compared with development tools from Microsoft and Tornado/VXWORK, commercial embedded Linux development tools still need to be improved and enhanced in terms of ease of use and richness.
As a Linux operating system, I recommend using Linux with MMU instead of μCLinux, because most of the new ARM CPUs are AMR9 cores, which have MMU. The support and maintenance of both the open source LINUX community and commercial embedded LINUX companies are better, faster and richer than μCLinux.
Conclusion
Earlier we made a detailed analysis of three popular embedded operating systems on ARM CPU. Before entering into a summary, I would like to mention several internationally famous embedded operating systems, namely Windriver's Vxworks, ATI's Nucleus, Japan's iTron and WinCE.
Windriver's Vxworks was the most influential embedded operating system two or three years ago. Almost all major communication equipment manufacturers use the PowerPC+Vxworks combination. However, Vxworks is not commonly used on ARM CPUs. ATI's Nucleus (now Mentor's embedded department) was once the most famous source code, royalty-free embedded operating system popular in North America and Taiwan, Asia. The most successful design example is various GSM mobile phones. Nucleus is only a real-time kernel. Users need to purchase its TCP/IP, GUI, file system and device drivers to form a fully functional embedded system, which has made it lose its advantage in recent years. The Japanese iTron is an embedded kernel that is almost a household name in Japan. It has a standard programming interface, a low price (1,000 to 3,000 US dollars), There are no royalties, and it supports almost all CPUs (especially many Japanese CPUs), but iTron seems to have made no achievements outside of Japan; Microsoft's WinCE is adopted by almost all high-end PDAs, and they use CPUs such as Xscale or ARM9, but Microsoft only cares about embedded device manufacturers with huge output like PCs, so it did not make its WinCE as easy to port to different CPUs and add device drivers as Linux. Microsoft prefers to do everything by itself like Windows, and you just use it. If you do not have a certain level, it is difficult to obtain its personalized customization services.
Finally, we summarize several important factors in choosing a suitable ARM CPU embedded operating system.
The first is application. If the embedded device you want to develop is closely related to network applications or is a network device, then you should choose embedded Linux or μCLinux instead of μC/OS-II, because Linux not only integrates TCP/IP protocol for you, but also has a wealth of other network protocols, such as DHCP Server, PPPoe, webserver, etc.
The second is real-time performance. There is no absolute number that can tell you what is hard real-time and what is soft real-time. The boundary between them is also very vague. This has something to do with the ARM CPU you choose, its main frequency, memory and other parameters. For a processor like Intel Xscale, even with a normal Linux kernel, the kernel preemption delay is only 1.743 milliseconds in the worst case, and 1.42 milliseconds in 99.9% of the cases. If you use an embedded Linux with real-time patches and other technologies such as MontaVista Linux (2.4.17 kernel), the worst case is only 436 microseconds, and 195 microseconds in 99.9% of the cases. The above figures and considering the latest Linux improvements in real-time performance (such as low-latency O(1) debuggers, microsecond-level high-resolution POSIX timers), embedded Linux can be suitable for 90~95% of various embedded system applications. Of course, if you want a higher order of magnitude real-time response, such as high-speed A/D conversion that requires an interrupt delay of less than a few microseconds, a millisecond-level asynchronous serial real-time processor without DMA mode, and similar applications, it may be appropriate to use μC/OS-II. Of course, you can also use traditional embedded operating systems such as Vxworks to meet such strong real-time requirements.
The third is development tools. Frankly speaking, the development tools of μC/OS-II, μCLinux and embedded Linux are still a little behind the commercial embedded operating system tools. The SDT/ADS tool chain of ARM is widely popular and used on ARM CPU. The product is very good in terms of function, stability and support from many third-party manufacturers. The only shortcoming is the lack of support for embedded operating systems. The upgraded product RealView of SDT/ADS plans to support GCC and embedded Linux, but it has not been seen yet. μC/OS-II can use ARM SDT/ADS, but it has no OS debugging function. If you want to support OS debugging, you can use IAR or Nohan debugger. In addition to GDB, μCLinux also has third-party debuggers for debugging, and cooperates with Cygwin to form a μCLinux development environment under Windows environment, such as Aiji's Spider and Micetek's Hitool.
Fourth, the ARM CPU and reference board you choose, cores like ARM7TDMI and ARM940T (such as S3C2500/2510) cannot use embedded Linux (MMU). If you want to use Linux, you can only use μCLinux. If you want to use Vxworks, you need to find out whether the company that provides the evaluation board has a BSP (board support package). Vxworks itself only supports a few ARM company's evaluation boards.
Finally, there are price and technical services. The salary of Chinese engineers is about one-tenth of that in Europe, America, Japan and other countries. Therefore, when considering purchasing a commercial embedded operating system, you will encounter the question of whether to buy or make it yourself. This is normal, especially when using open source technology, this problem is more prominent. One thing to note is that some products such as Vxworks charge development fees based on the number of users (with license protection locks) and royalties for each Vxworks software run based on the actual number of your products sold. μC/OS-II only charges a one-time royalty for each product (unlimited quantity). Nucleus and Threadx charge a one-time development plus production fee. Linux, whether μCLinux or embedded Linux (even commercial versions like MontaVista Linux), does not charge royalties. Commercial embedded Linux charges development fees in the form of service fees or subscriptions. Obviously, foreign products are more expensive (mainly because of their high labor costs), but we have to admit that they are far ahead in embedded operating system technology. It is worth reminding everyone that among the many domestic suppliers of ARM development tools and evaluation boards, many have already done open source operating system porting and demonstration demos, but it should be noted that most of them do not have the ability and experience to maintain and support operating system platforms, and it is risky to rely too much on them.
The wide variety of reasonably priced ARM CPUs coupled with open source embedded operating systems have created a favorable opportunity for the development of Chinese embedded system and equipment manufacturers. The correct and rapid use of these technologies can speed up the time to market for our competitive new generation of electronic products and improve the quality of our products.
References:
Li Shanping, "Linux and Embedded Systems"
Wang Xuelong, "Embedded Linux System Design and Application"
Ma Zhongmei, "ARM Embedded Processor Architecture and Application Basics"
Shao Beibei, Embedded Real-Time Operating System μC/OS-II, 2nd Edition
He Xiaoqing, "Embedded Linux: The mainstream operating system in communication equipment", Electronic Design Applications, Issue 4, 2003.
Tsinghua University, "Embedded System Design and Case Development"