Operating System Structures and Core Components
1. Types of OS
Operating systems can be classified based on their structure, usage, and capability:
Batch Operating System
- Jobs with similar needs are grouped (batched) and run together.
- No direct interaction between the user and the computer during job execution.
- Goal: Maximize CPU utilization.
- Example: Used in environments that process large, repetitive tasks, like payroll systems.
Time-Sharing (Multitasking) OS
- The CPU switches rapidly between multiple jobs (processes) to give each user the impression that they are exclusively using the computer.
- The time slice given to each process is very small (a few milliseconds).
- Goal: Provide interactive use of the computer system, reducing response time.
Real-Time OS (RTOS)
- Designed for applications where timing is critical and the OS must respond to input within a strict time deadline.
- Hard Real-Time: Missing a deadline is a system failure (e.g., medical devices, flight control systems).
- Soft Real-Time: Missing a deadline is undesirable but tolerable (e.g., multimedia systems, stock trading).
Distributed OS
- Manages a group of independent, interconnected computers and makes them appear to the user as a single, coherent system.
- Goal: Resource sharing, computation speedup, and reliability.
Network OS (NOS)
- Runs on a server and provides capabilities for managing data, users, security, and applications for other computers (clients) on the network.
- Each computer has its own local OS.
- Example: Windows Server, Linux.
Mobile OS
- Designed specifically for mobile devices like smartphones and tablets.
- Focuses on power management, touch-screen interface, and wireless connectivity.
- Example: Android, iOS.
2. Shell and Types of Shell
The Shell is the command-line interpreter or graphical user interface (GUI) that provides an interface between the user and the operating system kernel. It is essentially the user interface to the OS.
Types of Shell (Command-Line Interpreters)
Primarily used in Unix/Linux systems:
- Bourne Shell (sh): The original shell, known for its simplicity and efficiency.
- C Shell (csh): Known for having a syntax similar to the C programming language, introducing features like command history.
- Korn Shell (ksh): A superset of Bourne shell, incorporating many features of the C shell, like job control and command aliases.
- BASH (Bourne-Again SHell): The most common default shell in Linux distributions. It is an enhanced version of the Bourne Shell, offering features like command-line editing and scripting capabilities.
3. System Calls and System Programs
System Calls
Definition: The programmatic interface to the services provided by the operating system. They are the only way a user program can request kernel services (e.g., I/O operations, process creation).
Mechanism: Typically available as assembly-language instructions (e.g., TRAP or INT instructions) that cause the CPU to switch from user mode to kernel mode to execute the privileged OS code.
Categories:
- Process Control: create process, terminate process, wait.
- File Management: open, read, write, close.
- Device Management: request device, read device, release device.
- Information Maintenance: get time, set time, get attributes.
System Programs (Utilities)
Definition: Programs that provide a convenient environment for program development and execution. They provide basic OS functions to users, usually implemented by linking to System Calls.
They sit above the System Calls and allow users to perform tasks without writing a program to invoke the necessary system calls directly.
Categories:
- File Manipulation: Programs to copy, delete, and list files (e.g.,
cp,rm,ls). - Status Information: Programs to get system date, time, available memory, etc. (e.g.,
date,who). - Programming Language Support: Compilers, assemblers, debuggers.
- Communication: Programs for sending messages between users (e.g., email clients, web browsers).
4. Two View OS Modes
This refers to the fundamental two views (or modes) of operation in an OS: User View and System View. The most critical distinction here is the Dual-Mode Operation (User Mode vs. Kernel Mode), which is essential for protection and security.
- User Mode: Non-privileged mode where application programs run. Access to sensitive hardware resources is restricted.
- Kernel Mode: Privileged mode where the OS core (kernel) executes. Allows full access to all hardware and system resources.
