title | date | lastmod |
---|---|---|
Hardware Protection |
2022-11-08 |
2022-11-21 |
Differentiates between at least 2 modes of operations
- User mode: execution of user processes
- Monitor mode (supervisor/system/kernel mode): execution of operating system processes
[!Hardware Context Switching] The above is an example of hardware context switching, which is no longer supported in 64-bit mode.
[!Kernel mode vs root/admin] Kernel mode is not the same as root/admin privileges. Kernel or user modes are hardware operation modes while the root/admin is just a user account in the OS.
The root/admin may execute code in kernel mode indirectly.
All I/O instructions are privileged instructions. The OS will ensure that they are correct and legal.
OS needs to set the range of legal addresses a program may access. This is done using 2 registers.
Base register: holds the first legal memory address
Limit register: contains the size of the legal range
Given a base register value of 0x1000 and a limit register value of 0x1000, access to memory location 0x1FFF will generate a trap. False. Each access to memory by a process must be in the range [base, base+limit-1]. In this case, it translates to the range [0x1000, 0x1FFF].