Widely used embedded in linux-general Linux technology-Linux programming and kernel information. The following is a detailed description. Linux is widely used in various computing applications, including not only micro-Linux watches, handheld devices (PDA and cellular phones), Internet devices, thin clients, firewalls, industrial robots, and telephone infrastructure devices, it even includes cluster-based supercomputers. Let's take a look at what functions Linux needs to provide as an embedded system, and the most attractive reason for its current available options.
Emergence of Embedded Systems
A computer used to control a device, also known as an embedded system, has almost the same length as a computer. They were initially used in communications to control Electromechanical telephone switches in the late 1960s S. Over the past decade, the computer industry has been moving towards smaller systems, and embedded systems have also provided more functions for these small machines. Gradually, these embedded systems need to be connected to a certain network, and thus the requirements for the network stack are generated. This increases the complexity of the system and requires more memory and interfaces, and, you guessed it, the operating system service.
In the late 1970s s, there were ready-made operating systems used as embedded systems. Now there are many feasible options. Among them, some of the main competitors began to emerge, such as VxWorks, pSOS, Neculeus and Windows CE.
Advantages and disadvantages of using Linux in Embedded Systems
Although most Linux systems run on PC platforms, Linux can also serve as the backbone of embedded systems. The popular "back-to-basics" method in Linux makes it easier and more flexible to install and manage than UNIX, which is an advantage for UNIX experts, they have appreciated Linux because there are many commands and programming interfaces, just like traditional UNIX.
The typical compressed packaging Linux system is packaged and runs on a PC with a hard disk and large memory capacity. The embedded system does not have such high configuration. A fully functional Linux kernel requires about 1 MB of memory. The Linux microkernel only occupies a small part of the memory, including virtual memory and all core operating system functions. It only needs to occupy 100 kb of memory of the Pentium CPU system. With 500 KB of memory, a Linux system with a network stack and basic utilities can be deployed on an 8-bit bus (SX) the Intel 386 microprocessor runs well. Because the memory requirements are often determined by the need of applications, such as Web servers or SNMP proxies, Linux systems can even use only 256 kb rom and 512 kb ram for work. Therefore, it is a lightweight operating system targeting the embedded market.
Compared with traditional real-time operating systems (RTOS ), another advantage of using open-source operating systems such as embedded Linux is that the Linux development group seems to be faster than RTOS vendors to support new IP and other protocols. For example, there are more device drivers for Linux than for commercial operating systems, such as network interface card (NIC) drivers and parallel and serial drivers.
Flash Memory
Flash RAM memory is the dedicated memory used by most Palm devices to store the operating system. It has the advantage of allowing OS upgrades and can also be used for digital cellular phones, digital cameras, LAN switches, PC cards, digital set-top boxes, embedded controllers and other small devices. For embedded systems such as embedded Linux, do not require a disk drive, although other memory organization methods may be used. Therefore, for example, if Linux uses flash memory, it can use a part of it as a read-only file system to store additional programs and static data.
The microkernel architecture of the core Linux operating system is quite simple. The network and file system are placed on the upper layer of the microkernel in the form of modules. Drivers and other components can be compiled or added to the kernel as a load module at runtime. This provides a highly modular component method for the construction of a custom embedded system. In typical cases, the system must combine customized drivers and applications to provide additional functions.
Embedded Systems also often require general functions. To avoid repetitive work, these functions use many ready-made programs and drivers that can be used for public peripherals and applications. Linux can run on a majority of microprocessors with a wide range of peripherals, and has a ready-made application library.
Linux is also suitable for Embedded Internet devices because it supports a multi-processor system, which makes Linux scalable. Therefore, the designer can choose to run real-time applications on a dual-processor system to improve the overall processing capability. For example, you can run a GUI on one processor and a Linux system on another processor.
One disadvantage of running Linux on an embedded system is that a real-time software module must be added to the Linux system to provide real-time performance. The kernel space that these modules run is the part where the operating system implements Scheduling Policies, hardware interruption exceptions, and execution programs. Because these real-time software modules run in the kernel space, code errors may damage the operating system and affect the reliability of the entire system, which is a very serious weakness for real-time applications.
On the other hand, the ready-made RTOS is completely designed for real-time performance. It assigns a process at startup by a user rather than a system-level process to ensure reliability in a way that is higher than the priority of other processes. In the operating system, a process is a program executed in memory or on a hard drive. Specify a process ID or digital identifier for the operating system to track the priority levels associated with the programs being executed and those programs. This ensures that RTOS time can provide higher reliability (predictability) than Linux ). But most importantly, this is a more economical choice.
Different types of Embedded Linux systems
There are already many examples of Embedded Linux systems; you can safely say that some form of Linux can run on almost any computer that executes code. For example, the ELKS (which can be embedded into a Linux kernel subset) solution plans to use Linux on Palm Pilot. The following lists some smaller embedded Linux versions that are more widely known:
ETLinux-a fully distributed version of Linux designed for running on Small Industrial Computers, especially PC/104 modules.
LEM-a small (<8 MB) multi-user, network Linux version running on 386.
LOAF-"Linux On A Floppy" distribution version, running On 386.
UClinux-Linux running on a system without MMU. Currently, Motorola 68 K, MCF5206, and MCF5207 ColdFire processors are supported.
ULinux-the tiny Linux distribution version running on 386.
ThinLinux-Minimal Linux distribution for dedicated camera servers, X-10 controllers, MP3 players, and other similar embedded applications.
Software and Hardware requirements
Many User Interface tools and programs enhance the functionality of the basic Linux kernel. In this case, we can regard Linux as such a continuous range, from the microkernel with minimal memory management, task conversion, and timer services to a complete set of file systems and network services.
The smallest embedded Linux system requires only three basic elements:
Bootstrap Utility
The Linux microkernel consists of memory management, process management, and scheduled service.
Initialization Process
To achieve the minimum working ability, you also need to add:
Hardware driver
One or more application processes to provide the required functions
As the requirements increase, you may also need:
A file system (probably in ROM or RAM)
TCP/IP network stack
Disks that store semi-transient data and provide swap space
32-bit built-in CPU (required for all Linux systems)
Related hardware solutions
The following are some existing embedded hardware solutions customized for the Linux operating system.
PLEB: Pocket Linux embedded machine with ARM SA-1100/ArmLinux Ucsimm/Uclinux Flash EPROM.
Linux Lab: the Linux Lab solution aims to help people develop Linux data collection and process control software. It plans to provide a standardized development environment for applications from hardware support to application development.
Controller network: The Controller Network (CAN) bus driver of Linux gui. the Linux GUI package is a support package for general windows (IEEE 488.1) hardware. The driver supports the National Instruments AT-GPIB, TNT488.2, and PCII and PCIIa boards. This package provides a complete development environment, including testing and configuration tools, libraries, and support for the tcl and python languages.
Hardware Platform options
The process of selecting the best hardware will be quite complex. The problem arises from internal policies, preferences, issues left behind by other schemes, lack of comprehensive or accurate information, and costs-the overall product cost needs to be taken into account, not just the CPU itself. Sometimes, once you take into account the bus logic and latency required for the CPU to use other peripheral devices, the fast and cheap CPU may also become expensive. To calculate the CPU speed required for any given project, we must first realistically see how fast the CPU runs to complete a given task and multiply it by three. You also need to determine how fast the bus needs to run. If there is a secondary bus, such as the PCI bus, they are also taken into account. A slow bus (that is, a bus blocked by DMA Communication) will significantly reduce the speed of High-Speed CPU. Below are some of the best hardware solutions for Embedded Linux applications.
Bright Star Engineering: The ipEngine-1 of Bright Star Engineering is a single-chip microcomputer that supports credit card size for Embedded Linux. It utilizes a PowerPC-based CPU and provides a set of on-board peripherals, it has Ethernet, LCD/Video Controller, USB, serial port I/O, and a 16 K FPGA that can be configured by the user. The BSE embedded Linux configuration allows Linux to boot from the 4 MB flash memory on the ipEngine board.
Calibri: CalibriTM-133 is a network device that uses embedded Linux as its operating system. It is easy to use, compact, and can be used for multiple purposes. It provides an efficient and low-cost solution for firewall, VPN, and routing requirements.
EmbeddedPlanet: EmbeddedPlanet created a computer in the Post-PC era. When it appeared, it installed the HardHat Linux of MontaVista. Powered by PowerPC-based computing engines and matched I/O cards, Linux Planet is packed in a color transparent box with a touch screen and can access numbers and analog I/O.
Eurotech: Eurotech provides embedded pc sbc and supports ET-Linux, a fully-designed Linux System Based on glibc 2.1.2 designed to run on small industrial computers.
Microprocess Ingenierie: Microprocess is a standard and customized product developed, produced, and sold for industrial and embedded markets. Microprocess is global in real-time software and has professional knowledge of system integration. Its products, such as the 740 PowerPC compactPCI board, can be ordered together with the standard Linux distribution or embedded Linux version.
Moreton Bay: Moreton Bay released a Linux-based Internet Router, which ranges from NETtel 2520 to NETtel 2500. These small, easy-to-connect smart router solutions are designed to provide a simple, secure, and affordable Virtual Private Network (VPN) for the flat network ). The NETtel router series runs the embedded Linux kernel. A set of existing development tools can store custom code in flash memory and execute it in NETtel. The Code may contain specific encryption or authentication protocols, or some local monitoring scripts when NETtel is used as the remote control device code.
Matrix Orbital: This is optional, but not an additional item recommended. A series of serial LCD and VFD manufactured by Matrix Orbital are added to their embedded systems by many Linux users. This production line covers 8x2 to 40x4 characters LCDs, 20x2 and 20x4 VFD plus 240x64 graphics LC (128x128 still in production) ). Communication Using a display is either implemented through RS232 or I2C, both of which are standards on all its modules. The BIOS of the module contains a comprehensive command set.
Real-time embedded Linux applications
One of the most important tasks related to embedded systems is to have a real-time operating system. There are several definitions in real time. For some people, real-time means to respond to the event within 1 microsecond, but for others, it may be 50 milliseconds. The real-time hardness varies. Some systems need to respond in real time and make a deterministic response to the event in a short period of time. However, when we carefully analyze many systems, we find that the response time requirements are actually close to real-time. Real-time requirements are often the compromise between time and buffer space. As the memory becomes cheaper and the CPU speed becomes faster and faster, near real-time is more common than hard real-time. Many commercial real-time operating systems are far from hard real-time. Generally, when you enter the detailed design section of these systems, you need to be vigilant and carefully design drive interruptions and applications to meet real-time requirements.
RT-Linux (a real-time extended Linux System) contains time-critical functions which can be precisely controlled by the interrupt manager, ensuring that critical interruptions can be executed as needed. The hardness of this method depends mainly on the CPU interrupt structure and hardware support for environment conversion. This method can meet a wide range of real-time requirements. Even without real-time extensions, Linux can handle multiple event streams well. For example, the Linux PC system running on the low-end Pentium instance allows multiple 10 BaseT interfaces to be executed effectively, and runs character-level serial ports at 56 KBPS at full speed without losing any data.
The real-time hardware and software Linux APIs worth considering include RTLinux, RTAI, EL, and Linux-SRT. RTLinux is a hardware real-time Linux API originally developed at the New Mexico Institute of Technology. RTAI (DIAPM) is a by-product of RTLinux real-time APIs developed by programmers at Polytechnic Politecnico di Milano (DIAPM) Aerospace Engineering Department. EL/IX is a planned POSIX-based Real-time Linux API initiated by Red Hat. Linux-SRT is a soft and real-time substitute for real-time APIs. It enables all Linux programs to improve performance without modification or re-compilation.
Refer to the references section after this article to find information about the previous content and some Web sites, there are software extensions, development tools, support, and training courses for different types of standard Linux operating systems.
Short deterministic Response Time
Some real-time embedded systems need to quickly respond to external events to complete a specific task. For example, a custom microcontroller embedded with a missile before directing the missile to a specific target in its surrounding environment, external events, such as moving targets, weather, and people, need to be quickly responded. A short deterministic response time is the time when an embedded system can determine the response time of an external event.
Procedure
Now let's take a look at how to make LEM. It is a small embedded Linux distribution edition that provides both the network and X servers. You can download the distribution, though not required. You need a complete Linux distribution to build your own embedded Linux operating system, which will include everything you need (utilities, source code, compilers, debuggers, and documentation ). The following is a list of software that can be used to make LEM:
TinyLogin: TinyLogin is a tiny UNIX utility used to log on to an embedded system, accept its authentication identity, change its password, and maintain its users and user groups. To enhance system security, it also supports shadow passwords. As its name implies, TinyLogin is very small and is an excellent supplement to BusyBox on embedded systems.
BusyBox: BusyBox is a multi-call binary file that provides the minimum subset of POSIX commands and specialized functions. It is suitable for very small embedded systems, such as boot disks. It is especially used for the Debian rescue/installation system (which inspires the development of the original BusyBox), Linux Routeur solution, LEM, lineo and other places. Busybox is maintained by Erik Anderson.
Ash: Ash is a very small Bourne shell.
Sysvinit: Sysvinit is the most common init package in Linux. We will use init and C-language start-stop-daemon.
For more information, see references.
Create boot disk
A boot disk is essentially a floppy disk with a miniature, self-contained Linux system. It can perform many of the same functions as the full Linux system. The following materials are based on Bootdisk-HOWTO (see references ).
Step 2: Bios
All PC systems start the boot process by executing the code in ROM (specifically, BIOS) to load the sector from the 0-cylindrical 0-sector Sector of the boot disk. The boot drive is usually the first floppy disk drive (A: in DOS, And/dev/fd0 in Linux ). Then the BIOS tries to execute this sector. Most boot disks have one of the following two types of content:
Code from the loader, such as LILO. The loader locates, loads, and runs the kernel to start normal boot.
The starting part of an operating system, such as the Linux Kernel
If the Linux kernel is directly copied to a disk, hard drive, or other media, the first sector of the disk will be the first sector of the Linux kernel. The first sector loads the rest of the kernel from the boot device to continue the boot process.
Step 2: Boot Loader
You can use a loader like LILO to execute the boot process. It allows the development and production platforms to coexist on the same hardware and allows a reboot to switch from one platform to another. LILO boot loader is loaded by bios. Then it loads the Boot Sector of the kernel or other operating systems. It also provides a simple command line interface to interactively select the items to be guided based on its options. For more information, see references.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service