codescracker


operating system os

OS Relocation and Protection



« Previous Tutorial Next Tutorial »


Relocation and protection are the two problems introduced by multiprogramming, that must be solved.

During loading, relocation doesn't solve the protection problem. A malicious program can always construct a new instruction and jump to it. Because rather than addresses relative to a register, programs in this system uses only absolute memory address.

There are no any way to stop a program from building an instruction that reads/writes word in the memory.

In multi-user computer systems, it's totally undesirable to let the processes read/write memory that belongs to the other users.

Therefore, IBM chase a solution just for protecting the 360 was to divide the memory into blocks of 2KB bytes and assign a 4bit protection code to each block of the memory.

The PSW contained a 4bit key, here PSW stands for Program Status Word.

The 360 hardware trapped any attempt by a running process to access the memory whose protection code was different form the program status word key.

Since only the OS could change the protection codes and protection key, therefore user processes were prevented form interfering with one another or with OS itself.

To equip the machine with two hardware registers (special hardware registers) called the base registers and limit registers, in an alternative solution to relocation and protection problems both.

Whenever a process is scheduled, then the base register is loaded with the address of the start of its partition, and limit register is loaded with the length of the partition.

Every memory address generated automatically has the base registers contents added to it before being sent to memory.


« Previous Tutorial Next Tutorial »




Tools
Calculator

Quick Links
Signup - Login - Give Online Test