Ch02 (Compatibility Mode)
Ch02 (Compatibility Mode)
Ch02 (Compatibility Mode)
Chapter 2: Operating-System Structures OperatingOperating System Services User Operating System Interface System Calls Types of System Calls System Programs Operating System Design and Implementation Operating System Structure Virtual Machines Operating System Generation System Boot
OS Views
services
OS
Interface Components
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 installed and customized and how they boot
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 Program Interface (API) rather than direct system call use Three most common APIs are Win32 API for Windows, POSIX (Portable Operating System Interface ) API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM).
A description of the parameters passed to ReadFile() HANDLE filethe file to be read LPVOID buffera buffer where the data will be read into and written from DWORD bytesToReadthe number of bytes to be read into the buffer LPDWORD bytesReadthe number of bytes read during the last read LPOVERLAPPED ovlindicates if overlapped I/O is being used
System Programs
System programs provide a convenient environment for program development and execution. They can be divided into: File manipulation Status information File modification Programming language support Program loading and execution Communications Application programs Most users view of the operating system is defined by system programs, not the actual system calls
Operating Systems Structure (What is the organizational Principle?) Simple (i.e. monolithic) Only one or two levels of code Layered Lower levels independent of upper levels Microkernel OS built from many user-level processes Modular Core kernel with Dynamically loadable modules
user programs
OS
everything
hardware
Simple Structure
MS-DOS written to provide the most functionality in the least space Not divided into modules Although MS-DOS has some structure, its interfaces and levels of functionality are not well separated
MS-DOS Layer Structure MSMS-DOS written to provide the most functionality in the least space Not divided into modules Interfaces and levels of functionality not well separated
Layered Approach
The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface. With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers
UNIX
UNIX limited by hardware functionality, the original UNIX operating system had limited structuring. The UNIX OS consists of two separable parts Systems programs The kernel Consists of everything below the system-call interface and above the physical hardware Provides the file system, CPU scheduling, memory management, and other operating-system functions; a large number of functions for one level
Modules
Most modern operating systems implement 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
RPCs,
inter
process
BSD provides support for networking and file systems. Kernel environment also provides support for an I/O kit for development of device drivers and dynamically loadable modules.
Virtual Machines
A virtual machine takes the layered approach to its logical conclusion. A virtual machine provides an interface identical to the underlying bare hardware The operating system creates the illusion of multiple processes, each executing on its own processor with its own (virtual) memory
Non-virtual Machine
Virtual Machine
VMware
VMware Architecture
JVM
JVM
JVM
System Boot
Operating system must be made available to hardware so hardware can start it Small piece of code bootstrap loader, locates the kernel, loads it into memory, and starts it Sometimes two-step process where boot block at fixed location loads bootstrap loader When power initialized on system, execution starts at a fixed memory location Firmware used to hold initial boot code
End of Chapter 2