13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

70 Space Management Chapter 3would be otherwise, because not only must the status of the destination overlay be examined,but it may also have to be brought into virtual store.One could place every procedure in its own overlay. Instead, the programmermight specify the overlay structure in order to keep the number of cross-overlay calls to aminimum and to make sure that overlays that do call each other can be placed simultaneouslyin virtual store.Compilers can be of great assistance, too. Algol-like languages are especiallysuited to overlays because the hierarchical nature of name scopes means that during executionof any one procedure, only variables local to that procedure or to enclosing procedurescan be accessed. Therefore, each procedure can be given an overlay that starts invirtual store right after all the overlays for its enclosing procedures. They will all be instore at the same time, but other procedures at the same level will be absent.Unfortunately, overlays will often be swapped out when room is still available invirtual store, because some other overlay that must reside at the same location has beenaccessed. Overlays work well only in applications where the execution of the programgoes through well-defined phases, each of which requires different program units.Thrashing can result from the inappropriate use of overlays.3 SINGLE SEGMENTThe DEC PDP-10 and CDC 6600 computers generalize fixed partitions by allowing theirboundaries to move dynamically. We will call each region a segment. Figure 3.6 showsprocesses A and B each using a segment of main store. A’s segment starts at 20K andruns exactly 13K, the length of A’s virtual space. B’s segment starts at 42K and runsexactly 10K, which is what B needs.As with the partition method, each process has a virtual space of exactly one segment.Unlike the partition method, virtual addresses within the segment begin at zeroand continue to some maximum. The hardware must therefore translate each access.The size of the segment is determined by the storage manager of the operating system;programs that require more space are given longer segments.3.1 MechanismInstead of forcing boundaries to lie on chunk boundaries, a region can start anywhere.This flexibility means that storage keys are no longer a reasonable protection mechanismbecause each word in physical store would need its own lock. The fact that virtualaddresses are different from physical addresses provides a more reasonable implementationfor protection. Instead of examining each physical (that is, translated) address to seeif it is legal by consulting a physical-store descriptor table, the hardware can examineeach virtual address by consulting a virtual-store descriptor table. Legal virtualaddresses must lie between zero and the largest address in virtual space.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!