iAPX 286 Operating System Writers Guide 1983
iAPX 286 Operating System Writers Guide 1983
iAPX 286 Operating System Writers Guide 1983
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
VIRTUAL MEMORY• TSSs that point to present LDTs. (You cannot switch to a task and use its LDT without referringto its TSS.)• TSSs whose NT (nested task) flag is set.Certain operating-system kernel segments that are frequently referenced (for example, the segmentor segments containing the scheduler's queues). (<strong>System</strong> performance may degrade excessively.)Segments belonging to the swapping managers.I/0 buffers that are in use by an external device.Executable segments that contain the entry point of an exception handler. (An exception wouldresult in a double fault.)Note that, while the <strong>iAPX</strong> <strong>286</strong> does offer mechanisms that support swapping of TSSs and LDTs, doingso is likely to cause not-present faults in PL-O procedures and to cause unacceptable delays in invokinginterrupt tasks that are not present. For either of these reasons, the designers of an operating systemmay elect not to swap out TSSs and LDTs.Swapping ManagersSwapping managers may need to distinguish between two classes of segments:Segments of a task superstructure (the TSS, the task database (TDB), and possibly the level-zerostack segment)Segments not part of a task superstructureSwapping of the task superstructure requires that swapping managers be aware that the kernel maytreat the TSS as a "subsegment" of the TDB, which may itself reside within the level-zero stack (asoutlined in Chapter 4). The swapping managers should treat these segments as a unit.Considering the complexities associated with swapping the segments of the task superstructure, it isperfectly reasonable for an operating system to simplify its virtual-memory subsystem by leaving thosesegments in RAM for the duration of the task.OUT-SWAPPERThe out-swapper works best as a separate task; when the out-swapper must wait for the swapping·device I/0 driver to write a segment, other tasks can continue to run, including the task whose segmentis being swapped out.The out-swapper's responsibility is toMark all the descriptors for the segment "not present." The out-swapper must ensure that the presentbits in all descriptors for a segment always appear consistent. It must use a semaphore or region toprevent other access to the aliases while it is changing present bits.Copy the swap-space address into all the descriptors for the segment (or possibly, depending onalias implementation, into a "master descriptor" that is linked to other descriptors).Create a temporary data-segment descriptor to give the swapper the right to read the segment. Theoperating system must not move or delete this segment until the out-swapper is finished with it.Write the segment to the swap-space allocated for it (but only if the segment is writable ana itsaccessed bit is set).9-4 121960-001