0 / 5
Layers of an Operating System
The work of an operating system is split into five layers, starting from the side closest to the hardware. Layer 1 sits right on top of the hardware, and layer 5 is closest to the user. Each layer borrows the functions of the layer directly below it.
Example: when a user opens a document file, layer 5 (file management) takes the request and hands the needed work down to the layers below, one after another.
1 / 5
Layer 1: Processor management
A processor is the CPU, a piece of hardware. This layer works the CPU directly, so it sits right on top of the hardware. It handles processor scheduling, which decides which process gets the CPU, and synchronization, which keeps several processes from touching the same resource at once.
2 / 5
Layer 2: Memory management
It hands out memory for programs to use (allocation) and takes it back when they are done (reclamation). When several processes ask for memory at the same time, it borrows synchronization from layer 1 to keep them in order.
3 / 5
Layer 3: Process management
A process is a program running on the CPU. This layer creates and deletes processes, starts and stops them, and lets them pass messages to each other. A process needs memory before it can be created, so this layer sits above memory management (layer 2). The processor in layer 1 is the CPU hardware, so it is a different layer.
4 / 5
Layer 4: Peripheral device management
It checks the status of peripheral devices such as the keyboard, printer, and disk, and decides in what order to handle the I/O requests sent by processes (I/O device scheduling). The requests come from processes, so this layer sits above process management (layer 3).
5 / 5
Layer 5: File management
It creates and deletes files, opens and closes them, and keeps them maintained. It is the layer closest to the user. Files are stored on peripheral devices such as disks, so the actual reading and writing is handed to peripheral device management (layer 4).