1 Operating System Fundamentals

Operating Systems · Unit 1

Operating System Fundamentals

Exam-focused notes for Operating System Fundamentals (Operating Systems, BIT204): what the TU syllabus asks and how it has actually been tested, with 7 solved past questions from this unit.

Operating System Fundamentals in short

An operating system (OS) is the main software that runs a computer. It manages the hardware and gives programs a safe, simple way to use it. Without an OS, every program would have to control the disk, screen and memory by itself.

Operating System Fundamentals: notes

Definition and purpose of operating systems

An operating system is a program that acts as a middle layer between the user and the computer hardware. It starts first when the computer boots and runs until shutdown.

Main purposes:

  • Make the computer easy to use.
  • Use the hardware (CPU, memory, disks) in an efficient way.
  • Share resources fairly between many programs and users.
  • Keep programs from harming each other or the system.

Examples are Windows, Linux, macOS, Android and iOS.

Operating system as extended machine

Raw hardware is hard to program. To read a file from a disk, a programmer would need to know the controller ports, the sector numbers and the error codes. The OS hides all of this.

It gives the user a cleaner and simpler virtual machine. The programmer just calls open, read and write on a file. This is the "extended machine" view, also called the top-down view. The OS also works as a resource manager (the bottom-up view). It decides which program gets the CPU, memory or printer, and for how long.

Operating system components

  • Process management: creates, schedules and ends processes.
  • Memory management: keeps track of which memory is free or used, and gives it to processes.
  • File management: creates, stores, names and protects files and directories.
  • I/O device management: controls devices through drivers and buffers.
  • Secondary storage management: manages disk space and disk scheduling.
  • Protection and security: controls who can use which resource.
  • Command interpreter (shell): takes commands from the user and runs them.
  • Networking: lets the computer share data with other computers.

What this unit covers

  • Definition and purpose of operating systems
  • Operating system as extended machine
  • Operating system components
  • Types of operating systems
  • Batch systems
  • Time sharing systems
  • Real time systems
  • Virtual machines and system protection

Operating system components

2082 · 5 marks

Explain about operating system components in brief. [5]

An operating system is made up of several key components that work together to manage hardware and software resources. The main components are described briefly below: --- - A process is a program in execution. - The OS is responsible for creating, scheduling, and terminating processes. - It hand...

Open this answer on its own page →

Batch systems

2082 · 5 marks

Explain about batch system and time sharing operating systems. [5]

Note: Reference notes were not available for this topic. The following answer is based on standard Operating Systems curriculum as taught in BSc CSIT. --- A batch operating system is one of the earliest types of operating systems where similar jobs (tasks) are grouped together into batches and ex...

Open this answer on its own page →

Virtual machines and system protection

2082 · 5 marks

What is virtual machine? Discuss about system protection. [2+3]

Show solved answer

Virtual Machine and System Protection


Virtual Machine (2 marks)

A virtual machine (VM) is a software emulation of a physical computer system that provides a virtual environment in which an operating system or application can run as if it were running on dedicated physical hardware.

A virtual machine creates an illusion of a complete hardware system (including CPU, memory, storage, and network interfaces) on top of actual physical hardware. Multiple virtual machines can run simultaneously on a single physical machine, each isolated from the others.

Key characteristics:

  • Each VM runs its own operating system (called guest OS)
  • The underlying physical machine runs a host OS or hypervisor
  • VMs are isolated from each other, providing security and stability
  • Examples: VMware, VirtualBox, Hyper-V
+------------------+  +------------------+
|   Guest OS 1     |  |   Guest OS 2     |
+------------------+  +------------------+
|        Virtual Machine Monitor (VMM)   |
+----------------------------------------+
|         Physical Hardware              |
+----------------------------------------+

System Protection (3 marks)

System protection refers to mechanisms and policies used by an operating system to control access to resources (CPU, memory, I/O devices, files) and prevent unauthorized or accidental interference between processes and users.

Goals of System Protection:

  • Prevent unauthorized access to system resources
  • Ensure each process accesses only what it is permitted to
  • Detect and prevent errors that could compromise system integrity

Key Concepts in System Protection:

1. Protection Domains

  • A protection domain defines a set of resources and the access rights (read, write, execute) a process has over those resources.
  • A process operates within a domain and can only access objects permitted in that domain.
  • Domains can be associated with users, processes, or procedures.

2. Access Matrix

  • An access matrix is a model for protection where:
    • Rows represent domains (users/processes)
    • Columns represent objects (files, devices)
    • Entries define allowed operations (read, write, execute)
DomainFile AFile BPrinter
D1ReadRead/Write--
D2--ReadWrite

3. Dual Mode Operation

  • Hardware support for protection through user mode and kernel mode
  • Privileged instructions can only execute in kernel mode
  • Prevents user processes from directly accessing hardware

4. Memory Protection

  • Ensures a process cannot access memory belonging to another process or the OS
  • Implemented using base and limit registers or paging/segmentation

5. CPU Protection

  • Timer interrupts prevent a process from monopolizing the CPU
  • The OS regains control after a set time interval

Summary:

System protection ensures controlled access, isolation, and integrity of resources, making the system reliable and secure for multiple users and processes.

Open this answer on its own page →

Types of operating systems

2079 · 10 marks

What are the different types of operating system? Differentiate between Real time and Batch OS.[10]

Show solved answer

Types of Operating Systems and Difference Between Real-Time and Batch OS

Types of Operating Systems

An Operating System (OS) is system software that manages hardware and software resources and provides services to computer programs. Operating systems are classified into the following types:


1. Batch Operating System

  • Jobs with similar requirements are grouped (batched) together and executed without user interaction.
  • A job scheduler picks jobs from the batch and submits them to the CPU one by one.
  • Example: Early IBM mainframe systems, payroll processing.

2. Time-Sharing (Multitasking) Operating System

  • CPU time is shared among multiple users/processes simultaneously.
  • Each process gets a small time slice (quantum) in a round-robin fashion.
  • Provides fast response time and interactive use.
  • Example: UNIX, Linux, Windows.

3. Real-Time Operating System (RTOS)

  • Designed to process data and respond within a strict, guaranteed time constraint (deadline).
  • Used in time-critical applications.
  • Example: Air traffic control, medical devices, missile guidance systems, VxWorks.

4. Distributed Operating System

  • Manages a group of independent computers and makes them appear as a single system to the user.
  • Resources (CPU, memory, storage) are distributed across multiple machines.
  • Example: LOCUS, Amoeba.

5. Network Operating System

  • Provides features to manage data, users, groups, security, and applications over a network.
  • Each machine has its own local OS but can share resources over the network.
  • Example: Windows Server, Novell NetWare.

6. Multiprocessor Operating System

  • Supports systems with more than one CPU sharing the same memory and I/O devices.
  • Increases throughput and reliability.
  • Example: Symmetric Multiprocessing (SMP) systems.

7. Embedded Operating System

  • Designed to operate on small machines (embedded systems) with limited resources.
  • Highly specialized and resource-efficient.
  • Example: Android (mobile), FreeRTOS, Windows CE.

8. Mobile Operating System

  • Designed specifically for smartphones and tablets.
  • Manages mobile hardware such as touchscreen, GPS, camera.
  • Example: Android, iOS.

Difference Between Real-Time OS and Batch OS

BasisReal-Time OS (RTOS)Batch OS
DefinitionAn OS that processes tasks and produces results within a strict time deadline.An OS that collects jobs into batches and processes them sequentially without user interaction.
Response TimeExtremely fast and guaranteed (microseconds to milliseconds).Response time is slow and not guaranteed; depends on queue length.
User InteractionMinimal or no user interaction during execution; but system reacts to real-world events.No user interaction once the batch is submitted.
DeadlineStrict deadlines must be met (missing a deadline can cause system failure).No concept of strict deadlines; jobs are processed as resources become available.
PriorityTasks are assigned priorities; high-priority tasks preempt lower ones.Jobs are processed in the order they are batched (FCFS or similar).
SchedulingPriority-based, preemptive scheduling is used.Non-preemptive, sequential scheduling is used.
TypesHard RTOS (strict deadlines) and Soft RTOS (flexible deadlines).Simple batch and multiprogrammed batch.
CPU UtilizationCPU utilization may not be maximum; correctness and timing are more important.Aims for maximum CPU utilization.
Error HandlingMust handle errors immediately and reliably.Errors are reported after job completion; job may be skipped.
ApplicationsMedical devices, missile systems, air traffic control, robotics.Payroll processing, bank statements, weather forecasting data processing.
ComplexityMore complex due to timing constraints and event-driven nature.Relatively simpler to design and implement.
Example SystemsVxWorks, FreeRTOS, QNX.Early IBM OS/360, simple mainframe batch systems.

Summary

Operating systems are classified based on how they manage processes, respond to users, and handle time constraints. Batch OS focuses on throughput and sequential job processing with no real-time constraints, while Real-Time OS focuses on correctness within strict time limits, making it essential for safety-critical and time-sensitive applications.

Open this answer on its own page →

2078 · 5 marks

What is an operating system? Differentiate between time sharing and real time operating system. [5]

An Operating System (OS) is system software that acts as an intermediary between the user and the computer hardware. It manages all hardware resources and provides a platform for application programs to run. Key functions of an OS include: - Process management - Memory management - File system ma...

Open this answer on its own page →

Definition and purpose of operating systems

2079 · 5 marks

What is an OS? Explain 3-state model of process with neat and clean diagram. [5]

--- An Operating System (OS) is system software that acts as an intermediary between the user and the computer hardware. It manages all hardware resources and provides a platform for application programs to run. Key functions of an OS: - Process management - Memory management - File system manage...

Open this answer on its own page →

Time sharing systems

0 · 5 marks

What does time sharing means in multiprogramming? Explain any three types of operating system structure. [5]

Time Sharing (also called multitasking) is a logical extension of multiprogramming. In multiprogramming, the CPU is switched among multiple jobs to maximize CPU utilization. Time sharing goes further by switching the CPU among jobs so frequently that users can interact with each running program. ...

Open this answer on its own page →