Operating Systems Cheatsheet

1. Introduction to Operating Systems

Definition

  • An operating system (OS) is system software that manages computer hardware, software resources, and provides services for computer programs.

Key Functions

  • Process management
  • Memory management
  • File system management
  • Device management
  • Security and access control

2. Process Management

Processes

  • A process is an instance of a running program.

Process States

  • Running: The process is currently being executed.
  • Ready: The process is waiting to be assigned to a processor.
  • Blocked: The process is waiting for a resource or event.

Process Scheduling

  • Preemptive Scheduling: The operating system decides to interrupt the running process and start another.
  • Non-preemptive Scheduling: The currently running process voluntarily gives up the CPU.

3. Memory Management

Memory Hierarchy

  • Registers: Fastest memory directly accessible by the CPU.
  • Cache: Small but faster than main memory.
  • Main Memory (RAM): Holds data and instructions currently in use.
  • Secondary Storage: Slower but non-volatile (e.g., hard drives, SSDs).

Virtual Memory

  • Allows the execution of processes that are larger than physical memory.
  • Pages are swapped in and out of main memory as needed.

Memory Allocation

  • Static Allocation: Memory is allocated at compile time.
  • Dynamic Allocation: Memory is allocated at runtime.

4. File System Management

File Systems

  • Organize and provide access to data stored on storage devices.

File Operations

  • Create: Create a new file.
  • Read: Read data from a file.
  • Write: Write data to a file.
  • Delete: Remove a file.

File System Structures

  • File Control Block (FCB): Contains metadata about a file.
  • Directory Structure: Organizes files into a hierarchy.

5. Device Management

Device Drivers

  • Software that allows the operating system to communicate with hardware devices.

I/O Operations

  • Synchronous I/O: The process waits for the I/O operation to complete.
  • Asynchronous I/O: The process continues execution while the I/O operation is in progress.

Interrupt Handling

  • Hardware interrupts trigger the operating system to perform tasks.
  • Device drivers handle interrupts and perform necessary actions.

6. Security and Access Control

User Authentication

  • Verify the identity of users accessing the system.

Access Control

  • Determine what actions users are allowed to perform on the system and its resources.

Encryption

  • Protect sensitive data by converting it into a form that cannot be easily understood without authorization.

7. Types of Operating Systems

Single-Tasking vs. Multi-Tasking

  • Single-Tasking: Only one task can be executed at a time.
  • Multi-Tasking: Multiple tasks can be executed simultaneously.

Single-User vs. Multi-User

  • Single-User: Only one user can interact with the system at a time.
  • Multi-User: Multiple users can interact with the system simultaneously.

Real-Time Operating Systems (RTOS)

  • Designed to handle tasks with specific timing requirements.
  • Used in embedded systems, control systems, etc.

8. Examples of Operating Systems

Desktop/Laptop Operating Systems

  • Windows: Developed by Microsoft.
  • macOS: Developed by Apple.
  • Linux: Open-source OS kernel used in various distributions.

Mobile Operating Systems

  • Android: Developed by Google.
  • iOS: Developed by Apple.

Server Operating Systems

  • Linux: Commonly used for web servers, cloud computing, etc.
  • Windows Server: Developed by Microsoft for server environments.
Comments (0)