Operating Systems: Core Functions and Architecture

Posted by Anonymous and classified in Computers

Written on in English with a size of 10.41 KB

An Operating System (OS) acts as an intermediary or a bridge between computer hardware and the user. It manages hardware resources, provides a platform for application software to run, and ensures that the computer system operates efficiently and securely.

1. Core Functions and Characteristics

Major Functions of an OS

  • Processor Management (CPU Scheduling): Decides which process gets the processor when, and for how long.
  • Memory Management: Tracks primary memory (RAM), allocating and de-allocating blocks of memory to programs as they execute.
  • File Management: Organizes files into directories, navigation paths, and manages access permissions (read, write, execute).
  • Device Management: Communicates with hardware devices via their respective drivers, managing input/output devices smoothly.
  • Security & Error Detection: Protects data from unauthorized access using passwords and firewalls, and monitors the system for crashes or hardware failures.

Key Characteristics

  • Concurrency: The ability to handle multiple tasks or processes at the same time.
  • Resource Sharing: Dynamically sharing hardware (CPU, memory, printers) among multiple users or applications.
  • Abstraction: Hiding the complex, messy details of the hardware from the user and providing a simple user interface instead.

2. Historical Evolution of Operating Systems

Operating systems evolved alongside hardware generations to maximize computing efficiency:

  • First Generation (1940s–1950s) – No OS: Computers were massive machines programmed via plugboards or punch cards. Programs directly controlled the hardware; there was no operating system.
  • Second Generation (1950s–1960s) – Batch Systems: To reduce the massive setup time between jobs, the Batch Processing system was introduced. Jobs were grouped on magnetic tapes and run together.
  • Third Generation (1960s–1970s) – Multiprogramming: Introduction of Integrated Circuits (ICs) allowed multiple jobs to sit in memory at once. If one job waited for I/O, the CPU switched to another.
  • Fourth Generation (1970s–Present) – Personal Computers & Networks: The advent of microprocessors led to personal computing (Windows, macOS) and highly sophisticated distributed/network operating systems.

3. Operating System Structure

The internal structure of an OS determines how its core components interact with each other and the hardware.

Monolithic Structure

  • The entire OS runs as a single, large program in a single address space (Kernel space).
  • Pros: Highly efficient and fast because components can communicate directly.
  • Cons: If one part of the kernel crashes (like a buggy driver), the entire system crashes.

Layered Structure

  • The OS is broken down into a number of layers (levels). Layer 0 is the hardware, and the highest layer is the user interface.
  • Each layer uses functions only from the layers below it. This makes debugging much easier, though it can introduce performance overhead.

Microkernel Structure

  • Removes all non-essential components from the kernel and implements them as system and user-level programs (like file systems and device drivers).
  • Pros: Highly secure and modular. If a driver crashes, it doesn't bring down the whole kernel.
  • Cons: Slower performance due to increased communication overhead between the modules.

4. Types of Operating Systems

A. Batch Processing OS

The user does not interact with the computer directly. Instead, a user prepares their job (program, data, and control cards) and submits it to a computer operator. The operator sorts the jobs into "batches" with similar requirements to speed up processing.

  • Best for: Payroll systems, bank statements, automated billing.

B. Multiprogramming OS

In a simple system, the CPU sits idle while a program waits for an input/output (I/O) operation. Multiprogramming keeps multiple jobs in main memory simultaneously. When one job waits for I/O, the OS switches the CPU to another job, ensuring the processor is rarely idle.

C. Multiprocessing OS

While multiprogramming switches between jobs on a single CPU, Multiprocessing uses two or more physical CPUs within a single computer system. These CPUs share the same memory, bus, and peripherals, allowing different programs (or different parts of the same program) to run at the exact same time.

  • Best for: High-performance computing, video editing, data analysis.

D. Real-Time OS (RTOS)

An RTOS is used when rigid time requirements are placed on the operation of a processor. The defining feature is that the system must respond to inputs within a strict, predictable time limit. A delay in processing is considered a total system failure.

  • Hard Real-Time: Missing a deadline results in catastrophic failure (e.g., missile guidance systems, car airbags, pacemakers).
  • Soft Real-Time: Missing a deadline causes performance degradation but isn't catastrophic (e.g., video streaming, live audio processing).

5. Operating System Services

An OS provides an environment for the execution of programs and ensures that both the user and the system operate efficiently. These services can be split into two main categories:

Services for the User/Programmer

  • Program Execution: The system must be able to load a program into memory, run it, and terminate its execution.
  • I/O Operations: Since running programs often require input and output, the OS provides an efficient way to access these devices, hiding complex hardware controls.
  • File-System Manipulation: Programs need to read, write, create, delete, search, and manage permissions for files and directories.
  • Communications: Processes often need to share information via Shared Memory or Message Passing.
  • Error Detection: The OS constantly monitors the system for potential errors and takes appropriate action to protect the system.

Services for System Efficiency and Resource Sharing

  • Resource Allocation: When multiple users or jobs are running concurrently, resources must be allocated dynamically.
  • Accounting: The OS keeps track of which users use which resources, vital for monitoring and billing.
  • Protection and Security: Ensures that all access to system resources is controlled and that concurrent processes do not interfere with each other.

6. Operating System Interface

Users and programmers don't interact with the hardware directly; they use an interface provided by the OS. There are three primary types:

  • Command-Line Interface (CLI): A text-based interface where users type command strings directly into a terminal.
  • Graphical User Interface (GUI): A visual interface using a windowing system with a pointing device (e.g., Windows Desktop, macOS Finder).
  • Touch-Screen Interface: A modern subset of GUI designed for smartphones and tablets, relying on gestures.

7. System Calls

System Calls provide the fundamental interface between a running program and the operating system. When a user program needs an OS service, it executes a system call.

The Dual-Mode Mechanism

To protect the system from malicious or buggy software, the CPU runs in two distinct modes:

  1. User Mode: Restricted access. Application programs run here.
  2. Kernel Mode (Supervisor/System Mode): Unrestricted access to hardware. The OS kernel runs here.

When a program invokes a system call, a trap (software interrupt) occurs, switching the system from User Mode to Kernel Mode.

Types of System Calls

CategoryDescriptionExamples (Windows vs. Unix)
Process ControlEnd, abort, create, or terminate processes; allocate/free memory.CreateProcess() vs. fork()
File ManagementCreate, delete, open, close, read, and write files.CreateFile(), ReadFile() vs. open(), read()
Device ManagementRequest device, release device, read, write, get/set device attributes.SetConsoleMode() vs. ioctl()
Information MaintenanceGet/set time, date, or system data; transfer process metadata.GetSystemTime() vs. time()
CommunicationsCreate/delete communication connections, send/receive messages.CreatePipe() vs. pipe()

8. System Programs

System Programs (also known as system utilities) provide a convenient environment for program development and execution. They are pre-installed user-facing tools built on top of system calls.

  • File Management: Programs to create, delete, copy, rename, print, and list files and directories.
  • Status Information: Tools that query the system for the date, time, available memory, disk space, or current performance statistics.
  • File Modification: Text editors used to create and modify the content of files.
  • Programming-Language Support: Compilers, assemblers, debuggers, and interpreters.
  • Program Loading and Execution: Loaders, linkage editors, and overlay loaders handle this process.
  • Background Services: Often called daemons (Linux) or services (Windows), these programs run silently in the background to handle tasks like network connections or system monitoring.

Related entries: