(3) Hardware Protection


  • Dual Mode Operation

• Sharing system resources requires operating system to ensurethat an incorrect program cannot cause other programs toexecute incorrect

• 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.

  • I/O Protection
• All I/O instructions are privileged instructions.
• Must ensure that a user program could never gain control of the 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