01 Introduction
01 Introduction
Core Services
Allow
running applications to use memory as well as share
the memory
“Note that why the OS does this is not the main question, as the
answer should be obvious: it makes the system easier to use. ”
“Thus, we focus on the how: what mechanisms and policies are
implemented by the OS to support its services? How does the OS
do so efficiently? What hardware support is needed?”
Typically
system has many processes, some are user
processes, some are OS/kernel/system processes, running
concurrently on one or more CPUs (cores)
Main objective
With limited memory and many processes are running
concurrently, OS determines what should be in memory
To optimize CPU utilization and computer response to users
How to run many processes with total memory demand higher than
physical limit?
Getting help from the larger, slower hard disks
File System
Provides a uniform, logical view of information storage
Abstracts physical properties to logical storage unit - file
Maps files onto physical media and provides mechanisms for
applications to manage and access files
Provides a high degree of reliability and will not fail due to isolated
application/hardware errors
Systematic Thinking
Engineering is nothing but trade-off.
26
Operating Systems tend to be complex
Provide many services (really too many!)
support variety of hardware and software
User mode
CPU is put in user mode when a user application is executing
Running in a lower privilege level
Only a subset of the machine instructions is available
Ensures that one user program cannot execute instruction that may interfere with
operation of other user programs
Disadvantages
Components can interact with hardware directly
Architecture dependent code was spread throughout the kernel
With
the layered approach, the designers have a choice
where to draw the kernel-user boundary
Principles of Operating Systems 33
Cons
Poor performance
Difficult to define and order layers
Not flexible
Disjunction between model and reality: real systems are more
complex, difficult for such layered abstraction (see Windows NT
story)
The first release of Windows NT (3.x) using the layered organization
suffered low performance compared to that of Windows 95.
Windows NT 4.0 moves layers from user space to kernel space and more closely
integrating them to improve the performance.
In essence, it serves as an OS
for OSs.
Con
Poor performance: Server processes (in user space) are
interacting by means of message exchanges, which need the
helps from kernel
Induce significant performance overhead because of communications
have to go through kernel
Most embedded systems adopt microkernel
A hybrid kernel with modular design (Source: Anatomy of the Linux Kernel by M. Tim Jones)
(Source: Kernel Programming Guide by Apple) (Source: Android Open Source Project)