6. Limited Direct Execution Flashcards

1
Q

What are the challenges in virtualisation?

A

Performance and control

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

What is direct execution?

A

Running the program directly on the CPU

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

How to prevent programs from running malicious actions?

A

Introduce privilege levels which are user mode and kernel mode.

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

What happens when a system call is performed?

A
  1. Program execute a special trap instruction
  2. The trap handler will raise privilege to kernel mode and execute the privileged operations
  3. The OS will call a special return-from-trap instruction that returns to the user program while reverting back to user mode
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How and when are the trap handlers defined?

A

The kernel will set up a trap table during boot time that configures all trap handlers.

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

How are system calls performed in the low level?

A

The user must specify the specific system-call number in the register or the stack. The mandatory information must also be supplied.

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

What are the approaches when switching between processes?

A

Cooperative: The OS waits for processes to give back control (yield) or to perform an illegal operation.
Non-cooperative approach: Timer interrupt

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

What is the solution when the program is running an infinite loop in the cooperative approach?

A

Reboot the machine

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

Which component saves the state of the running process when an interrupt occurs?

A

Hardware

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

What is a context switch?

A

A mechanism to switch between processes for execution

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

What is the kernel stack for?

A

It is a per-process stack to store key information that will be used by the kernel. For example, the OS will restore information into registers after reverting to user mode.

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

What happens during a context switch?

A

The OS will save the registers, PC and kernel stack pointer of the current process. To perform the switch, it will restore the registers, PC and kernel stack of the next process.

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

What are the two types of register saves that happen in the OS?

A
  1. Timer interrupt will trigger the hardware to implicitly save all the user registers into the kernel stack.
  2. A context switch will trigger the OS to explicitly save all the kernel registers into the process structure block
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the two types of handlers that must be established during boot time?

A

Trap handlers and interrupt handlers.

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

What does limited direct execution do?

A
  1. Create privilege mode (limited access)
  2. Introduce timer interrupts (limited time)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
A