BIT204 ยท 2082 ยท 5 marks
What is virtual machine? Discuss about system protection. [2+3]
What is virtual machine? Discuss about system protection. [2+3]
Quick answer
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.
Virtual Machine and System Protection
Virtual Machine (2 marks)
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)
| Domain | File A | File B | Printer |
|---|---|---|---|
| D1 | Read | Read/Write | -- |
| D2 | -- | Read | Write |
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.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.