1. Introduction to Operating System Organization
An Operating System (OS) is system software that manages computer hardware and software resources and provides services to application programs.
Operating System Organization explains how the internal components of an OS are arranged and how they work together to manage processes, memory, devices and system services.
2. Factors in Operating System Design
Operating system design involves deciding how the OS should manage resources and provide services. Important considerations include:
- Performance: The OS should use CPU, memory and devices efficiently.
- Reliability: It should operate correctly and recover from errors where possible.
- Security: It should protect data, processes and system resources from unauthorized access.
- Resource management: CPU, memory, files and I/O devices must be allocated properly.
- Scalability: The OS should support changing workloads and hardware capabilities.
- Portability: The OS should be adaptable to different hardware platforms where designed to do so.
- Usability: It should provide convenient ways for users and programs to interact with the system.
3. Primary OS Functions
The operating system performs several major functions:
3.1 Process Management
A process is a program in execution. The OS creates, schedules, suspends and terminates processes. It also coordinates processes that need to share resources.
Example: Running a browser and a media player at the same time.
3.2 Memory Management
The OS keeps track of memory usage, allocates memory to processes and releases it when no longer needed.
Example: Allocating RAM to a newly opened application.
3.3 File Management
The OS manages files and directories. It supports operations such as creating, opening, reading, writing, renaming and deleting files.
3.4 Device and I/O Management
The OS coordinates input/output devices such as keyboards, printers, storage devices and monitors. Device drivers help the OS communicate with hardware.
3.5 Security and Protection
The OS controls access to system resources. Authentication checks identity, while authorization determines what an authenticated user or process is allowed to do.
3.6 Storage and Resource Management
The OS manages secondary storage and allocates available resources among competing processes.
3.7 User Interface and Networking
The OS may provide a command-line interface (CLI), graphical user interface (GUI), and networking facilities for communication between systems.
4. Implementation Consideration: Process Models
A process model describes how the operating system represents and manages executing programs.
4.1 Process
A process is an active instance of a program. A program stored on disk is passive; when it executes, it becomes a process.
4.2 Process Control Block (PCB)
The OS maintains information about each process in a data structure called the Process Control Block.
A PCB commonly contains:
- Process ID (PID)
- Process state
- Program counter
- CPU register information
- Scheduling information
- Memory-management information
- I/O and file-related information
4.3 Process States
A common process-state model includes the following states:
| State | Meaning |
|---|---|
| New | Process is being created. |
| Ready | Process is waiting for CPU allocation. |
| Running | Process is currently executing on the CPU. |
| Waiting / Blocked | Process is waiting for an event or I/O operation. |
| Terminated | Process has finished execution. |
Typical flow:
New → Ready → Running → Terminated
↓
Waiting
↓
Ready
4.4 Context Switching
Context switching occurs when the CPU changes from executing one process to another. The OS saves the current process context and restores the context of the next process.
Example: The CPU stops executing Process A, saves its state, and starts executing Process B.
5. Kernels
The kernel is the central component of an operating system. It manages communication between software and hardware and performs essential system-level operations.
Major responsibilities of a kernel
- Process and CPU management
- Memory management
- Device and I/O management
- Handling system calls
- Managing access to protected resources
Types of Kernel Architecture
| Type | Explanation |
|---|---|
| Monolithic Kernel | Many OS services run in kernel space as part of a large kernel. |
| Microkernel | Only essential services run in kernel space; other services run outside it. |
| Hybrid Kernel | Combines design ideas from monolithic and microkernel approaches. |
User Mode and Kernel Mode
| User Mode | Kernel Mode |
|---|---|
| Applications normally execute here. | Core OS operations execute here. |
| Restricted access to hardware and protected resources. | Privileged access to system resources. |
| Uses system calls to request OS services. | Handles authorized system-service requests. |
6. Methods of Requesting System Services
Application programs often need services that they cannot safely perform directly. They request these services from the OS through system calls.
A system call is a controlled interface between a user program and the operating system kernel.
How a system call works
- An application requests an OS service.
- The request is made through a system-call interface.
- Control transfers to the kernel through a controlled mechanism.
- The kernel performs the requested operation after checking the request.
- The result is returned to the application.
Application Program
|
| System Call
v
System Call Interface
|
v
Kernel
|
v
Hardware / OS Service
|
v
Result Returned
Common Categories of System Calls
| Category | Purpose | Example |
|---|---|---|
| Process control | Create, execute or terminate processes. | Process creation |
| File management | Create, read, write and delete files. | File read |
| Device management | Request or release device resources. | Device access |
| Information maintenance | Obtain or update system information. | Get process information |
| Communication | Exchange data between processes. | Inter-process communication |
| Protection | Control permissions and access. | Permission checking |
7. Device Drivers
A device driver is software that allows the operating system to communicate with and control a particular hardware device or class of devices.
Different hardware devices may have different control commands and communication requirements. Drivers provide the software interface needed by the OS.
Examples
- Printer driver – helps the OS communicate with a printer.
- Graphics driver – supports communication with graphics hardware.
- Audio driver – manages audio hardware interaction.
- Network driver – enables communication with a network adapter.
How a device driver works
Application
|
v
Operating System
|
v
Device Driver
|
v
Hardware Device
Why are device drivers needed?
- They translate OS requests into device-specific operations.
- They help the OS control hardware.
- They provide a consistent interface for device access.
- They help manage device operations and errors.
8. Quick Revision Table
| Term | Remember |
|---|---|
| Kernel | Core component of OS |
| PCB | Stores process information |
| Context switching | Switching CPU execution between processes |
| System call | Request for an OS service |
| Device driver | Software interface for hardware |
| User mode | Restricted execution mode |
| Kernel mode | Privileged execution mode |
| Microkernel | Minimal services in kernel space |
| Monolithic kernel | Many services in kernel space |
9. Interactive MCQ Test – 15 Questions
Select one answer for each question and click Submit Quiz to view your score and explanations.
10. Self-Assessment Checklist
- Can I explain the factors involved in OS design?
- Can I list the primary functions of an operating system?
- Can I explain PCB and process states?
- Can I define context switching?
- Can I distinguish kernel mode and user mode?
- Can I explain monolithic and microkernel architectures?
- Can I describe how system calls work?
- Can I explain the role of device drivers?
Study tip: First understand the kernel, system calls and device drivers. Then attempt the quiz without looking at the notes.