Académique Documents
Professionnel Documents
Culture Documents
Services
System Structure
Layered approach
Operating system divided into layers Higher levels use only services of lower levels Basic principle of abstract data types (classes)
Figure 2.14
Example
Figure 2.13, p. 69
monolithic structure
Monolithic Structure
an enormous amount of functionality combined into one level [of abstraction in software] (p. 69, Our text-- Silberschatz et al.) this approach might well be subtitled The Big Mess. The structure is that there is no structure. The operating system is written as a collection of procedures, each of which can call any of the other ones whenever it wants to. (p. 56, Tanenbaum, 2001, Modern Operating Systems, 2nd Ed).
6
Microkernel Approach
More like a client-server system Kernel supports efficient message passing
Plus some other low-level services such as interrupt handling, loading device drivers
Mach (some versions), and QNX (http://www.qnx.com/) operating systems organized this way QNX is real-time; small (micro) kernel can be advantageous to real-time systems
7
http://en.wikipedia.org/wiki/Microkernel
device driver
Figure 2.16
10
Fig 2.15
Perhaps the best current methodology for operating-system design involves using objectoriented programming techniques to create a modular kernel (p. 72) modules are typically dynamically loadable (e.g., Solaris, Linux, Mac OS X)
11
Virtual Machines
Processes provided with an interface virtually identical to the bare hardware Each process is provided with a (virtual) copy of the underlying computer E.g., IBM VM mainframe operating system Devices are an issue
e.g., Disks must be partitioned
Non-virtual Machine
Virtual Machine
15
16
Instructions specified as bytecodes Architecture neutral Java program code is compiled (javac) into files containing bytecode JVM includes
Class loader Bytecode verifier Bytecode interpreter
18
Services
User interface Program execution: Processes Resource allocation I/O operations File-system manipulation Communications Protection & security Error detection Figure 2.1, p. 48 of text Accounting
19
Services - 1
User Interface
GUI and command line are the most common for general purpose operating systems
Program execution
System must be able to load a machine language program into RAM memory and run that program
Resource allocation
Multiple processes or users: Need to share, allocate, and manage resources Examples of types of resources: CPU cycles (time), main memory, disk files, I/O devices (printers, USB flash drives etc).
20
Services - 2
I/O operations
All I/O that a program does is typically carried out by the O/S This is for efficiency and protection
File-system manipulation
creating, reading, writing files & directories
Communications
Between processes on the same computer and between processes across different computers e.g., Shared memory & message passing
21
Services - 3
Protection & security
In multiuser systems, some people want to control access to their information Generally, when several separate processes execute concurrently, it should not be possible for one process to interfere with others or with the operating system itself (p. 49)
Error detection
OS needs be constantly aware of possible errors (p. 49) Hardware errors include: power, memory, device errors Software errors include: divide by 0, access of an illegal memory location
Accounting
Which processes/users use which resources and for how long? For statistics or for billing, and possibly for imposing resource limits 22
Process is resumed (return from interrupt), back in user mode; context switch is required
Libraries
User process
User process
System call Return value(s) Procedure call is within the user process address space Operating system
26
30
31
32
System Programs
How does a system program differ from a system call? System program: Application programs that provide system related services
Use operating system calls to provide operating system related functionality Run in user mode (not kernel mode)
End!
34