Operating-System Structures

References:

  1. Abraham Silberschatz, Greg Gagne, and Peter Baer Galvin, "Operating System Concepts, Ninth Edition ", Chapter 2

This chapter deals with how operating systems are structured and organized. Different design issues and choices are examined and compared, and the basic structure of several popular OSes are presented.

2.1 Operating-System Services


Figure 2.1 - A view of operating system services

OSes provide environments in which programs run, and services for the users of the system, including:

Other systems aid in the efficient operation of the OS itself:

2.2 User Operating-System Interface

2.2.1 Command Interpreter


Figure 2.2 - The Bourne shell command interpreter in Solaris 10

2.2.2 Graphical User Interface, GUI


Figure 2.3 - The iPad touchscreen

2.2.3 Choice of interface


Figure 2.4 - The Mac OS X GUI

2.3 System Calls


Figure 2.5 - Example of how system calls are used.


The use of APIs instead of direct system calls provides for greater program portability between different systems. The API then makes the appropriate system calls through the system call interface, using a table lookup to access specific numbered system calls, as shown in Figure 2.6:


Figure 2.6 - The handling of a user application invoking the open( ) system call


Figure 2.7 - Passing of parameters as a table

2.4 Types of System Calls

Six major categories, as outlined in Figure 2.8 and the following six subsections:


( Sixth type, protection, not shown here but described below. )


2.4.1 Process Control


Figure 2.9 - MS-DOS execution. (a) At system startup. (b) Running a program.


Figure 2.10 - FreeBSD running multiple programs

2.4.2 File Management

2.4.3 Device Management

2.4.4 Information Maintenance

2.4.5 Communication

2.4.6 Protection

2.5 System Programs

2.6 Operating-System Design and Implementation

2.6.1 Design Goals

2.6.2 Mechanisms and Policies

2.6.3 Implementation

2.7 Operating-System Structure

For efficient performance and implementation an OS should be partitioned into separate subsystems, each with carefully defined tasks, inputs, outputs, and performance characteristics. These subsystems can then be arranged in various architectural configurations:

2.7.1 Simple Structure

When DOS was originally written its developers had no idea how big and important it would eventually become. It was written by a few programmers in a relatively short amount of time, without the benefit of modern software engineering techniques, and then gradually grew over time to exceed its original expectations. It does not break the system into subsystems, and has no distinction between user and kernel modes, allowing all programs direct access to the underlying hardware. ( Note that user versus kernel mode was not supported by the 8088 chip set anyway, so that really wasn't an option back then. )


Figure 2.11 - MS-DOS layer structure

The original UNIX OS used a simple layered approach, but almost all the OS was in one big layer, not really breaking the OS down into layered subsystems:


Figure 2.12 - Traditional UNIX system structure

2.7.2 Layered Approach


Figure 2.13 - A layered operating system

2.7.3 Microkernels


Figure 2.14 - Architecture of a typical microkernel

2.7.4 Modules


Figure 2.15 - Solaris loadable modules

2.7.5 Hybrid Systems

2.7.5.1 Mac OS X


Figure 2.16 - The Mac OS X structure

2.7.5.2 iOS


Figure 2.17 - Architecture of Apple's iOS.

2.7.5.3 Android


Figure 2.18 - Architecture of Google's Android

2.8 Operating-System Debugging

Kernighan's Law

"Debugging is twice as hard as writing the code in the first place. Therefore,
if you write the code as cleverly as possible, you are, by definition, not smart
enough to debug it."

2.8.1 Failure Analysis

2.8.2 Performance Tuning


Figure 2.19 - The Windows task manager.

2.8.3 DTrace


Figure 2.20 - Solaris 10 dtrace follows a system call within the kernel

2.9 Operating-System Generation

2.10 System Boot

The general approach when most computers boot up goes something like this:

2.11 Summary


Old 2.8 Virtual Machines ( Moved elsewhere in the 9th edition. )


Figure 16.1 - System models. (a) Nonvirtual machine. (b)Virtual machine.

2.8.1 History

2.8.2 Benefits

2.8.3 Simulation

2.8.4 Para-virtualization


Figure 16.7 - Solaris 10 with two zones.

2.8.5 Implementation

2.8.6 Examples

2.8.6.1 VMware


Figure 16.9 - VMWare Workstation architecture

2.8.6.2 The Java Virtual Machine


Figure 16.10 - The Java virtual machine


Figure 2.21