Limited Direct Execution Flashcards

1
Q

What are the two main challenges we face with virtualisation of the CPU?

A

Ensuring good performance, and being efficient while still maintaining control.

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

What is Limited Direct Execution? What are the limits?

A

Essentially, limited directly execution means that certain instructions are read in user mode, and if the program wants to do a privileged instruction, it must switch to kernel mode. You can only read and write from your own process memory, and timers are used to force you to yield execution.

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

What must a program do if it wants to run an IO request?

A

It must make a system call, so that it switches from user mode to kernel mode. To issue a system call, it must execute a trap instruction, and then perform a return-from-trap when they are done.

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

When is the trap table set up?

A

When the system is booted.

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

Name two ways that the OS can regain control from a program?

A

Relying on processes to yield themselves. Using timer interrupts.

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

What does a context switch involve?

A

Saving the current process context, and restoring the context of the process we are switching to.

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

Why are libraries important?

A

Because reading is cool…
Because it prevents us from having to make as many lengthy system calls to the kernel. Library calls are cheap, as they only use the library.

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

What is indirect execution?

A

Where the OS decodes and executes instructions of a user process itself. This is done in Java and Erlang. It tends to be quite time expensive.

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

What is direct execution?

A

Where the OS sets up the program, and then lets it run. This is less intensive and more efficient, but it places too much trust in the process.

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

What are synchronous and asynchronous interrupts?

A

Synchronous interrupts are exceptions raised by the CPU, e.g. when you try to access restricted memory. Asynchronous interrupts occur when the hardware detects something, such as keyboard, IO, etc.

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