---
title: "OS as virtual machine; functions"
subject: "Operating System"
chapter: 1
key: "semester_6/operating_system:os-virtual-machine-functions"
source: https://www.bctengineer.com/q/semester_6/operating_system/os-virtual-machine-functions
site: BCT Engineering
---

# OS as virtual machine; functions

Operating System · Chapter 1: Introduction to Operating System

- Asked in: 2073 Magh, 5 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/operating_system/os-virtual-machine-functions
- Whole chapter: https://www.bctengineer.com/md/semester_6/operating_system/chapter-1

## Question

Why is an operating system termed a virtual machine? Briefly mention the functions of an operating system.

## Short answer

An OS is termed a virtual machine because it hides hardware complexity and presents abstractions like files, processes, and virtual memory. Its functions include process management, memory management, file management, I/O device management, protection and security, user interface, error handling, and resource accounting.

## Answer

#### OS as a virtual (extended) machine

The raw hardware is hard to program: to read a disk block, a programmer must know the controller registers, command codes, motor start, seek, error codes and interrupts. The OS hides this complexity and presents a simpler, cleaner, imaginary machine (a **virtual machine** or **extended machine**) with abstractions such as files, processes, address spaces and sockets. A programmer just calls `read(fd, buf, n)` and does not care about the disk details. Thus the OS makes the real machine appear to be a more powerful machine that is easier to use. Moreover, each process believes it has its own CPU and memory (virtual CPU, virtual memory), although they are shared.

```text
 User program
      |  read(), write(), fork()
 +----v------------------+
 | Virtual machine       |  files, processes,
 | (OS abstractions)     |  address spaces
 +----+------------------+
      |  device registers, interrupts
 +----v------------------+
 | Real hardware         |
 +-----------------------+
```

#### Functions of an operating system

- **Process management**: creation, scheduling, synchronization, communication.
- **Memory management**: allocation, protection, virtual memory.
- **File management**: files, directories, access control.
- **I/O device management**: drivers, buffering, spooling.
- **Protection and security**, **user interface** (shell/GUI), **error handling** and **resource accounting**.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why is an OS termed a virtual (extended) machine?
   A. It hides hardware complexity and presents a simpler imaginary machine with files, processes and address spaces
   B. It runs several hypervisors on one CPU
   C. It physically replaces the hardware
   D. It converts hardware into software licences
   Answer: A. The OS provides abstractions so the real machine appears more powerful and easier to use. (Key point: Why virtual machine)

2. How does read(fd, buf, n) show the OS as an extended machine?
   A. The programmer must program the disk controller commands
   B. The programmer does not need to know controller registers, seek or interrupts
   C. The call directly moves the disk motor
   D. It works only for one type of disk
   Answer: B. The OS handles disk details behind the simple call. (Key point: Example of abstraction)

3. What does each process believe in an OS?
   A. It shares registers directly with all other processes
   B. It can see the physical addresses of other processes
   C. It has its own CPU and memory (virtual CPU, virtual memory) though they are shared
   D. It runs on a different hardware machine
   Answer: C. Virtualisation of CPU and memory is part of the extended machine view. (Key point: Virtual CPU and memory)

## Related in Operating System

- [OS abstraction, extended machine, system call](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aos-abstraction-system-call) — Operating System, chapter 1
- [Virtual machine structure and benefits](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Avirtual-machine-structure) — Operating System, chapter 1, asked 2×
- [OS as resource manager and extended machine](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aos-resource-manager-extended-machine) — Operating System, chapter 1
- [What is an OS; its functions](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aos-functions-definition) — Operating System, chapter 1, asked 2×
- [Functions of OS and microkernel](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aos-functions-microkernel) — Operating System, chapter 1
- [File system vs virtual memory; contiguous allocation](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Afs-vs-virtual-memory-contiguous-tape) — Operating System, chapter 5

## Related in other subjects

- [Features of a typical operating system](https://www.bctengineer.com/question.md?key=semester_4%2Fmicroprocessor%3Afeatures-of-operating-system) — Microprocessor, chapter 6, asked 3×
- [Operating system layers](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aos-layers) — Distributed System, chapter 3
- [Digital switching system and its functions](https://www.bctengineer.com/question.md?key=semester_8%2Ftelecommunications%3Adigital-switching-functions) — Telecommunications, chapter 4
- [Real-time system and real-time OS components](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Areal-time-os) — Software Engineering, chapter 4
