TUpapers logo TUpapers.com

Explore TUpapers

Study materials and tools in one place.

  • Dashboard
  • Blog
  • Search
  • About

Follow us

TUpapers on Facebook
TUpapers on Instagram
Contact TUpapers on WhatsApp
TUpapers subreddit on Reddit
Student Dashboard Student Dashboard
TUpapers logo TUpapers.com
  • Blog
  • About

Support Us

Your support helps us for further development and maintenance of site and resources!

Bank QR code for payment
eSewa QR code for payment
Khalti QR code for payment

The best way to support TUpapers is by purchasing a Premium Suscription or Notes Every purchase directly funds new features, better study resources, and platform maintenance.

On this chapter

Operating System Overview

All Chapters

Dashboard

Select a chapter to start reading

Operating System Notes | BITM Fourth Semester | TU Papers

1 Chapter 1 Preview

No preview available.

Notes for this subject are coming soon — check back later.

Student Dashboard

Continue Reading

Get full notes inside the dashboard, along with other study tools.

Unit 1: Operating System Overview [4 Hours]

An Operating System (OS) is the foundational software layer that sits between computer hardware and the user. Without it, hardware is a collection of circuits with no way to run programs. This unit covers what an OS is, how it evolved, the different types available, its core functions, how programs communicate with it through system calls, how it organizes itself internally, and the role of the kernel and shell in making all of this work.

1.1 Introduction to Operating System

Definition

An Operating System (OS) is system software that manages computer hardware resources and provides services for application programs and users to interact with the machine.


The OS is the translator that stands between you and the hardware. When you click "Save" on a document, you never talk directly to the hard disk, the memory chip, or the processor. The OS intercepts that request, coordinates the hardware, and makes it happen. Without it, every program would have to contain its own code for managing memory, talking to disks, and handling keyboards, which would make software impossibly complex to build.

Detailed Explanation

A computer system can be divided into four layers:

  • Hardware: the physical components, Central Processing Unit (CPU), memory, disks, input/output devices.
  • Operating System: controls and coordinates use of hardware among various application programs and users.
  • Application Programs: word processors, browsers, compilers, games — software that uses the OS to access hardware.
  • Users: people or other machines interacting with the application layer.

The OS serves two primary roles simultaneously:

  • Resource Manager: the OS allocates processor time, memory space, file storage, and input/output devices among competing processes efficiently and fairly.
  • Extended Machine (Virtual Machine): the OS hides the complexity of hardware behind a clean, usable interface. From an application's perspective, it talks to the OS, not to raw circuits.

Goals of an Operating System

  • Convenience: makes the computer easier to use by hiding low-level hardware details.
  • Efficiency: ensures hardware resources are used optimally, reducing waste and idle time.
  • Ability to evolve: allows new system functions to be developed and added without interfering with existing ones.

Let's Clarify

Consider a busy restaurant kitchen. Customers (users) place orders through waiters (applications). The head chef (OS) receives all orders, assigns tasks to cooks (CPU), allocates ingredients from the pantry (memory), and coordinates equipment like ovens and stoves (hardware devices). Customers never walk into the kitchen and operate the equipment themselves. The chef ensures every order gets the right resources without chaos.

Summary

  • An OS is system software that manages hardware resources and provides an interface between users/applications and hardware.
  • It acts as both a resource manager (allocating CPU, memory, I/O) and an extended machine (abstracting hardware complexity).
  • Key goals: convenience, efficiency, and flexibility to evolve.
  • Without an OS, every application would need to directly manage hardware, making software development impractical.

Test Yourself

  1. What is an operating system? What are its two main roles?
  2. Why is the OS called a resource manager?
  3. Describe the layered structure of a computer system.

Hints:

  1. System software managing hardware; two roles: resource manager (allocates CPU, memory, I/O) and extended machine (abstracts hardware with a clean interface).
  2. Because it allocates and manages shared resources (CPU time, memory, storage, I/O) among competing processes and users.
  3. Four layers from bottom to top: Hardware → OS → Application Programs → Users. Each layer uses services of the one below it.

1.2 Evolution of Operating System

Definition

The evolution of operating systems describes how OS design has progressed through distinct generations, driven by changes in hardware technology, increasing system complexity, and the growing demands of users and applications.


Early computers had no OS at all. You fed instructions directly to the machine through physical switches or punched cards. Over decades, the OS evolved from a simple batch controller to a sophisticated multi-user, networked, real-time software platform. Each generation solved the problems the previous one created.

Detailed Explanation

Generation 1 (1945–1955): Vacuum Tubes, No OS

Computers used vacuum tubes and were operated directly by their designers. Programs were written in machine language or plugged in via physical wiring (plugboards). There was no operating system. A single user had full use of the machine. Jobs were run one at a time, and a significant amount of time was wasted setting up the next job manually.

Generation 2 (1955–1965): Transistors and Batch Systems

Transistors replaced vacuum tubes, making computers smaller and more reliable. Batch processing systems emerged to solve the idle-time problem. Jobs were grouped (batched) on punched cards, fed to the computer sequentially, and output collected as a batch. A simple resident monitor (the earliest form of an OS) read jobs from cards and transferred control to each program automatically. No user interaction was possible during execution.

Key limitation: while a job waited for Input/Output (I/O) operations, the CPU sat completely idle.

Generation 3 (1965–1980): Integrated Circuits and Multiprogramming

Integrated circuits (ICs) made hardware dramatically cheaper and faster. Two critical techniques emerged:

  • Multiprogramming: multiple jobs are loaded into memory simultaneously. While one job waits for I/O, the CPU switches to another job. CPU utilization improves significantly.
  • Time-sharing (Multitasking): each user gets a small slice of CPU time in rapid rotation. The system responds so quickly that each user feels they have a dedicated machine. UNIX, one of the most influential OS designs in history, was born in this era (1969–1970).

Generation 4 (1980–Present): Personal Computers and GUIs

Very Large Scale Integration (VLSI) circuits led to affordable personal computers (PCs). Operating systems moved from text-only command-line interfaces to Graphical User Interfaces (GUIs), pioneered by Xerox PARC and popularized by Apple Macintosh (1984) and later Microsoft Windows. Networks, distributed systems, and eventually mobile operating systems (Android, iOS) expanded the OS domain further.

GenerationEraHardwareKey OS Feature
1st1945–1955Vacuum tubesNo OS; machine language programming
2nd1955–1965TransistorsBatch processing, resident monitor
3rd1965–1980Integrated circuitsMultiprogramming, time-sharing, UNIX
4th1980–presentVLSI, microprocessorsGUI, personal computers, networking, mobile OS

Summary

  • OS evolution spans four generations, each driven by a hardware breakthrough that enabled a new software paradigm.
  • Generation 2 introduced batch systems to eliminate manual job setup; Generation 3 solved CPU idle time with multiprogramming.
  • Time-sharing gave the illusion of simultaneous, dedicated access to each user.
  • Generation 4 brought GUIs, personal computing, and networked/mobile systems.

Test Yourself

  1. What problem did batch processing solve, and what new problem did it create?
  2. How does multiprogramming improve CPU utilization?
  3. Trace the evolution of operating systems through four generations.

Hints:

  1. Batch processing eliminated manual job setup time (setup idle time). New problem: CPU still sat idle during I/O operations.
  2. Multiprogramming loads multiple jobs in memory. When one job waits for I/O, the CPU immediately switches to another job, keeping the CPU busy.
  3. Gen 1: no OS, vacuum tubes; Gen 2: batch monitor, transistors; Gen 3: multiprogramming + time-sharing, ICs, UNIX; Gen 4: GUI, VLSI, personal computers and mobile OS.

1.3 Types of Operating System

Definition

Types of operating systems are the different categories into which OS designs are classified based on how they manage processes, handle user interaction, respond to time constraints, and support the number and nature of users they serve simultaneously.


Not every computer has the same job. A phone needs to respond to your touch instantly. A hospital's vital-signs monitor must respond within milliseconds or someone could die. A university server must handle hundreds of students at once. Different requirements have produced different OS types, each with design priorities that fit its environment.

Detailed Explanation

1. Batch Operating System

Jobs are collected, grouped into batches, and executed sequentially without user interaction during execution. The OS automatically moves from one job to the next. Used in payroll processing, bank statements, and other high-volume, repetitive tasks.

Advantages: efficient for large volumes of similar jobs; good CPU utilization for long-running tasks.

Disadvantages: no real-time feedback; if a job has an error, the user only discovers it after the full batch runs.

2. Time-Sharing (Multitasking) Operating System

Each user is given a small unit of CPU time called a time quantum or time slice. The CPU switches between users so rapidly that each user feels they have exclusive access. Example: early UNIX systems supporting multiple terminals.

Advantages: interactive response for multiple users simultaneously; efficient resource sharing.

Disadvantages: complex scheduling logic; security concerns when multiple users share the same machine.

3. Distributed Operating System

A Distributed Operating System (DOS) manages a group of independent computers networked together, making them appear as a single coherent system to the user. Tasks are split and processed across multiple machines. Examples: Google's infrastructure, cluster computing systems.

Advantages: resource sharing across machines; fault tolerance (if one node fails, others continue); scalability.

Disadvantages: complex to design; network failures can affect the entire system; security across nodes is harder.

4. Real-Time Operating System (RTOS)

A Real-Time Operating System (RTOS) guarantees that specific tasks are completed within strict, predefined time deadlines. Used in systems where delayed response can cause failure or harm.

  • Hard RTOS: missing a deadline is considered a total system failure. Examples: aircraft flight control, anti-lock braking systems (ABS), cardiac pacemakers.
  • Soft RTOS: missing an occasional deadline is acceptable but undesirable. Examples: video streaming, online gaming.

5. Multiprogramming Operating System

Multiple programs reside in memory simultaneously. When the running program waits for I/O, the OS switches the CPU to another program. The key goal is maximizing CPU utilization.

6. Multiprocessing Operating System

Uses two or more CPUs (processors) within a single computer system. Tasks are distributed across multiple processors for parallel execution, improving throughput and reliability. If one processor fails, others continue functioning.

7. Network Operating System (NOS)

A Network Operating System (NOS) runs on a server and provides services (file sharing, printer sharing, authentication) to client computers over a network. The OS on each computer remains independent; the NOS coordinates shared access. Examples: Novell NetWare, Windows Server.

TypeKey FeaturePrimary UseExample
BatchNo interaction; sequential job executionPayroll, billingIBM OS/360
Time-sharingCPU time slices per userMulti-user terminalsUNIX (early)
DistributedMultiple machines as one systemCluster computingGoogle infrastructure
Real-Time (RTOS)Strict deadline guaranteesEmbedded, safety-criticalVxWorks, FreeRTOS
MultiprogrammingMultiple programs in memory; CPU switches on I/OGeneral-purposeUNIX, Linux
MultiprocessingMultiple CPUs; parallel processingHigh-performance computingLinux SMP, Windows Server
Network (NOS)Centralized server shares resources to clientsCorporate networksWindows Server, Novell NetWare

Common Mistake

Students frequently confuse multiprogramming and multiprocessing. Multiprogramming involves one CPU switching between multiple programs to stay busy (concurrency through interleaving). Multiprocessing involves multiple CPUs executing different programs at the same time (true parallelism). A single-CPU computer can be multiprogrammed; true multiprocessing requires physically separate processors.

Summary

  • OS types reflect the different environments computers operate in: interactive, batch, distributed, real-time, networked.
  • Batch OS: no interaction, sequential; Time-sharing: CPU slices per user; Distributed: networked machines as one system.
  • RTOS guarantees deadlines: hard RTOS (no missed deadlines allowed), soft RTOS (occasional misses acceptable).
  • Multiprogramming maximizes one CPU's use; multiprocessing uses multiple CPUs for true parallel execution.

Test Yourself

  1. Differentiate between multiprogramming and multiprocessing operating systems.
  2. What is a real-time operating system? Distinguish between hard and soft RTOS with examples.
  3. What is a distributed operating system? State its advantages.
  4. List five types of operating systems with one distinguishing characteristic each.

Hints:

  1. Multiprogramming: one CPU switches between programs on I/O wait (concurrency). Multiprocessing: multiple CPUs run programs in parallel simultaneously. Key difference: number of physical CPUs and true parallelism.
  2. RTOS guarantees completion within strict time bounds. Hard RTOS: any missed deadline = system failure (pacemaker, ABS brakes). Soft RTOS: occasional deadline misses acceptable (video streaming).
  3. Distributed OS: multiple independent networked computers appear as one unified system. Advantages: resource sharing, fault tolerance, scalability.
  4. Any five from: Batch (sequential, no interaction), Time-sharing (CPU time slices), RTOS (deadline guarantees), Distributed (multiple machines as one), Multiprocessing (multiple CPUs), NOS (server-based resource sharing).

1.4 Functions of Operating System

Definition

The functions of an operating system are the core responsibilities the OS carries out to manage hardware resources, coordinate running programs, protect data, and provide a usable environment for users and applications.


If the OS is the manager of a company, its functions are its job description. It decides who uses the CPU and when, allocates memory to each running program, controls access to files and devices, handles errors, and ensures the security of the whole system.

Detailed Explanation

1. Process Management

A process is a program in execution. The OS creates, schedules, suspends, resumes, and terminates processes. It handles:

  • CPU Scheduling: deciding which process gets to run next and for how long.
  • Process Synchronization: ensuring processes that share data don't corrupt each other's work.
  • Deadlock Handling: detecting and resolving situations where processes are permanently blocked waiting for each other.

2. Memory Management

The OS tracks every byte of main memory (Random Access Memory, or RAM). It decides which process gets which memory locations, allocates memory when a process starts, and reclaims it when a process ends. Key tasks include protecting one process's memory from another and providing virtual memory when physical RAM is insufficient.

3. File System Management

The OS organizes data on storage devices into files and directories. It handles creating, reading, writing, and deleting files, enforcing access permissions, and managing disk space allocation. The file system abstraction means programs deal with logical file names rather than physical disk sectors.

4. Device Management (I/O Management)

The OS communicates with hardware devices (keyboard, mouse, printer, disk drives, network cards) through programs called device drivers. It provides a uniform interface so application programs don't need to contain device-specific code. The OS also manages device queues and handles interrupts generated by devices signaling they need attention.

5. Security and Protection

The OS protects system resources from unauthorized access. This includes user authentication (verifying identity), access control (determining what each user or process may do), and protection of one process's memory from interference by another. It also defends against malicious software.

6. User Interface (UI)

The OS provides a way for users to interact with the computer, either through a Command Line Interface (CLI) (the user types text commands) or a Graphical User Interface (GUI) (icons, windows, menus). The shell provides the CLI; the desktop environment provides the GUI.

7. Networking

Modern OS designs include network protocol support, enabling computers to communicate over local networks or the internet. The OS handles routing, socket management, and network device interfaces.

8. Error Detection and Handling

The OS continuously monitors the computer for errors in the CPU, memory, I/O devices, and software. When an error is detected, the OS takes appropriate action: notifying the user, terminating the offending process, or triggering a recovery mechanism.

FunctionWhat the OS managesKey Operation
Process ManagementRunning programs (processes)Scheduling, synchronization, deadlock handling
Memory ManagementRAM allocationAllocation, protection, virtual memory
File System ManagementStorage organizationCreate, read, write, delete files; permissions
Device ManagementHardware I/O devicesDevice drivers, interrupt handling, queuing
Security and ProtectionAccess rightsAuthentication, access control, isolation
User InterfaceUser interactionCLI or GUI
NetworkingCommunicationProtocols, socket management
Error HandlingSystem healthDetection, notification, recovery

Summary

  • The OS manages processes (CPU scheduling, synchronization), memory (allocation, virtual memory), and file systems (storage abstraction and permissions).
  • Device management uses drivers to provide uniform interfaces to diverse hardware; error handling keeps the system stable.
  • Security and protection isolate users and processes; the UI (CLI or GUI) is what the user directly interacts with.
  • All functions work together to deliver a stable, efficient, and usable computing environment.

Test Yourself

  1. List and briefly explain five functions of an operating system.
  2. How does the OS perform memory management? Why is it necessary?
  3. What is the role of the OS in device management?

Hints:

  1. Any five: Process management (schedule/sync processes), Memory management (allocate/protect RAM), File system (organize storage), Device management (drivers + I/O), Security (auth + access control), UI (CLI/GUI), Networking (protocols), Error handling (detect + recover).
  2. OS tracks all RAM, allocates memory to each process, prevents one process accessing another's space, and provides virtual memory when RAM is full. Necessary because multiple processes compete for limited physical memory.
  3. OS uses device drivers to communicate with hardware, provides a uniform application interface, manages device queues so multiple processes can share a printer or disk fairly, and handles hardware interrupts.

1.5 System Call

Definition

A system call is a programmatic interface that allows a user-level application to request a service from the operating system's kernel, such as reading a file, creating a process, or allocating memory.


Every program runs in a restricted zone where it cannot directly touch hardware or critical system resources. When a program needs something beyond its own sandbox (like writing a file to disk), it makes a system call: a controlled, formal request handed up to the OS kernel, which performs the operation on the program's behalf and returns the result.

Detailed Explanation

Modern CPUs operate in (at least) two privilege modes:

  • User mode: where normal application programs run. Direct hardware access is forbidden. Instructions that could damage the system are disabled.
  • Kernel mode (Supervisor mode): where the OS kernel runs. All hardware instructions are permitted.

A system call is the boundary crossing from user mode to kernel mode. The sequence is:

Application calls system call function → CPU switches to kernel mode → Kernel validates the request → Kernel performs the operation → Result returned to application → CPU switches back to user mode

Categories of System Calls

CategoryPurposeExamples (UNIX/Linux)
Process ControlCreate, terminate, manage processesfork(), exec(), exit(), wait()
File ManagementCreate, open, read, write, close filesopen(), read(), write(), close()
Device ManagementRequest and release devices; read/writeioctl(), read(), write()
Information MaintenanceGet/set system data (time, date, process info)getpid(), alarm(), time()
CommunicationCreate and manage inter-process communicationpipe(), socket(), send(), recv()
ProtectionSet permissions and access rightschmod(), chown(), umask()

Let's Clarify

System calls are the formal service counters at a government office. Citizens (application programs) cannot walk into the back rooms (kernel) and help themselves to records. They must go to the service counter (system call interface), submit a request form (parameters), and wait while a government employee (kernel) retrieves the data and hands it back through the counter window. The back room stays secure; the citizen gets the service.

Common Mistake

Students often confuse system calls with ordinary function calls. An ordinary function call (like calling a math library function) executes in user mode within the program's own code. A system call crosses the privilege boundary into kernel mode. The distinction matters because system calls involve a mode switch, which has overhead, and the kernel independently validates and controls what the call can do.

Summary

  • A system call is an application's request to the OS kernel for a privileged service it cannot perform in user mode.
  • It triggers a mode switch: user mode → kernel mode → user mode, with the kernel performing the requested operation.
  • Six categories: process control, file management, device management, information maintenance, communication, protection.
  • System calls are the only legitimate path for user programs to access hardware or protected OS services.

Test Yourself

  1. What is a system call? Why is it necessary?
  2. Describe the sequence of events that occurs when a system call is made.
  3. List the categories of system calls with one example each.

Hints:

  1. A system call is a mechanism for user programs to request OS kernel services. Necessary because user-mode programs are prevented from directly accessing hardware or critical resources for safety and security.
  2. App invokes system call → CPU switches to kernel mode → Kernel validates request and checks permissions → Kernel performs the operation (e.g., reads file) → Returns result to calling application → CPU switches back to user mode.
  3. Process control (fork), File management (read/write), Device management (ioctl), Information maintenance (getpid), Communication (socket), Protection (chmod).

1.6 Handling System Calls

Definition

Handling system calls refers to the mechanism by which the operating system receives, validates, executes, and returns results for requests made by user-space applications through the system call interface.


Making a system call is like pressing an emergency button. The system call handler is the trained crew that responds: it receives the signal, checks it is legitimate, performs exactly the requested action with full privileges, and then hands back the result before returning control to the program that pressed the button.

Detailed Explanation

Steps in Handling a System Call

1. User program invokes a system call: the program passes a system call number (identifying which service is requested) and any required parameters. Parameters are passed via registers, the stack, or a memory block whose address is given in a register.

2. Trap instruction is executed: a special CPU instruction called a trap (or software interrupt) is executed. This forces an immediate switch from user mode to kernel mode and jumps execution to a fixed address in the kernel called the trap handler.

3. System call dispatch: the kernel reads the system call number from the register and uses a system call table (a list mapping each number to the corresponding kernel routine) to dispatch to the correct handler function.

4. Kernel executes the service: the kernel handler validates parameters (checking for illegal values or memory addresses), verifies the process has permission to perform the operation, and then carries it out (reading a file, allocating memory, etc.).

5. Return to user mode: after execution, the return value (and any error code) is placed in a register. The kernel executes a return-from-trap instruction, restoring the saved state and switching the CPU back to user mode. Execution resumes in the user program at the instruction after the trap.

Role of the System Call Table

The system call table is an array in the kernel indexed by system call numbers. Each entry is a function pointer pointing to the kernel routine that handles that particular call. For example, on Linux, system call number 1 maps to sys_exit(), number 2 to sys_fork(), and so on.

Parameter Passing Methods

MethodHow it worksLimitation
RegistersParameters placed directly in CPU registers before the trapLimited by the number of registers
Memory block/tableParameters stored in a memory block; address of block placed in a registerSlightly more overhead but no count limit
StackParameters pushed onto the process stack; kernel pops themNo strict limit; common in many architectures

Summary

  • System calls are handled through a trap instruction that switches the CPU from user mode to kernel mode.
  • The kernel dispatches to the correct handler via a system call table indexed by call number.
  • The kernel validates parameters and permissions before executing the requested service.
  • After execution, a return-from-trap instruction restores user mode and passes results back to the calling program.

Test Yourself

  1. Describe the step-by-step process of handling a system call from invocation to return.
  2. What is a system call table? What is its role in system call handling?
  3. What are the three methods of passing parameters to the kernel during a system call?

Hints:

  1. User program calls system call with number + parameters → trap instruction switches to kernel mode → kernel indexes system call table with number → kernel handler validates and executes → return-from-trap restores user mode → result in register returned to program.
  2. System call table: a kernel array mapping each system call number to the corresponding handler function (function pointer). Role: enables fast dispatch — the kernel does not need to parse the call type; it simply indexes the table by number.
  3. Registers (placed directly in CPU registers before trap), Memory block/table (parameters stored in memory, address in register), Stack (parameters pushed onto the process stack before the trap).

1.7 Operating System Structures

Definition

Operating System Structures describe the internal architectural designs used to organize the OS code, determining how the kernel is divided into components, how those components interact, and where OS services reside relative to the hardware and user programs.


Just as a building can be one open space or a carefully divided set of rooms, an OS can be a single block of code or a neatly layered and modular system. The structure chosen affects how easy the OS is to maintain, how fast it runs, and how secure it is.

Detailed Explanation

1. Monolithic Structure (Simple/Non-structured)

The entire OS runs as a single large program in kernel mode. All OS services (process management, memory management, file system, device drivers) exist in one address space and can call each other directly. Early UNIX and MS-DOS used this approach.

Advantages: fast (direct function calls with no communication overhead); simple to implement initially.

Disadvantages: difficult to maintain and debug; a bug anywhere can crash the entire system; no isolation between components.

2. Layered Structure

The OS is divided into a hierarchy of layers numbered from 0 (hardware) to N (user interface). Each layer uses services only from the layer directly below it and provides services only to the layer directly above it. Developed by Dijkstra's THE system (1968).

Advantages: easy to debug (one layer at a time); clean separation of concerns.

Disadvantages: performance overhead because a request must pass through multiple layers; strict layering is hard to enforce in practice.

3. Microkernel Structure

The kernel is reduced to the absolute minimum: only the most fundamental functions (Inter-Process Communication (IPC), basic scheduling, and minimal memory management) remain in kernel mode. Everything else (device drivers, file systems, networking) runs as separate processes in user mode called servers. Example: Mach microkernel, Minix.

Advantages: highly modular; a failing server process does not crash the kernel; easier to extend and port.

Disadvantages: performance overhead from frequent message-passing between user-mode servers and the kernel (context switches are expensive).

4. Modular Structure (Loadable Kernel Modules)

The kernel has a core set of components and can dynamically load additional modules at runtime. Modern Linux and Windows use this approach. Device drivers, file systems, and other extensions are loadable kernel modules (LKMs) that can be inserted and removed without rebooting.

Advantages: flexibility; system can be tailored without recompiling the kernel; cleaner than pure monolithic.

Disadvantages: less isolation than microkernel (modules run in kernel space); bugs in a module affect the whole kernel.

5. Hybrid Structure

Combines elements from multiple designs. Most modern operating systems use a hybrid approach: a large kernel (closer to monolithic) but with some microkernel principles and loadable modules. Examples: Windows NT (microkernel-influenced but not pure), macOS (Mach microkernel + BSD components + proprietary services).

StructureKey IdeaAdvantageDisadvantageExample
MonolithicAll services in one kernel binaryFast, simpleHard to maintain; fragileEarly UNIX, MS-DOS
LayeredHierarchy of layers; each uses layer belowEasy debuggingPerformance overheadTHE (Dijkstra)
MicrokernelMinimal kernel; services as user-mode serversModular, fault-tolerantIPC overheadMach, Minix
ModularCore kernel + dynamically loaded modulesFlexible, extensibleModules run in kernel spaceLinux, Windows
HybridMix of monolithic, microkernel, modularBalance of allComplex designWindows NT, macOS

Summary

  • OS structure determines how OS code is organized and how components communicate.
  • Monolithic: everything in one kernel binary (fast but fragile). Layered: clean hierarchy (debuggable but slow). Microkernel: minimal kernel, services in user space (modular but IPC-heavy).
  • Modular: loadable kernel modules for flexibility; Hybrid: practical mix of the above used by most modern OS designs.
  • No single structure is perfect; modern OS designs compromise between performance, security, and maintainability.

Test Yourself

  1. Compare monolithic and microkernel OS structures. What are the tradeoffs?
  2. What is a layered OS structure? What are its advantages and disadvantages?
  3. Why do most modern operating systems use a hybrid structure?

Hints:

  1. Monolithic: all services in kernel space, fast direct calls, but a single bug crashes everything. Microkernel: only IPC + basic scheduling in kernel, rest as user-mode servers — modular and fault-tolerant but slower due to IPC message passing overhead.
  2. OS divided into numbered layers; each layer calls only the layer below it. Advantages: structured, each layer debuggable independently. Disadvantages: strict layering is hard to enforce; every request must traverse multiple layers, adding latency.
  3. No pure design perfectly balances performance, extensibility, and security. Hybrid takes monolithic performance, microkernel modularity, and modular flexibility — the practical optimum for general-purpose systems like Windows and macOS.

1.8 Kernel and Its Types

Definition

The kernel is the core component of an operating system that resides permanently in memory and has complete control over all hardware. It is the bridge between hardware and software, directly managing the CPU, memory, and devices.


If the OS is a government, the kernel is the executive branch with full authority. Everything else (file managers, GUIs, device drivers in some designs) are agencies that operate under the kernel's authority and depend on it for access to the nation's (hardware's) resources.

Detailed Explanation

The kernel is always running while the computer is on. It loads into memory during startup and remains there. Its responsibilities include:

  • CPU scheduling and process context switching
  • Physical and virtual memory management
  • Device driver management
  • System call handling
  • Interrupt handling

Types of Kernels

1. Monolithic Kernel

All OS services (process management, memory management, file systems, device drivers, system calls) are compiled into a single large executable that runs entirely in kernel mode. Communication between components is through direct function calls.

Examples: Traditional Linux kernel, early UNIX.

Advantage: high performance due to no IPC overhead. Disadvantage: large memory footprint; a bug in any component can bring down the entire kernel.

2. Microkernel

The kernel contains only the essentials: IPC, basic scheduling, minimal memory management. All other services (file system server, device driver server, networking server) run as separate processes in user space. They communicate with the kernel and each other via IPC (message passing).

Examples: Mach, Minix 3, QNX.

Advantage: stability (a crashing server does not crash the kernel), portability, security. Disadvantage: slower due to IPC overhead for every service request.

3. Hybrid Kernel

A microkernel design that allows certain non-essential services to run in kernel space for performance reasons. It is a pragmatic compromise: microkernel philosophy with monolithic performance optimizations.

Examples: Windows NT/10/11 kernel, macOS XNU (combining Mach microkernel and BSD components).

4. Exokernel

A research-oriented design where the kernel exposes hardware resources directly to applications with minimal abstraction. Applications manage their own resources. The goal is maximum performance and flexibility for specialized systems. The exokernel only enforces resource isolation and allocation.

Examples: MIT Exokernel (research project).

5. Nanokernel

An even more stripped-down kernel than the microkernel. It handles only interrupt handling and hardware abstraction at the most primitive level, delegating virtually everything else. Used in embedded systems where resource constraints are extreme. [verify: specific current production examples]

Kernel TypeServices in Kernel SpacePerformanceStabilityExample
MonolithicAll (drivers, FS, scheduling)Very highLower (single crash point)Linux, Unix
MicrokernelIPC, basic scheduling, min. memoryLower (IPC overhead)High (isolated servers)Mach, Minix
HybridCore + selected services for performanceHighModerate-highWindows NT, macOS XNU
ExokernelOnly resource allocation/isolationMaximumApplication-dependentMIT Exokernel
NanokernelOnly interrupt handlingMaximum for embeddedHigh for embeddedResearch/embedded

Summary

  • The kernel is the permanent, privileged core of the OS that directly controls hardware and provides the foundation all other OS components depend on.
  • Monolithic kernels are fast but fragile; microkernels are modular and stable but slower due to IPC overhead.
  • Hybrid kernels (Windows, macOS) combine microkernel principles with monolithic performance optimizations.
  • Exokernels push resource control to applications; nanokernels are ultra-minimal designs for embedded environments.

Test Yourself

  1. What is a kernel? What are its core responsibilities?
  2. Compare monolithic kernel and microkernel. Which is more stable and why?
  3. Why are hybrid kernels used in most mainstream operating systems?

Hints:

  1. Kernel: permanent core of OS in memory with full hardware control. Core responsibilities: CPU scheduling, memory management, device/driver management, system call handling, interrupt handling.
  2. Monolithic: all services in kernel space, fast direct calls but a bug anywhere can crash the entire system. Microkernel: only essentials in kernel; services as user-mode processes, so a crashing service does not crash the kernel — more stable. Trade-off is IPC overhead making it slower.
  3. Pure microkernels are too slow for general-purpose use; pure monolithics are too fragile. Hybrid kernels keep critical, performance-sensitive services in kernel space while adopting modular and isolation principles where feasible.

1.9 Shell

Definition

A shell is a user-space program that provides a text-based Command Line Interface (CLI) through which users can interact with the operating system by typing commands that the shell interprets and passes to the kernel for execution.


The shell is the outer layer of the OS that users actually touch. Just as a nut's shell protects and gives access to its core, the OS shell provides a controlled interface to the kernel's core. Type a command, the shell interprets it, assembles a system call or executes a program, and shows you the result.

Detailed Explanation

The shell sits between the user and the kernel. It reads text commands from the user, interprets them, and either executes a built-in command directly or launches an external program. The shell also supports:

  • Scripting: sequences of commands written in a script file and executed automatically, enabling task automation.
  • Piping (|): the output of one command is fed directly as the input to the next command.
  • Redirection (>, <): sending output to a file or reading input from a file instead of the terminal.
  • Variables and control flow: shells support variables, loops (for, while), and conditionals (if), making them full scripting environments.

Types of Shells

ShellFull NamePlatformNotable Feature
shBourne ShellUNIXThe original UNIX shell; scripting baseline
bashBourne Again ShellLinux, macOSMost common Linux shell; superset of sh
csh / tcshC Shell / TENEX C ShellBSD UNIXC-like syntax; command history
zshZ ShellLinux, macOSAdvanced features, theming; default on macOS since 2019
fishFriendly Interactive ShellLinux, macOSAutosuggestions, user-friendly syntax
PowerShellPowerShellWindows (also cross-platform)Object-oriented pipeline; built on .NET
cmd.exeCommand PromptWindowsTraditional Windows CLI

Shell vs. Kernel

The shell and the kernel are completely separate. The kernel cannot be replaced without reinstalling the OS. The shell is just a user-space program and can be changed without affecting the OS itself. A Linux system can run bash today and switch to zsh tomorrow with no impact on the kernel.

Summary

  • The shell is a user-space CLI program that interprets commands and communicates with the kernel on behalf of the user.
  • It supports scripting, piping, redirection, and control flow, making it a complete automation environment.
  • Common shells: bash (Linux default), zsh (macOS default), PowerShell (Windows).
  • The shell and kernel are separate: the shell can be replaced without touching the OS, but the kernel cannot.

Test Yourself

  1. What is a shell? How does it differ from the kernel?
  2. List four types of shells and their platforms.
  3. What is the role of the shell in scripting and automation?

Hints:

  1. Shell: user-space CLI program that interprets user commands and passes them to the kernel. Difference: kernel is the privileged core managing hardware (always running); shell is a replaceable user-mode application providing the text interface to it.
  2. Any four: sh (UNIX, original), bash (Linux, most common), zsh (macOS default since 2019), PowerShell (Windows, object-oriented), cmd.exe (Windows traditional), fish (cross-platform, user-friendly).
  3. Shell scripts are text files containing sequences of commands. The shell executes them sequentially, supporting variables, loops, and conditionals. This enables automating repetitive tasks (backups, deployments, system administration) without writing full compiled programs.

1.10 Open-Source Operating Systems

Definition

An open-source operating system is an OS whose source code is publicly available for anyone to inspect, modify, distribute, and use, typically under a license that preserves these freedoms.


In a closed-source OS like Windows, the source code is a trade secret. You can use the product but cannot see how it works. An open-source OS is a recipe shared with everyone: you can read it, improve it, adapt it for your needs, and share your version. Thousands of developers worldwide contribute to projects like Linux, leading to software that runs everything from personal laptops to supercomputers and smartphones.

Detailed Explanation

Key Open-Source Licenses

  • GNU General Public License (GPL): requires that any modified version distributed publicly must also be open-source. Used by Linux kernel.
  • MIT License: very permissive; allows use in proprietary software with minimal restrictions.
  • BSD License: similar to MIT; also used for permissive distribution.

Major Open-Source Operating Systems

OSBased OnPrimary UseNotable Fact
Linux (kernel)UNIX-inspired (Linus Torvalds, 1991)Servers, desktops, embedded, AndroidPowers ~96% of world's top 500 supercomputers
UbuntuLinux (Debian-based)Desktop and serverMost popular Linux desktop distribution
DebianLinuxServers, desktopsBase for Ubuntu, Raspberry Pi OS
FedoraLinux (Red Hat-based)Desktop, developer workstationsCommunity version of Red Hat Enterprise Linux
AndroidLinux kernel (modified)Mobile devicesMost widely deployed OS in the world by device count
FreeBSDBSD UNIXServers, embeddedCore of Sony PlayStation OS; used by Netflix CDN
OpenBSDBSD UNIXSecurity-focused serversKnown for extremely proactive security auditing

Advantages of Open-Source OS

  • Transparency: anyone can inspect the code for security vulnerabilities or undesired behavior.
  • Cost: generally free to use and distribute, reducing licensing costs.
  • Community development: benefits from contributions of thousands of developers worldwide.
  • Customizability: can be adapted for specific hardware or use cases without vendor permission.
  • Longevity: not dependent on a single vendor's business decisions; if a company discontinues a product, the community can maintain it.

Disadvantages of Open-Source OS

  • Support: community support can be inconsistent; enterprise support requires paid contracts.
  • Compatibility: some proprietary hardware drivers and software are not available.
  • Learning curve: advanced configuration typically requires command-line knowledge.

Summary

  • Open-source OS makes source code publicly available under licenses (GPL, MIT, BSD) that grant rights to inspect, modify, and redistribute.
  • Linux, the most important open-source OS kernel, powers servers, supercomputers, Android phones, and embedded systems.
  • Advantages: transparency, cost, customizability, community development; Disadvantages: variable support, potential compatibility gaps.
  • Open-source OS development demonstrates that collaborative, distributed software development can produce enterprise-grade, secure systems.

Test Yourself

  1. What is an open-source operating system? How does it differ from a proprietary OS?
  2. List four examples of open-source operating systems and their primary uses.
  3. What are the main advantages and disadvantages of open-source OS?

Hints:

  1. Open-source OS: source code is publicly available; anyone can inspect, modify, and redistribute under an open license. Proprietary OS (e.g., Windows): source code is closed; only the vendor can modify it. Users only receive the compiled executable.
  2. Linux (servers/desktops/embedded), Android (mobile, Linux-based), Ubuntu (desktop/server, Debian-based), FreeBSD (servers, embedded, PlayStation), OpenBSD (security-focused servers).
  3. Advantages: transparent (auditable source), free/low cost, community-driven improvements, highly customizable. Disadvantages: inconsistent support, some proprietary hardware/software incompatibilities, steeper learning curve for advanced use.

Exam Questions

  1. What is an operating system? Explain its main functions.
  2. Describe the evolution of operating systems through different generations.
  3. What are the different types of operating systems? Explain with examples.
  4. What is a system call? List the categories of system calls with examples.
  5. Describe the steps involved in handling a system call.
  6. Compare the monolithic structure with the microkernel structure of an operating system.
  7. What is a kernel? Explain the different types of kernels.
  8. What is a shell? How does it differ from the kernel? List types of shells.
  9. What are open-source operating systems? List four examples with their uses.
  10. Differentiate between multiprogramming and multiprocessing operating systems.
  11. What is a real-time operating system? Distinguish between hard RTOS and soft RTOS.

Whole Chapter Summary

Operating System Introduction: The OS is the system software layer between hardware and users, acting as both a resource manager (allocating CPU, memory, and I/O) and an extended machine (hiding hardware complexity). Its goals are convenience, efficiency, and evolution.

Evolution: OS design progressed across four generations: no OS (vacuum tubes) → batch monitor (transistors, sequential job processing) → multiprogramming and time-sharing (ICs, UNIX) → GUI and personal computing (VLSI, modern OS). Each generation addressed idle-time and usability limitations of its predecessor.

Types of OS: Batch (sequential, no interaction), Time-sharing (CPU slices per user), Distributed (networked machines as one system), Real-Time (deadline guarantees: hard or soft), Multiprogramming (one CPU switching on I/O), Multiprocessing (multiple CPUs in parallel), Network OS (server-based resource sharing).

Functions: Process management (scheduling, synchronization, deadlock), Memory management (allocation, protection, virtual memory), File system (organized storage with permissions), Device management (drivers and I/O), Security, UI (CLI/GUI), Networking, and Error handling.

System Call: The formal interface for user programs to request kernel services. A trap instruction switches the CPU to kernel mode; the kernel dispatches via a system call table, executes the service, and returns the result. Six categories: process control, file management, device management, information maintenance, communication, and protection.

Handling System Calls: User invokes call → trap executes (switches to kernel mode) → system call table dispatches to handler → kernel validates and executes → return-from-trap restores user mode with result.

OS Structures: Monolithic (all in kernel, fast but fragile), Layered (hierarchy, debuggable but slow), Microkernel (minimal kernel + user-mode servers, stable but IPC-heavy), Modular (dynamic loadable modules, flexible), Hybrid (practical combination used by modern OS).

Kernel and Types: The kernel is the permanent, privileged OS core managing hardware. Types: Monolithic (all services in kernel space), Microkernel (minimal kernel + user-mode servers), Hybrid (best-of-both compromise), Exokernel (raw hardware to applications), Nanokernel (interrupt handling only, embedded).

Shell: A user-space CLI program (bash, zsh, PowerShell) that reads commands, interprets them, and communicates with the kernel. Supports scripting, piping, and redirection. Replaceable independently of the kernel.

Open-Source OS: OS with publicly available source code under licenses like GPL, MIT, or BSD. Linux (kernel) powers servers, supercomputers, and Android. Advantages: transparency, cost, customizability; disadvantages: variable support and occasional compatibility gaps.

Last-Minute Revision Sheet

ConceptTrigger PhraseRecall Cue
OSResource manager + Extended machineBetween hardware and user; allocates CPU, RAM, I/O
Gen 1–4Vacuum → Transistor → IC → VLSINo OS → Batch → Multiprog/UNIX → GUI/PC
Batch OSSequential, no interactionJobs in batch; monitor reads next job automatically
Time-sharingTime quantum per userCPU rotates; each user feels dedicated machine
MultiprogrammingOne CPU, multiple jobs in RAMCPU switches on I/O wait; improves utilization
MultiprocessingMultiple CPUsTrue parallel execution; not the same as multiprogramming
RTOSDeadline guaranteeHard: deadline miss = failure; Soft: occasional miss OK
Distributed OSMany machines, one systemTransparent sharing; fault tolerance; scalability
OS functionsPMFDSUNEProcess, Memory, File, Device, Security, UI, Networking, Error
System callUser → Kernel service requestTrap → kernel mode → system call table → execute → return-from-trap
Monolithic structOne large kernel binaryFast, all in kernel space; fragile
Microkernel structMinimal kernel + user-mode serversStable; IPC overhead; Mach, Minix
Hybrid structMicro principles + monolithic performanceWindows NT, macOS XNU
Monolithic kernelAll services in kernel spaceLinux, UNIX — fast but large crash surface
MicrokernelIPC + basic sched in kernel onlyMach, Minix — stable, modular, IPC-slow
ShellCLI interpreter, user-spacebash/zsh (Linux), PowerShell (Windows); scripts + pipes
Shell vs KernelShell is replaceable; kernel is notShell: user-space app. Kernel: permanent privileged core.
Open-source OSPublic source code, GPL/MIT/BSDLinux powers servers, supercomputers, Android; free + customizable
Views: …
TUpapers.com logo tupapers.com
  • Privacy Policy

  • Contact Us

  • Terms

  • Pricing

  • SEEpapers.com

TUpapers on Facebook
TUpapers on Instagram
Contact TUpapers on WhatsApp Contact TUpapers on WhatsApp
TUpapers subreddit on Reddit

Courses

  • BBA

  • BCA

  • BIT

  • CSIT

  • BBS

  • BHM

  • BBM

  • BITM

  • BTTM

  • BA

  • BE

  • BSW

© 2026 tupapers.com. All rights reserved.