Basic Components and Functional Modules of OS

Process Management

Operating system's core function is Process Management, which is responsible for creating, scheduling, and terminating processes, ensuring multiple tasks can run efficiently.

  • Process States:Processes typically exist in Ready, Running, Blocked, or Terminate states, and the operating system coordinates task execution through state transitions.
  • Scheduling Algorithms:Includes First-Come, First-Served (FCFS), Shortest Job First (SJF), and Round-Robin (RR) algorithms, determining CPU allocation order.
  • Synchronization and Communication:Achieved through semaphores, pipes, and message queues, enabling data sharing and collaboration between processes.

Memory Management

Memory Management is a critical module of the operating system, primarily responsible for memory allocation and deallocation.

  • Virtual Memory:Through page or segment-based management, physical memory is separated from logical memory, solving memory shortages.
  • Memory Protection:Utilizes segment-page structure to prevent program from illegally accessing memory regions, enhancing system security.
  • Page Replacement:When physical memory is insufficient, the operating system swaps rarely used pages to disk, freeing space for new processes.

File System

File System is the core component of the operating system, responsible for organizing, storing, and retrieving data.

  • Directory Structure:Files are organized in a tree structure, supporting multi-level directories and path locating.
  • File Allocation:Uses linked list, indexed, or hash table methods to optimize storage space utilization.
  • Metadata Management:Records file attributes (size, permissions, timestamps) and maintains file directory tables.

Device Management

Device Management module coordinates hardware resources, ensuring efficient and reliable input/output operations.

  • Device Classification:Includes character devices (e.g., keyboard) and block devices (e.g., hard disk) and network devices (e.g., network card).
  • Driver Programs:Provide interfaces between hardware and the operating system, enabling communication.
  • I/O Scheduling:Reduces I/O delays through buffer zones and disk scheduling algorithms (e.g., elevator algorithm).

User Interface

User Interface is the bridge between humans and computers, divided into command-line and graphical user interface (GUI) forms.

  • Command-Line Interface (CLI):Controls the system through input commands, such as ls and cd.
  • Graphical User Interface (GUI):Provides visual operations via window systems (e.g., X Window, Windows API).
  • Security Mechanisms:Protects the system through permission control, user authentication, and encryption technologies.

Network and Security

Network Management module supports communication between the system and external entities, while Security Module ensures system safety from attacks.

  • Network Protocols:Implement TCP/IP, UDP, etc., for data transmission and routing.
  • Firewalls:Filter network traffic through rules to block illegal access.
  • Encryption Technologies:Use symmetric/ asymmetric encryption algorithms to protect data integrity and privacy.

System Calls

System Calls are the interface between user programs and the operating system, providing low-level functions.

  • Common Calls:Such as fork() to create processes, open() to open files, and read() to read data.
  • Call Methods:Implemented through system call interfaces (e.g., Linux's sys_call), enabling user-mode to kernel-mode switching.
  • Permission Control:System calls require user permission validation to prevent malicious operations.