• When executing in kernel mode, the operating system has unrestricted access to both kernel and user’s memory.
• The load instructions for the base and limit registers are privileged instructions.
DUAL OPERATION
• Mode bit added to computer hardware to indicate the current mode: kernel (0) or user (1).
• When an interrupt or fault occurs hardware switches to kernel mode.
I/O PROTECTION
• All I/O instructions are privileged instructions.
• Given the I/O instructions are privileged, how does the user program perform I/O?
• System call – the method used by a process to request action by the operating system.
– Usually takes the form of a trap to a specific location in the interrupt vector.
– Control passes through the interrupt vector to a service routine in the OS, and the mode bit is set to kernel mode.
– The kernel verifies that the parameters are correct and legal, executes the request, and returns control to the instruction following the system call.
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 that determine the range of legal addresses a program may access:
– base register – holds the smallest legal physical memory address.
– Limit register – contains the size of the range
• Memory outside the defined range is protected.
CPU PROTECTION
• Timer – interrupts computer after specified period to ensure operating system maintains control.
– Timer is decremented every clock tick.
– When timer reaches the value 0, an interrupt occurs.
• Timer commonly used to implement time sharing.
• Time also used to compute the current time.
• Load-timer is a privileged instruction.
.....MAHAL KITA PERO MAS MAHAL KO ANG SARILI KO!!!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment