ch2 Operating System Structure
ch2 Operating System Structure
🔹 Example:
When you connect to Wi-Fi, the OS manages the connection and ensures data is sent
and received properly.
Operating System Services (Cont.)
8. Error Detection & Handling
Definition: The OS constantly monitors system performance and detects
errors to prevent failures.
🔹 Key Functions:
• Logs errors for troubleshooting.
• Automatically fixes minor system issues.
🔹 Example:
If a program crashes, Windows OS shows an error message and might suggest
solutions, like restarting the application.
9. Job Scheduling & Resource Allocation
Definition: The OS schedules and assigns system resources (CPU, memory,
disk, etc.) to different tasks efficiently.
🔹 Key Functions:
• Determines which processes get CPU time.
• Allocates memory and I/O resources to tasks.
🔹 Example:
When multiple applications are running, the OS schedules tasks so that one process
doesn’t use all the CPU while others wait
2.2 System Calls
C program invoking printf() library call, which calls write() system call
2.2.1.Types of system calls
1.Process control
• Purpose: Manage processes.
•Examples: fork(), exec(), exit(), wait().
•Use Case: Creating or terminating processes.
2. File management
• Purpose: handle file operation
• Examples: open(), read(), write(), close().
• Use Case: Reading from or writing to files.
Types of system calls con’t
3. Device Management
• Purpose: Control hardware devices.
• Examples: ioctl(), read(), write().
• Use Case: Interacting with peripherals like printers or disk drives.
4. Information Maintenance
• Purpose: Retrieve or set system data.
• Examples: getpid(), getuid(), times().
• Use Case: Obtaining process IDs or system time.
5. Communications
• Purpose: Facilitate data exchange between processes.
• Examples: pipe(), socket(), send(), recv().
• Use Case: Implementing inter-process communication or networking.
2.3 Operating System Structure
Since modern Operating systems are large and complex, they must be
engineered carefully to function properly and be modified easily. A common
approach is to partition the task into small components rather than have one
monolithic system.
1. Simple Structure
• Many commercial systems started as small, simple and limited systems and do
not have well-defined structures.
• All OS components (memory management, process management, file
management, etc.) are compiled into a single large kernel.
• The entire OS runs in kernel mode.
• Example: Linux, early UNIX systems.
MS-DOS Layer Structure
2. Layered Structure