Dual Mode Operation
- Sharing system resources requires operating system to ensure that an incorrect program cannot cause other programs to execute incorrectly.
- Provide hardware support to differentiate between at least two modes of operations.
- Users mode - execution done on behalf of a user.
- Monitor mode - execution done on behalf of operating system.
- Mode bit added to computer hardware to indicate the current mode: monitor(0) or user(1).
- When an interrupt or fault occurs hardware switches to monitor mode
- Privileged instruction can be issued only in monitor mode.
I/O Protection
- All I/O instruction are priviliged instruction.
- Must ensure that a user program could never gain control of the computer in monitor mode (i.e., a user program that, as part of its execution, stores a new address in the interrupt vector).
Memory Protection
- Must provide memory protection at least for the interrupt vectorand the interrupt service routines.
- In order to have memory protection, add two registers thatdetermine the range of legal addresses a program may access:
– base register – holds the smallest legal physical memoryaddress.
– limit register – contains the size of the range.
- Memory outside the deļ¬ned range is protected.
CPU Protection
- to prevent a user programs gets stuck in infinite loop and never returning back to the os

No comments:
Post a Comment