CPUs Microcode Protection and Protection Modes Flashcards
(42 cards)
When CPU runs in Kernel mode, it can:-
- run any ___
- modify any ___ in ___
- access and modify any ___ in CPU and devices
- full control of the computer
instruction; location, memory; register
The OS services runs in ___ mode.
Kernel/User
Kernel
When CPU runs in User mode, it can:-
- use a limited set of ___
- modify only sections of ___ assigned to the process running the program
- access only ___, and cannot access ___ in ___
- limited access to the resources of the computer
instructions;
memory;
a subset of registers in CPU, registers, devices
The user programs run in ___ mode.
Kernel/User
User
Kernel/User Mode:
1. When the OS boots, it starts in ___ mode.
kernel
Kernel/User Mode:
2. In ___ mode, the OS sets up the ___ and ___ all the devices.
kernel, interrupt vector, initializes
Kernel/User Mode:
3. Then it starts the first process and switches to ___ mode.
user
Kernel/User Mode:
4. In ___ mode, the OS runs all the ___.
user, background system processes (daemons)
Kernel/User Mode:
5. Then it runs the ___ or ___.
user shell, windows manager
Kernel/User Mode:
6. While running in ___ mode, the program switches to ___ mode to request OS services (___).
user, kernel, system calls
Kernel/User Mode:
7. User programs also switch to ___ mode when ___ arrives.
kernel, interrupt
The interrupts are executed in kernel mode.
True/False
True
The interrupt vector can be modified in both kernel and user mode.
True/False
False. Only in kernel mode
Most of the CPU time is spent in __ mode.
User
Separation of user/kernel mode is for:-
___ (make sure user have enough privileges to run the call)
___ (Killing bugs and crashing)
___ (OS calling in kernel mode for fair access)
Security; Robustness; Fairness
If a process that tries to write to an invalid memory location, the OS will ___ the program, but the OS ___.
kill, continue to run
Which of the following is false?
A. A crash in the process will not crash the OS
B. A bug in user mode causes program to crash, OS will also crash
C. A bug in kernel mode may cause OS and system to crash
B.
A bug in user mode causes program to crash, but OS will still run.
An interrupt is an event that requires ___.
Little/moderate/immediate attention
immediate attention
In hardware, a device sets the interrupt line to ___.
low/medium/high
high
When an interrupt is received, the CPU will stop whatever it is doing and jump to the ___ that handles that specific interrupt.
Interrupt handler
After executing the handler, the CPU ___ and the program continues.
return to the same place where the interrupt happened
Arrange the steps of servicing an interrupt.
- CPU jumps to interrupt handler and run it
- CPU restores the registers and return back to the place in the program that was interrupted. The program continues execution as if nothing happened
- CPU saves the program counter and registers in execution stack
- CPU looks up the corresponding interrupt handler in the interrupt vector
3, 4, 1, 2
Interrupts allow CPU and devices to run in parallel without waiting for each other.
True/False
True
Which of the following about poling is false?
A. Poling is also called “busy waiting”.
B. During poling, OS decides not to use interrupts for some devices and wait in a busy loop until completion.
C. Poling is used to print debug messages in the kernel.
D. Poling saves CPU cycles.
D.
Poling wastes a lot of CPU cycles.