Kernel abstractions Flashcards

1
Q

What is dual mode operation and which modes do we have?

A

Dual mode operation is a way to have two different modes to execute on the CPU

Kernel mode is the mode that has all priveleges “god mode” and does everything.

User mode is the mode that has limited privileges. These privileges are granted by the OS kernel.

On the x86, the user/kernel mode are stored in the EFLAGS register.

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

What is a process?

A

A process is an instance of a program, running with limited rights

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

When does a mode switch happen from user to kernel mode and vice versa?

A

A switch from user to kernel happens in following situations:
- interrupts
- exceptions
- systems calls

A switch from kernel to user happens in following situations:
- new process/new thread start
- return from interrupt, exception or system call
- process/thread switch
- user-level upcall (UNIX signal)

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

What is an interrupt?

A

An interrupt is an asynchronous signal to the processor that some external event has occured that may require attention.

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

What is a system call and how do they work?

A

A system call is any procedure provided by the kernel that can be called from user-level.

Often implemented by using a trap instruction. A trap instruction changes the processors mode from user to kernel and starts executing in the kernel at a pre-defined handler.

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

What is the process control block and what is its role in the OS?

A

Process control block is a data structure that stores information about a process. it stores the following information:
- process state (whether the process is running, waiting, etc)
- process id and parent process id
- CPU registers and program counter
- CPU-scheduling information
- memory-management information
- accounting information (user and kernel cpu time comsumed, account numbers, etc)
- I/O status information (Devices allocated, open file tables, etc)

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