Skip to main content

OS as virtual machine; functions

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.

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

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.

 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.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Operating System chapter 1 questions →