Understanding the fundamentals of operating system structures is crucial for efficient program execution and resource management.
Operating System Services
User and Operating System Interface
System Calls
System Programs
Operating System Structures
Provides execution environment for programs and services needed by users and other system programs.
Types of Services:
User Interface:
Command-Line Interface (CLI)
Batch processing
Graphical User Interface (GUI)
Program Execution: Load and run programs.
I/O Operations: Facilitate interaction with I/O devices.
File-System Manipulation: Aid in reading/writing files.
Communications: Enable exchange of information between processes.
Error Detection: Detect and correct errors for reliability.
Resource Allocation: Distribute resources like CPU cycles to multiple jobs.
Accounting: Track resource usage for billing.
Protection and Security: Control access to system resources and protect from unauthorized access.
Allows direct command entry.
Implemented in the kernel or via system programs.
Examples include shells like:
C Shell
Bourne Shell
Functions as follows:
Fetches user command and executes it.
Loads programs into memory for execution.
Manages multiple user jobs in sequence.
Executes jobs and provides output after processing.
Offers a user-friendly interface with a desktop layout.
Uses icons to represent files and programs.
Developed at Xerox PARC and now includes:
Microsoft Windows (with CLI)
Apple Mac OS X (Aqua interface with UNIX kernel)
Various UNIX/Linux distributions (CDE, KDE, GNOME).
Programmatic interface to OS services, often using C or C++.
Accessed via higher-level APIs rather than direct calls.
Common APIs include:
Win32 API: For Windows systems
POSIX API: For POSIX-compliant systems
Java API: For the Java Virtual Machine (JVM).
Sequence includes:
Acquire input/output file names.
Open input file and check existence.
Create output file while checking for pre-existence.
Read from input and write to output until completion.
Process Control:
Create/terminate processes, manage memory, signal events.
File Manipulation:
Create, read, write, delete files/directories;
Move and copy operations.
Device Management:
Request and release device resources, perform read/write operations.
Information Maintenance:
Acquire system-related info like user number, memory status, etc.
Communications:
Manage connections, send/read messages.
Protection:
Manage user access permissions.
Provide an environment for program execution and development.
Include:
File Manipulation Tools: For creating, renaming, listing files.
Status Information Tools: Retrieve system information.
File Modification Tools: Text editors and file search commands.
Programming Language Support: Compilers, assemblers, debuggers.
Background Services: Perform system maintenance tasks like disk checking.
Application Programs: Run user applications, not part of OS but interact with it.
General-purpose OS structures vary from simple to complex designs:
Simple Structure: Non-modular, as seen in MS-DOS.
Layered Structure: Layers built on lower layers; e.g., Windows NT.
Microkernel Structure: Minimally sized kernel with user space for services; e.g., Minix 3.
Modular Structure: Loadable kernel modules, e.g., in Linux.
Hybrid Structure: Combines multiple models; e.g., Mac OS X, Linux.
Example: MS-DOS is a compact, non-modular system with functionality tightly integrated.
Example: Windows NT organizes the OS into layered components for modular design.
Example: Minix 3 emphasizes smaller kernels and message passing between components.
Adopts object-oriented principles, allowing core components to be separate and loadable as needed.
Combines features from various modalities for performance and security optimizations across different platforms like Linux and Mac OS X, enhancing usability.
iOS: Based on Mac OS X; functional adaptations for mobile hardware.
Android: Open-source; Linux kernel foundation with its unique features, runtime environment, and application frameworks.