Services provided by the kernel
- Always resides in the main memory
- Controls the execution of processes
by allowing their creation, termination or suspension, and communication
- Schedules processes fairly for
execution on the CPU.
- Processes share the CPU in a
time-shared manner
- CPU executes a process
- Kernel suspends it when its time quantum elapses
- Kernel schedules another process to execute
- Kernel later reschedules the suspended process
- Allocates main memory for an executing process
- The kernel allows processes to
share portions of their address space under certain conditions, but
protects the private address space of a process from outside tampering
- If the system runs low on free memory, the kernel frees memory by
writing a process temporarily to
secondary memory, or a {\sl swap} device
- If the kernel writes entire processes to a swap device, the
implementation of the Unix system is called a {\sl swapping} system; if
it writes pages of memory to a swap device, it is called a {\sl paging}
system.
- Coordinates with the machine hardware to set up a virtual to physical
address that maps the compiler-generated addresses to their physical
addresses.
- File system maintenance
- Allocates secondary memory for efficient storage and retrieval of user
data
- Allocates secondary storage for user files
- Reclaims unused storage
- Structures the file system in a well understood manner
- Protects user files from illegal access
- Allows processes controlled access to
peripheral devices such as terminals, tape drives, disk drives, and network
devices.
Services provided by the kernel transparently
- Kernel recognizes that a given file is a
regular file or a device but hides the distinction from user processes
- Kernel formats data in a file for internal storage but hides the internal
format from user processes, returning an unformatted byte stream
- Kernal allows shell to read terminal input, to
spawn processes dynamically, to synchronize process execution, to create
pipes, and to redirect I/O
From Maurice J. Bach. The Design of the Unix Operating System.
Prentice-Hall, Englewood Cliffs, NJ. 1986.