Analysis and comparison of four real-time operating systems

  

This article analyzes and compares four real-time operating system (RTOS) features. They are: LynxOS from Lynx Real-Time Systems, QNX from QNX Software Systems, Inc., and two representative real-time Linux--RT-Linux from the New Mexico Institute of Technology and KURT-Linux from the University of Kansas.

In recent years, real-time operating systems have been widely used in various fields such as multimedia communication, online transaction processing, production process control, and traffic control, and thus have attracted more and more attention.

1. Overview of Basic Features

QNX is a distributed, embedded, scalable real-time operating system. It follows POSIX.1, (program interface) and POSIX.2 (Shell and Tools), and partially follows POSIX.1b (real-time extension). It was first developed in 1980 and is now quite mature. LynxOS is a distributed, embedded, scalable real-time operating system that follows the POSIX.1a, POSIX.1b, and POSIX.1c standards. It was first developed in 1988. RT-Linux is an embedded hard real-time operating system that partially supports the POSIX.1b standard. KURT-Linux is not designed for embedded applications. Unlike hard real-time/soft real-time applications, they propose the concepts of "real" applications, such as multimedia applications and ATM network applications. KURT is a "strict" real-time system designed for such applications.

2, architecture similarities and differences

Real-time system implementation is mostly micro-kernel architecture, which makes the core small and reliable, easy to ROM firmware, and modular extension. In the microkernel architecture system, the OS service module runs in a separate address space, so memory errors of different modules are isolated. But it also has weaknesses, and the overhead of inter-process communication and context switching is greatly increased. Compared to large integrated kernel systems, it must rely on more system calls to accomplish the same task.

QNX is a microkernel real-time operating system that provides only four services at its core: process scheduling, interprocess communication, underlying network communication, and interrupt handling, with processes running in separate address spaces. All other OS services are implemented as collaborative user processes, so the QNX core is very small (QNX4.x is about 12Kb) and runs extremely fast.

LynxOS is not yet a microkernel-based operating system, but it plans to use the so-called "Galaxy" technology to transform it from a large integrated kernel to a microkernel, a technology that will be introduced in LynxOS 3.0. . The new 28Kb microkernel provides the following services: core start and stop, underlying memory management, error handling, interrupt handling, multitasking, underlying synchronization, and mutual exclusion support.

RT-Linux implements a small real-time kernel that supports only the underlying task creation, the loading of interrupt service routines, the underlying task communication queue, the interrupt service routine (ISR), and the Linux process. The original non-real-time Linux kernel runs as a preemptive task on this small core, and all tasks run in the core address space. It is different from the microkernel and large kernel and belongs to the realtime exe (realtime executive) architecture. Its reliability and maintainability are not ideal for telecom service systems.

The KURT-Linux core consists of two parts: the kernel and the real-time module. The kernel is responsible for the scheduling of real-time events, and the real-time module provides specific real-time services for user processes. It is not part of the microkernel structure.

3, scheduling strategy analysis

Task scheduling strategy is a factor that directly affects real-time performance. Although the scheduling algorithms are various, most of them are changed by the monotonic rate algorithm (RM) and the earliest term priority algorithm (EDF). The former is mainly used for scheduling of static periodic tasks, and the latter is mainly used for dynamic scheduling. In different system states, the two algorithms have their own advantages and disadvantages. The actual strategy employed in commercial products is often a compromise between various factors.

QNX provides POSIX.1b standard process scheduling: 32 process priorities; preemptive, priority-based text switching; optional scheduling strategies: FIFO, rotation strategy, adaptive strategy. LynxOS's scheduling strategy is: LynxOS supports the thread concept, providing 256 global user thread priorities; Hard real-time priority scheduling: round-robin scheduling, quantitative scheduling, and FIFO scheduling strategies are implemented at each priority; fast text switching and blocking time Short; preemptive RTOS core.

RT-Linux implements a simple real-time kernel under the operating system. Linux itself runs as a preemptible task in the core, with the lowest priority and is preempted by high-priority tasks at any time. Users can write their own schedulers, which can be implemented as loadable core modules; implemented schedulers are: priority-based preemptive scheduling and EDF scheduling; priority-based scheduling uses the "monotonic rate algorithm" Direct support for periodic tasks.

KURT-Linux runs under two states: normal state and real-time state. In the normal state, all processes can run, but some core services will bring the unpredictability of interrupt masking. Real-time mode only allows real-time processes to run. Supports FIFO scheduling policy, round-robin scheduling policy, and UNIX time-sharing scheduling policy; adds SCHED-KURT scheduling policy, which is a static scheduling policy that uses a special scheduling file to record pre-defined parameters of the process to be scheduled.

As can be seen from the above brief description, the first three scheduling strategies are more standardized, especially the two commercial RTOSs, which follow or partially follow the POSIX.1b real-time scheduling standard.

4, operating system service comparison

4.1 QNX system services:

Multiple resource managers, including various file systems and device management, support multiple file systems Simultaneous operation, including POSIX file system providing full POSIX.1 and UNIX syntax, embedded file system supporting multiple flash devices, SMB supporting transparent access to multiple file servers (such as Windows NT/95, LAN Manager, etc.) File system, DOS file system, CDROM file system, etc. Device management. Provides high throughput, low overhead interface services between processes and end devices. Graphics/window support. Includes QNX Windows, X Window System for QNX, remote graphics connectivity to MS Windows NT/95 and X Window System. TCP/IP for QNX. The high-performance, fault-tolerant QNX network, FLEET, turns all computers connected to the network into a logical supercomputer. Transparent distributed processing. The FLEET network handles integration with messaging and process management primitives, unifying local and network IPCs, making the network transparent to IPC.

4.2 LynxOS System Services:

Network and Communication. Thanks to the UNIX/POSIX API, Lynx is well suited for data communication and Internet applications. And because of the openness of the system, network software is easy to port to Lynx. Similarly, Lynx also provides key telephony protocols that make it suitable for infrastructure, operations, and multimedia applications in telecommunications systems. TCP/IP protocol stack. Lynx comes with an optimized TCP/IP stack that provides high-performance services such as TCP header prediction, advanced routing algorithms, IP-level multicasting, and link-level caching. Internet tools. Including, Telnet, Ftp, tftp, PPP, SLIP, embedded Java virtual machine for real-time scheduling, embedded HTTP server, bootp, ARP/RARP, DNS domain name service, email, Perl, telephony protocol, etc. SVR3 stream. The LynxOS streaming mechanism provides core support for developing and porting stream-based drivers and applications. File system. Real-time UNIX-like hierarchical file system: continuous structure files, with/without buffering, raw partitioning, and raw device access. Motif-based graphical user interface. Distributed computing resources. SCMP combines with multiprocessing on the VME bus, PCI Bridge Service, CompactPCI Hot-swap Services, Lynx/HA-DDS Distributed Data System.

4.3 Linux System Services:

Recently, many Linux-based real-time applications have been developed, which have mature and rich resources.

UNIX users' development tools and applications are ported to Linux. TCP/IP network protocol. Various Internet client/server software. X Window. Language compilers such as C/C++ and Java.

The commonality of the above systems is that they provide the necessary tools such as graphical interface and various network support. QNX is an operating system that is more in line with the traditional "distributed" concept. The goal is to turn the entire LAN into a large supercomputer, making the existence of the network transparent to users and the file system providing rich services. However, the higher the degree of distribution, the greater the overhead. LynxOS is designed to provide rich network services, and the biggest advantage of Linux is economy, but also through newsgroups or mailing

5, system openness comparison

For many large and medium-sized systems In fact, most of the software is written for the UNIX platform, so it is important for the RTOS to provide the POSIX/UNIX API.

5.1 QNX Openness

QNX's POSIX compatibility and its UNIX-specific compilers, debuggers, X Window and TCP/IP are familiar to UNIX programmers. Support for a variety of CPUs: AMD ElanSC300/310/400/410, Am386 DE/SE, Cyrix MediaGX, x86 processor (386 or higher), Pentium series, STMicroelectronics STPC. Multiple buses: CompactPCI, EISA, ISA, MPE (RadiSys), STD, STD 32, PC/104, PC/104-Plus, PCI, PCMCIA, VESA, VME. A variety of peripherals: a variety of SCSI devices, IDE /EIDE drives, 10M /100M Ethernet cards, Token Ring network cards, FDDI interface cards, a variety of PCMCIA devices, flash memory, sound cards and more.

5.2 LynxOS Openness

POSIX.1a, 1b, 1c, and BSD4.4 compatibility makes it easy to port POSIX 1003 or UNIX-like programs to LynxOS. Support for a variety of CPU motherboards: including CompactPCI (6U /3U) and standard PCI, VME /Eurobus, PC /104 and PC /AT hardware. Various peripheral adapters: 10/100BaseT Ethernet, SCSI interface, single/multi-channel serial controller, single/duplex parallel port, clock, timer, IDE interface, high resolution display adapter, etc.

5.3 Openness of Linux

Users can get all the development tools of UNIX. You can use cheap and common hardware on the market.

Through analysis, we can see that the above systems have their own advantages. Therefore, in the process of platform construction, users should choose according to their actual needs and combined with performance and price ratio.

Copyright © Windows knowledge All Rights Reserved