Operating Systems: Core Concepts and Functions

An Operating System (OS) acts as an intermediary between computer applications and the underlying hardware.

Key Functions of an Operating System

  • Virtual Machine Provision: Creates a virtual environment, allowing users to run programs without being concerned about the complexities of the underlying hardware and software.
  • Resource Management: Efficiently manages computer resources such as CPU, memory, and peripherals.

The Kernel: The Heart of the OS

The kernel is the essential core of a computer’s operating system. It comprises:

  • Initial program loader
  • Scheduler
  • CPU manager
  • Peripheral manager
  • Memory manager
  • Inter-process communication manager
  • File manager

The Shell: User-OS Interface

The shell is responsible for translating user commands, written in a programming language, into machine language that the computer can understand and execute.

Types of Operating Systems

Monoprogramming

In a monoprogramming system, only one task can be performed at a time. When a program enters the process, it takes over the CPU and I/O until it finishes.

Multiprogramming

Multiprogramming allows the CPU to switch between multiple tasks. For example, while one program is waiting for an I/O operation to complete, the CPU can execute another program, improving overall efficiency.

Real-Time Systems

Real-time systems are characterized by very rigid execution times for operations or data flows.

  • Real-time Hardware: Typically housed in non-volatile memory like EPROM.
  • Real-time Software: Used for less critical tasks and can handle task prioritization.

Multiprocessor Systems

Multiprocessor systems contain more than one CPU.

  • Strongly Coupled: Processors share memory and clock.
  • Symmetric Multiprocessor Systems: Peer-to-peer or local networks where each computer has a copy of the OS and shares equal importance.
  • Asymmetric Distributed Systems: Each processor has a different task.

Operating System Services

  • Program execution
  • I/O operations
  • File system manipulation
  • Error detection

Multi-User OS Responsibilities

  • Resource allocation to different users
  • Accounting
  • Protection

System Calls (Syscalls)

System calls provide an interface between a program and the operating system. They are typically implemented using machine language instructions and are grouped into three categories:

  • Process and Task Control:
    • Normal or abnormal termination
    • Loading or executing another program
    • Creating and killing processes
    • Getting and setting process attributes
    • Waiting for a specific time or event
  • File Manipulation:
    • Creating and deleting files
    • Opening and closing files
    • Reading, writing, and repositioning files
    • Getting and setting file attributes
  • Device Handling:
    • Requesting and releasing devices
    • Reading, writing, and resetting devices
    • Getting and setting device attributes
  • Information Maintenance:
    • Obtaining and setting the date and time
    • Retrieving system data
    • Setting attributes of processes, files, or devices

System Programs

System programs are a set of frequently used programs that facilitate the execution of other programs. They are divided into:

  • File Manipulation: Creating, deleting, copying, renaming, printing, and listing files and directories.
  • Status Information: Requesting date and time, amount of available memory or disk space.
  • File Modification: Basic text editors to modify files.
  • Programming Language Support: Compilers, interpreters, and assemblers that support high-level languages.
  • Application Software: Programs often used, such as calculators, text editors, graphics viewers, and browsers.

Command Interpreter

The command interpreter captures a command entered by the user and executes it.

Concurrent Processing

Concurrent processing refers to the CPU’s ability to execute a large number of programs simultaneously, enhancing system performance and responsiveness.