Docsity

Comprehensive Guide to Operating Systems, Cheat Sheet of Computer science

Partial preview of the text

Download Comprehensive Guide to Operating Systems and more Cheat Sheet Computer science in PDF only on Docsity!

Deep Dive into Operating Systems

A Comprehensive Guide for Beginners

1 .Introduction to Operating Systems

An Operating System (OS) is system software that serves as an interface between the user and the computer hardware. It manages hardware and software resources, provides a user interface, and allows execution of programs. Examples: Windows, Linux, Android, macOS

2.Functions of an Operating System

  • Process Management: Handles process creation, scheduling, and termination.
  • Memory Management: Allocates and deallocates memory to programs.
  • File System Management: Manages file operations and organization.
  • Device Management: Controls I/O devices via drivers.
  • Security: Protects system resources from unauthorized access.
  • User Interface: Provides CLI (Command Line Interface) or GUI (Graphical User Interface).

3.Types of Operating Systems

Batch OS: Executes batches of jobs with minimal user interaction. Time-Sharing OS: Allows multiple users to access the system simultaneously. Distributed OS: Manages multiple systems connected in a network. Real-Time OS: Used in embedded systems with strict timing. Network OS: Enables resource sharing over a network.

4.Process Management

A process is a running instance of a program. Process States: New - > Ready - > Running - > Waiting - > Terminated Scheduling Algorithms:

  • FCFS (First Come First Serve)
  • SJF (Shortest Job First)

8.Real-Life OS Use Cases

  • Windows: General-purpose OS for PCs.
  • Linux: Open-source OS for servers/developers.
  • Android: Mobile OS based on Linux.
  • RTOS: Used in robotics, medical devices, and industrial systems.

9. Major Components of an Operating System

An Operating System is made up of several core components, each with a specific role:

  1. Kernel: The core part that directly manages hardware (CPU, memory, devices).
  2. Process Manager: Handles creation, scheduling, and termination of processes.
  3. Memory Manager: Manages RAM allocation and virtual memory usage.
  4. File System Manager: Organizes files and directories, and handles read/write operations.
  5. Device Manager: Controls I/O devices using drivers and manages communication between hardware and OS. 6. User Interface: Provides interaction with the system through GUI or CLI.

10 .Additional Questions and Answers

Q1. What is an Operating System? Ans : A system software that manages hardware resources and provides services to software. Q2. Name four types of OS. Ans : Batch OS, Time-Sharing OS, Real-Time OS, Distributed OS.

Q3. What is Virtual Memory? Ans : A memory management technique that uses part of the hard drive as RAM. Q4. What are the states of a process? Ans : New, Ready, Running, Waiting, Terminated. Q5. Explain Banker's Algorithm. Ans : A deadlock avoidance algorithm that checks safe resource allocation before executing a process. Q6. What is a Kernel? Ans: The kernel is the core part of the OS that manages system resources like CPU, memory, and devices. It operates in a privileged mode and communicates between hardware and software. Q 7. What is the function of Device Management in an OS? Ans: It controls all input/output devices through drivers, managing communication between devices and system components. Q 8. What is a deadlock, and how can it be avoided? Ans:

  • Deadlock: Occurs when processes wait indefinitely for resources locked by each other.
  • Avoidance: Use techniques like Banker's Algorithm to ensure safe resource allocation. Q 9. How does the OS handle memory management? Ans : The OS allocates and deallocates memory using techniques like contiguous allocation, paging, segmentation, and virtual memory. Q1 0. What are the different system calls used in an Operating System? Ans: System calls include:
  1. Process Control: Fork, exit
  2. File Management: Open, read, write
  3. Device Management: Input/output operations
  4. Information Maintenance: Get/set system data