CH 2 Operating System Structure
CH 2 Operating System Structure
Structures
Operating System Concepts – 9th Edition Silberschatz, Galvin and Gagne ©2013
Objectives
To describe the services an operating system
provides to users, processes, and other systems
To discuss the various ways of structuring an
operating system
To explain how operating systems are booted
Operating System Concepts – 9th Edition 2.2 Silberschatz, Galvin and Gagne ©2013
2.1 Operating System Services
Operating System Concepts – 9th Edition 2.3 Silberschatz, Galvin and Gagne ©2013
OS Services Helpful to the User
Figure 2.1
Operating System Concepts – 9th Edition 2.5 Silberschatz, Galvin and Gagne ©2013
2.2.1 Command Interpreters (CLI)
CLI allows users to directly enter commands to be performed by
the operating system.
Operating System Concepts – 9th Edition 2.6 Silberschatz, Galvin and Gagne ©2013
The Bourne shell command interpreter in Solaris
Operating System Concepts – 9th Edition 2.7 Silberschatz, Galvin and Gagne ©2013
2.2.2 Graphical User Interfaces (GUI)
Operating System Concepts – 9th Edition 2.9 Silberschatz, Galvin and Gagne ©2013
The Mac OS X GUI
Figure 2.4
Operating System Concepts – 9th Edition 2.10 Silberschatz, Galvin and Gagne ©2013
2.3 System Calls
Programming interface to the services provided by the OS
Typically written in a high-level language (C or C++)
Mostly accessed by programs via a high-level Application
Programming Interface (API) rather than direct system call
Three most common APIs are:
Win32 API for Windows,
POSIX API for POSIX-based systems (including virtually
all versions of UNIX, Linux, and Mac OS X),
Java API for the Java virtual machine (JVM)
Operating System Concepts – 9th Edition 2.11 Silberschatz, Galvin and Gagne ©2013
Example of System Calls
Figure 2.5
Operating System Concepts – 9th Edition 2.12 Silberschatz, Galvin and Gagne ©2013
Example of Standard API
Operating System Concepts – 9th Edition 2.13 Silberschatz, Galvin and Gagne ©2013
2.4 Types of System Calls
System calls can be grouped roughly into six major
categories:
Process control,
File manipulation,
Device manipulation,
Information maintenance,
Communications,
Protection.
Operating System Concepts – 9th Edition 2.14 Silberschatz, Galvin and Gagne ©2013
Examples of Windows and Unix System Calls
Operating System Concepts – 9th Edition 2.15 Silberschatz, Galvin and Gagne ©2013
2.5 System Programs
System programs provide a convenient environment for
program development and execution.
Some of them are simply user interfaces to system calls.
Others are considerably more complex.
They can be divided into:
File manipulation
Status information sometimes stored in a File modification
Programming language support
Program loading and execution
Communications
Background services
Application programs
Most users’ view of the operation system is defined by
system programs, not the actual system calls
Operating System Concepts – 9th Edition 2.16 Silberschatz, Galvin and Gagne ©2013
2.7 Operating System Structure
Operating System Concepts – 9th Edition 2.17 Silberschatz, Galvin and Gagne ©2013
2.7.1 Simple Structure: MS-DOS
MS-DOS – written to
provide the most
functionality in the least
amount of space
MS-DOS was limited by
hardware funcionality.
Not divided into
modules
Although MS-DOS has
some structure, its
interfaces and levels of
functionality are not well
separated
Operating System Concepts – 9th Edition 2.18 Silberschatz, Galvin and Gagne ©2013
2.7.1 More Complex: UNIX
Operating System Concepts – 9th Edition 2.19 Silberschatz, Galvin and Gagne ©2013
Traditional UNIX System Structure
Figure 2.12
Operating System Concepts – 9th Edition 2.20 Silberschatz, Galvin and Gagne ©2013
Linux System Structure
Operating System Concepts – 9th Edition 2.21 Silberschatz, Galvin and Gagne ©2013
2.7.2 Layered Approach
Figure 2.13
Operating System Concepts – 9th Edition 2.22 Silberschatz, Galvin and Gagne ©2013
2.7.3 Microkernel System Structure
Moves as much from the kernel into user space
Mach example of microkernel
Mac OS X kernel (Darwin) partly based on Mach
Communication takes place between user modules using
message passing
Benefits:
Easier to extend a microkernel
Easier to port the operating system to new architectures
More reliable (less code is running in kernel mode)
More secure
Detriments:
Performance overhead of user space to kernel space
communication
Operating System Concepts – 9th Edition 2.23 Silberschatz, Galvin and Gagne ©2013
Microkernel System Structure
Figure 2.14
Operating System Concepts – 9th Edition 2.24 Silberschatz, Galvin and Gagne ©2013
2.7.4 Modules
Many modern operating systems implement loadable kernel
modules
Uses object-oriented approach
Each core component is separate
Each talks to the others over known interfaces
Each is loadable as needed within the kernel
Overall, similar to layers but with more flexible
Linux, Solaris, etc
Operating System Concepts – 9th Edition 2.25 Silberschatz, Galvin and Gagne ©2013
2.7.5 Hybrid Systems
In practice, very few operating systems adopt a single,
strictly defined structure.
Instead, they combine different structures, resulting in hybrid
systems that address performance, security, and usability
issues.
For example, Linux is monolithic, because having the operating
system in a single address space provides very efficient
performance. However, Linux are also modular, so that new
functionality can be dynamically added to the kernel.
Examples of the structure of hybrid systems:
Apple Mac operating system (laptop)
iOS (mobile operating systems)
Android (mobile operating systems)
Operating System Concepts – 9th Edition 2.26 Silberschatz, Galvin and Gagne ©2013
Architecture of Mac OS X and iOS
Operating System Concepts – 9th Edition 2.27 Silberschatz, Galvin and Gagne ©2013
Android
Developed by Open Handset Alliance (mostly Google)
Open Source
Similar stack to iOS
Based on Linux kernel but modified
Provides process, memory, device-driver management
Adds power management
Runtime environment includes core set of libraries and
Dalvik virtual machine
Apps developed in Java plus Android API
Java class files compiled to Java bytecode then translated
to executable than runs in Dalvik VM
Libraries include frameworks for web browser (webkit),
database (SQLite), multimedia, smaller libc
Operating System Concepts – 9th Edition 2.28 Silberschatz, Galvin and Gagne ©2013
Android Architecture
Operating System Concepts – 9th Edition 2.29 Silberschatz, Galvin and Gagne ©2013
2.10 System Boot
Operating System Concepts – 9th Edition 2.30 Silberschatz, Galvin and Gagne ©2013
EXERCISE
From Silberchatz, Operating System Concepts Chapter 2
Exercises
Operating System Concepts – 9th Edition 2.31 Silberschatz, Galvin and Gagne ©2013
End of Chapter 2
Operating System Concepts – 9th Edition Silberschatz, Galvin and Gagne ©2013