0
25kviews
Various ways of memory and address protection.
1 Answer
4
1.3kviews
  • Memory protection includes protection for the memory that the OS itself uses as well as the memory of user processes. Major challenge in multi-programming system is to prevent one program from affecting the data and programs in the memory space of other users.
  • The various methods for memory and address protection are:

i. Fence:

  • A fence or fence address is simplest form of memory protection which can be used only for single user operating system.
  • A fence is a particular address that users and their processes cannot cross. Only the OS can operate on one side of the fence and users are restricted to the other side.
  • A fence could be static, in which case there is a fixed fence address. Alternatively, a dynamic fence can be used, which can be implemented using a fence register to specify the current fence address.

ii. Base and Bounds registers:

  • This type of protection can be used in multi- user environment where one users program needs to be protected from the other.
  • Each user has a base register which is the lower address and a Bound register which is the upper address limit.
  • The base and bounds register approach implicitly assumes that the user or process space is contiguous in memory. The OS must determine what protection to apply to a specific memory location.
  • In some cases it might be sufficient to apply the same protection to all of a user's memory.
  • The disadvantage is that the registers confine access to consecutive range of addresses.

iii. Tagging:

  • This specifies the protection for each individual address. In this method of protection every word of machine memory has one or more extra bits to identify the access rights to that word.
  • Only privileged instructions can set these access bits. While this is as fine-grained protection as possible, it introduces significant overhead.
  • The overhead can be reduced by tagging sections of the address space instead of each individual address. Another drawback to tagging is compatibility, since tagging schemes are not in common use.

iv. Segmentation:

  • This method divides the memory into logical units such as individual procedures or the data in one array.
  • Once they are divided, appropriate access control can be enforced on each segment.
  • A benefit of segmentation is that any segment can be placed in any memory location provided the location is large enough to hold it. The OS must keep track of the locations of all segments, which is accomplished using <segment,offset> pairs, where the named segment specifies the segment, and the offset is the starting address of the specified segment.
  • With segmentation, all address references must go through the OS, so the OS can, in this respect, achieve complete mediation. Depending on the access control applied to particular segments, users can share access to some segments or users can be restricted to specific segments.

v. Paging:

  • Paging discards the disadvantage of segmentation. In paging all segments are of a fixed size called as pages and the memory divided is known as page frames.
  • In paging a particular page can be accessed using a pair of the form <page, offset=""> where page is the page number and offset is location within a page.
  • The advantages of paging over segmentation include no fragmentation, improved efficiency, and the fact that there are no variable sizes to worry about.
  • The disadvantages are that there is, in general, no logical unity to pages, which makes it more difficult to determine the proper access control to apply to a given page.
Please log in to add an answer.