Lecture 3 - Virtualisation Flashcards

(35 cards)

1
Q

What is a Process?

A

A process is a program that is executed
- It is a basic unit of execution in an OS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Process Scheduling (time-sharing)?

A

Each process is scheduled and executed withing their time share. Where the number of processes can be much larger than that of the CPU
- For process scheduling, It is about how the operating system
schedules processes for execution on CPUs and the scheduling is time sharing based or what we
say, known as a multiplex manner
- So, this is similar to CPU virtualization that we have discussed in the last lecture.
So, each process is scheduled and executed within the time
shared.
- For each CPU, Processes are waiting in line. To be scheduled for execution. So the number Processes Can be much larger than that of the physical CPUs.
REFER TO SLIDES FOR DIAGRAM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How does Process Scheduling work?

A
  1. Job Queue
  2. Ready Queue
  3. CPU (Central Processing Unit)
  4. Exit
  5. I/O Waiting Queue
  6. I/O
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does Process Scheduling work - Job Queue?

A

○ This queue holds all the processes that have entered the system (submitted by users or programs).
○ These are not yet ready to run — they are waiting for allocation of resources (e.g., memory).
○ Scheduler (often long-term scheduler) picks some of these to move to the Ready Queue.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does Process Scheduling work - Ready Queue?

A

○ This holds all processes that are ready to run but are waiting for CPU time.
○ These processes have all required resources except the CPU.
○ The short-term scheduler picks a process from this queue and assigns it to the CPU.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does Process Scheduling work - CPU?

A

○ This is where the actual execution of instructions happens.
○ The process can:
§ Complete execution → Go to Exit.
§ Request I/O → Move to the I/O Waiting Queue.
§ Be pre-empted (e.g., time slice ends or higher priority process arrives) → Go back to Ready Queue.
○ Note: 1 CPU can only serve one process at a time
○ They are using their given time share to finish their execution, it will then exit the system or once the time share has expired

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does Process Scheduling work - Exit?

A

○ Represents the end of a process’s life — the process has completed its execution and is terminated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does Process Scheduling work - I/O Waiting Queue?

A

○ If a process needs input/output operations (e.g., reading a file), it cannot use the CPU.
○ It moves to this queue and waits for the I/O device to be available.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How does Process Scheduling work - I/O?

A

○ When the I/O device is available, the process moves from the I/O Waiting Queue to the I/O operation block.
○ Once I/O is completed, the process goes back to the Ready Queue to await CPU time again.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the X86 Protecting Rings (CPL)?

A

When the programme is executed on the CPU, it becomes a process.
- Where the code and data will be decoded as low-level assembly instructions

x86 has four protecting levels (rings)/CPU privilege levels (CPLs)
- Ring 0 - Kernal mode (most privileged)
- Ring 1 and 2 - Other
- Ring 3 - User mode

Modern Oses such as Linux, Windows and MacOS only use ring 0 and 3
- Kernal vs user mode

NOTE: the process schedule that was just mentioned is in ring 0 as this is where we allocated the privilege

REFER TO SLIDES FOR DIAGRAMS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Virtual Memory?

A

The size of VM is decided by the virtual address, for example the OS might use 32 or 64

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the general components for Virtual Memory?

A

REFER TO NOTES

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Define on-demand paging?

A

So, in the kernel mode, the CPU will allocate an empty physical page like this and load the code from the disc into this physical page. So this is what we call on-demand paging.
- If there is a physical page has recently been used its content can be swapped out back to the disk
- We use swapping in and swapping out to maximise the usage of the physical memory space
Note physical memory is faster than the disk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Shared Memory

A

REFER TO SLIDES FOR DIAGRAM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Memory Map implementation - MMU

A

REFER TO SLIDES FOR DIAGRAM

MMU is Memory Management Unit used for translation of memory from virtual to physical

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a page table in relation to memory mapping?

A

Page Table: In a modern OS, the OS uses a set of page tables to map/translate virtual memory within a process to their corresponding physical memory in main memory
- VA refers to virtual address, pointing to a page-aligned memory location in a virtual page
- PA refer to physical address, pointing to a apge-aligned memory location in a physical page
MMU: Memory Management Unit - handles the mapping or translation of memory

17
Q

What do we mean by page aligned address

A

REFER TO SLIDES

18
Q

Memory Map Implementation: x86-32

A

REFER TO SLIDES

19
Q

What is Virtualisation (hardware virtualisation)?

A
  • Virtualization is the ability to run multiple operating systems on a single physical machine and share the underlying hardware resources [1]
    • Allows one computer software (called Virtual Machine Monitor or Hypervisor) to provide the appearance of many computers (called virtual machines).
      • [1] VMWare white paper, Virtualization Overview
20
Q

What are the Characteristics of Virtual Machine Monitor?

A
  1. Full control over hardware resources
    a. Such as CPU memory and disc
    1. Hardware Virtualisation
      a. Provides virtual hardware environment to get operating systems
    2. Near-native performance
      a. No the complete performance as against the OS running above the VM it will experience minimal performance overhead compared to the installed OS
21
Q

What are the VMM types?

A
  • Type 1 : Bare-Metal/Native Architecture
    ○ VMM or Hypervisor is installed directly on hardware as the most privileged software
    ○ Acknowledged as preferred architecture for mainstream public clouds
    ○ Examples: KVM, Xen, Hyper-V
    • Type 2: Hosted Architecture
      ○ Install as an application on an existing host OS, e.g., Windows, Linux, MacOS
      ○ Examples: Virtualbox, UTM, Vmware
22
Q

What is the VMM implementation on x86-64

A

Main stream architecture
- Hardware support: Intel and AMD assist virtualisation
○ Intel VT-x and AMD SVM: CPU and memory virtualization
○ Intel VT-d and AMD Vi: Device virtualization
REFER TO SLIDES FOR DIAGRAMS

23
Q

What is CPU Virtualisation?

A

REFER TO SLIDES

24
Q

What is Memory Virtualisation?

A

REFER TO SLIDES

25
What are containers?
- A container is a sandboxed process running on a host OS that is isolated from all other processes running on that host OS [2] - A container image is a stand-alone and executable software package (including software dependencies, binaries, etc) that contains everything needed to run specific user applications. - A container is a runnable instance of the image. So, a container image is a stand-alone and executable software package, and this package supports the execution of the user applications. So, a container is a roundable instance of the image, just like a process is a roundable form of a programme.
26
What is the Difference between Containerisation and Virtualisation
- Granularity ○ Containers are an abstraction of the process layer and VMs are a simulation of the hardware layer. - Overhead ○ Required resources: containers are created to run one application and VMs support a whole OS. ○ Efficiency: containers are launched to run an application. VMs need to boot up an entire OS. - Security/Isolation ○ Containers are isolated from each other at the process level. VMs are isolated at the OS level.
27
What are the backbone of containers?
Namespaces Cgroups Copy-on-write files
28
What are the backbone of containers - namespaces?
Provides containers with their own view of system resources
29
What are the backbone of containers - cgroups?
Stands for Control Groups, they manage resource usage and limts for processes within a container
30
What are the backbone of containers - copy-on-write files?
Allow containers to share read-only underlying OS files. If a container write-access a file, a copy is created and updated accordingly. Similar to the copy-on-write fork
31
What is a Docker Container?
- Provides an interface on top of the techniques - Popularised containers (a standard unit of software) REFER TO SLIDES
32
What are the 3 types of virtualisation?
Language, operating system, hardware
33
What is language virtualisation and its attribute?
Provides a runtime environment that allows code written in a specific language to execute Its attribute is cross-OS: code can be executed in a virtual runtime environment across different OSes
34
What is Operating system virtualisation and its attribute?
Allow multiple isolated user-space environments to run on top of a single OS kernel Its attribute is limited isolation: while environments are isolated, they share the same OS kernel, which means it could be effected by vulnerabilities
35
What is hardware virtualisation and its attribute?
Creates multiple virtual machine sharing a single physical server its atribute is Live VM migration and VM snapshots (saving current state of VM)