Real-Time UNIX® Systems, 1991
Design and Application Guide

The Springer International Series in Engineering and Computer Science Series, Vol. 121

Authors:

Language: English
Publication date:
316 p. · 15.5x23.5 cm · Paperback
A growing concern of mine has been the unrealistic expectations for new computer-related technologies introduced into all kinds of organizations. Unrealistic expectations lead to disappointment, and a schizophrenic approach to the introduction of new technologies. The UNIX and real-time UNIX operating system technologies are major examples of emerging technologies with great potential benefits but unrealistic expectations. Users want to use UNIX as a common operating system throughout large segments of their organizations. A common operating system would decrease software costs by helping to provide portability and interoperability between computer systems in today's multivendor environments. Users would be able to more easily purchase new equipment and technologies and cost-effectively reuse their applications. And they could more easily connect heterogeneous equipment in different departments without having to constantly write and rewrite interfaces. On the other hand, many users in various organizations do not understand the ramifications of general-purpose versus real-time UNIX. Users tend to think of "real-time" as a way to handle exotic heart-monitoring or robotics systems. Then these users use UNIX for transaction processing and office applications and complain about its performance, robustness, and reliability. Unfortunately, the users don't realize that real-time capabilities added to UNIX can provide better performance, robustness and reliability for these non-real-time applications. Many other vendors and users do realize this, however. There are indications even now that general-purpose UNIX will go away as a separate entity. It will be replaced by a real-time UNIX. General-purpose UNIX will exist only as a subset of real-time UNIX.
1 Introduction to Real-Time Computing.- 1.1 Definition and Classification of Real-Time Computer Systems.- 1.2 Computer Requirements for Real-Time Applications.- 1.3 Systems Issues.- 1.4 Real-Time Measures.- 1.4.1 Rhealstone Metric.- 1.4.2 Process Dispatch Latency Time.- 1.4.3 Tri-Dimensional Measure.- 1.4.4 The Real/Stone Benchmark.- 1.5 Model of an Open Real-Time System.- 2 Real-Time Operating Systems.- 2.1 Requirements for Real-Time Operating Systems.- 2.2 Real-Time UNIX Operating Systems.- 2.2.1 The UNIX System and Real-Time.- 2.2.2 Real-Time UNIX Standards.- 2.2.3 Real-Time UNIX Implementations.- 3 Concept of a Fully Preemptive UNIX Operating System.- 3.1 System Concept.- 3.2 Process Subsystem.- 3.2.1 Process Concept.- 3.2.2 Process Creation and Termination.- 3.2.3 Forking Child Processes.- 3.2.4 Waiting for a Child Process to Terminate.- 3.2.5 Process States.- 3.3 Memory Management.- 3.3.1 Data Structures.- 3.3.2 Paging.- 3.3.3 Allocating Memory.- 3.3.4 Locking Pages in Memory.- 3.4 Process Scheduling.- 3.4.1 Data Structure Integrity.- 3.4.2 Timers.- 3.5 Interprocess Communication.- 3.5.1 Signal Mechanism.- 3.5.2 Common Event Notification.- 3.5.3 Shared Memory.- 3.5.4 User-Level Semaphores.- 3.6 File Subsystem.- 3.6.1 File Types.- 3.6.2 File Listings.- 3.6.3 File Permissions.- 3.6.4 User View of a File System.- 3.6.5 Accessing Files in Programs.- 3.6.6 File System Structure.- 3.6.7 Accessing Data Storage Blocks.- 3.6.8 Accessing Free Inodes and Data Blocks.- 3.6.9 File System Access Tables.- 3.6.10 Using the File Access Tables.- 3.7 I/O Subsystem.- 3.7.1 Device I/O.- 3.7.2 I/O Transfer Methods.- 3.7.3 Initiating I/O Operations.- 3.7.4 Device Interrupts.- 3.7.5 Drivers for Real-Time Applications.- 4 Designing Real-Time Applications.- 4.1 Programming Guidelines.- 4.1.1 Real-Time Program Structure.- 4.1.2 Development Procedure.- 4.1.3 Using System Calls.- 4.1.4 Performance Hints.- 4.2 Scheduling Processes.- 4.2.1 Selecting Process Priorities.- 4.2.2 Setting Real-Time Privileges.- 4.2.3 Changing Process Priority.- 4.2.4 Monitoring the Run Queue.- 4.2.5 Real-Time Timers.- 4.3 Real-Time Memory Allocation.- 4.3.1 Controlling Memory Allocation.- 4.3.2 Locking Pages into Memory.- 4.3.3 Example Program: Preallocating Memory for a Process.- 4.3.4 Example Program: Handling Real-Time Memory Violations.- 4.4 Interprocess Communications: Pipes, Signals and Events.- 4.4.1 Pipes and Named Pipes.- 4.4.2 Signals.- 4.4.3 Common Event Notification Mechanism.- 4.5 Interprocess Communications Using Shared Memory.- 4.5.1 Using Shared Memory.- 4.5.2 Creating a Shared Memory Segment.- 4.5.3 Allocating a Physical Shared Memory Segment.- 4.5.4 Controlling Shared Memory.- 4.5.5 Attaching and Detaching a Shared Memory Segment..- 4.5.6 Getting Physical Shared Memory Segment.- 4.5.7 Checking the Status of a Shared Memory Segment.- 4.6 Interprocess Communications Using Semaphores.- 4.6.1 Creating a Semaphore Structure and Array.- 4.6.2 Controlling Semaphores.- 4.6.3 Operations on Semaphores.- 4.6.4 Using Binary Semaphores.- 4.7 Interprocess Communications Using Messages.- 4.7.1 Creating Message Queues.- 4.7.2 Controlling Message Queues.- 4.7.3 Message Operations.- 4.8 Using Files.- 4.8.1 Fast File System.- 4.8.2 Creating Files and File Systems.- 4.8.3 Preallocating File Space.- 4.8.4 Bypassing the Buffer Cache.- 4.8.5 Asynchronous File I/O.- 4.8.6 Using Both Synchronous and Asynchronous I/O on a File.- 4.8.7 Synchronizing Disk Access.- 4.9 Interfacing Devices.- 4.9.1 Asynchronous I/O Operations.- 4.9.2 Traditional UNIX System Interrupts.- 4.9.3 Connected Interrupts.- 4.9.4 Direct I/O.- 4.10 Writing System Calls.- 4.10.1 Overview of System Calls.- 4.10.2 Guidelines for Writing System Calls.- 4.10.3 Installing System Calls in the Kernel.- 4.10.4 Accessing User-Defined System Calls.- 4.11 Porting Applications.- 4.11.1 Porting SVID-Compatible Applications.- 4.11.2 Porting from Proprietary Operating Systems.- 4.12 Performance Management.- 4.12.1 Creating an Efficient Environment.- 4.12.2 Maintaining System Efficiency.- 4.12.3 Solving Performance Problems.- 4.12.4 Measuring Performance.- 4.12.5 Performance Evaluation of the REAL/IX System.- 5 Case Studies.- 5.1 The Data Acquisition and Space Shuttle Launch Control System at NASA Kennedy Space Center.- 5.1.1 The Data Acquisition System.- 5.1.2 The Application Processing System.- 5.2 The Communication Processor at Jet Propulsion Laboratory.