13.07.2015 Views

iAPX 286 Operating System Writers Guide 1983

iAPX 286 Operating System Writers Guide 1983

iAPX 286 Operating System Writers Guide 1983

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.

DATA SHARING, ALIASING, AND SYNCHRONIZATIONA from using the selector to reference its own LDT, but if it does so, the selector will likely refer tothe wrong descriptor. One way to avoid this potential problem is by reserving the same slot position inthe LDTs of all sharing tasks.ALIAS MANAGEMENTIn any system that uses aliases for segment sharing, the operating system must ensure that all thealiases for a given segment remain consistent in spite of changes to the segment. The operating systemmay relocate a segment, transfer it to or from secondary store, or delete the segment. If allowed to usea descriptor that had not been updated to reflect any of these changes, a task would fail and mightcause other tasks to fail. Therefore, an operating system must implement a means to find and updateall aliases for a segment when it changes anyone of the aliases.Alias DatabaseFigure 5-2 shows an example method for locating aliases. This method maintains a header block foreach segment that has aliases. Pointers to all the aliases for that segment are linked to the header. Aslong as the entire list does not span more than one segment, the link fields (FIRST, LAST, NEXT,PRIOR, and HEADER) need only contain offsets. The doubly linked list shown here aids dynamiccreation and deletion of alias pointers; for static systems, a singly linked list would suffice.In addition to the FIRST and LAST links, the list header contains that segment information that mightchange but that must remain consistent in all the aliases of a segment. <strong>Operating</strong>-system operations onsegments demand that the segment base address and the present bit be consistent. Furthermore, anyinterrogation of the accessed bit for a segment demands that the accessed bits in all the aliases beORed together. This example assumes that the operating system does not permit creation of aliaseswith differing limit or expansion direction.When a task that has a selector for an alias descriptor calls on operating system functions that makechanges to segment attributes, those changes must be broadcast to all other aliases for the segment.Therefore, the operating system must have a means, given. any descriptor, to find the alias list thatincludes that descriptor. Figure 5-3 illustrates one technique for doing this. Each descriptor table hasa parallel table of pointers to alias list headers. The index in a selector that locates a descriptor in thedescriptor table also locates a pointer in the parallel table. A descriptor that has no alias has a nullentry in the corresponding position in the parallel table. For applications in which aliases are few, youcan employ a hashing algorithm to reduce the number of entries in the parallel table.Alias ProceduresImplementation of procedures for alias management for the 80<strong>286</strong> is a straightforward application oflist processing algorithms and therefore is not illustrated here. At a minimum, the operating systemshould provide a CREATE_ALIAS procedure and a DELETE_ALIAS procedure. .The operating system must enforce a correspondence between the existence of descriptors for a segmentand the existence of the segment itself. A segment must always have a descriptor, and an activedescriptor must always point to a valid segment. A convenient way to enforce these rules is to permitonly the DELETE_ALIAS procedure to call the segment FREE procedure. DELETE_ALIAS shouldcause deletion of a segment only when the last descriptor for the segment has been deleted.Creating an alias is only the first step toward segment sharing. The CREATE_ALIAS procedure canonly create an alias for a segment that is accessible to the task that calls CREATE_ALIAS. The next5-3 121960-001

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

Saved successfully!

Ooh no, something went wrong!