• Memory protection is required to ensure that different processes do not mix with each other’s code or data.
  • Every memory address used by a process should be first checked to see whether it falls within the range of memory area that is allocated to the process.
  • Two special purpose registers-lower bound register (LBR) and upper bound register (UBR) are used to implement memory protection.
  • These registers store the start address and end address of the memory area allocated to a process.

Memory Protection

  • The kernel loads appropriate values in LBR and UBR at execution time.
  • The memory protection hardware compares every address used by a process with LBR and UBR registers.
  • If the address is smaller than the address in LBR or larger than the address in UBR, a memory protection violation interrupt is generated.
  • A page table of the process also stores memory address allocated to that process which maps logical address to its physical address to prevent from accessing any unallocated memory area to be used by that process.
  • The relocation register scheme provides an effective way to allow operating system size to change dynamically.