Machine-translated by Google. Questions are authored in English.
Top

Discussion

Segmentation differs from paging in that

  • A.segments are variable in size and correspond to logical divisions of a program
  • B.segments are always smaller than pages
  • C.segmentation requires no address translation
  • D.segments cannot be swapped to disk

Answer: D

Correct answer: segments are variable in size and correspond to logical divisions of a program

Segmentation divides a program along its logical lines - code, data, stack, individual procedures, arrays - so segments vary in size. Paging divides memory into fixed-size blocks with no regard to program structure. A segmented address is a pair: a segment number and an offset within it. The segment table gives a base address and a limit, and the hardware checks the offset against the limit - which is how a segmentation fault is detected. The trade-off follows from the sizes. Because segments are variable, segmentation suffers external fragmentation but no internal; because pages are fixed, paging suffers internal but no external. Segmentation’s advantage is that protection and sharing are natural: a whole segment can be marked read-only or execute-only, and a shared library becomes one segment mapped into several processes. Paging cannot express that as cleanly, since a page has no logical meaning. Many systems combine the two, paging each segment.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.