Thursday, June 25, 2009

3.HARDWARE PROTECTION

Dual-mode Operation:

Sharing system resources requires operating system to ensurethat an incorrect program cannot cause other programs toexecute incorrectly.
• Provide hardware support to differentiate between at least twomodes of operations.
1. User mode – execution done on behalf of a user.
2. Monitor mode (also supervisor mode or system mode) –execution done on behalf of operating system.


Mode bit added to computer hardware to indicate the currentmode: monitor (0) or user (1).
• When an interrupt or fault occurs hardware switches to monitormodeuser monitorinterrupt/faultset user mode.


• Privileged instructions can be issued only in monitor mode.


I/O Protection:

->All I/O instructions are privileged instructions.

->Must ensure that a user program could never gain control ofthe computer in monitor mode (i.e., a user program that, aspart of its execution, stores a new address in the interruptvector).



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 defined range is protected.



CPU Protection:

->To prevent a user programs gets stuck in infinite loop and never returning back to the os

No comments: