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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

USING HARDWARE PROTECTION FEATURESSince the GOT is shared among all tasks, its entries are usually protected. The privilege-level field ineach descriptor provides this function. When operating-system functions are distributed among andshared by all tasks, the executable segments and data segments of the operating system are normallykept in the GOT. Call gates then provide controlled access to privileged operating system functions.The processor uses the GOT automatically for certain addressing operations. The base address andlimit of the GOT are kept in the processor's GOT register. Only the LGOT instruction(RESTORE$GLOBAL$TABLE in PL/M-<strong>286</strong>) can alter the contents of the GDT register, and theLGDT instruction can be executed only at PL 0 (i.e., by the operating system).The SGDT instruction (SAVE$GLOBAL$TABLE in PL/M-<strong>286</strong>) reads the contents of the GDTregister.A GOT may contain up to 8,191 descriptors (the number of 8-byte descriptors that fit into a maximumsizedsegment of 65,536 bytes). The first entry cannot be used as a descriptor. (A null selector isidentified by the fact that it refers to this first entry in the GDT.)Interrupt Descriptor TableWhen processing an interrupt, the processor refers to the lOT to determine what interrupt-handlingcode to execute. Each interrupt is associated with an interrupt identifier, an integer that ranges from0-255. The interrupt identifier is supplied either by the INT instruction or externally by the processor'sINTA cycles. The interrupt identifier indexes an entry in the lOT. An IDT entry may be• An interrupt gate• A trap gate• A task gateIn a manner similar to executable segment and data segment descriptors, each gate descriptor has adescriptor privilege level. The DPL of a descriptor in the IDT determines the privilege required toexecute an INT n instruction (where n is the interrupt indentifier that corresponds to the descriptor).This use of privilege levels prevents unauthorized programs from invoking interrupt handlers.The processor locates the IDT by way of the IDT register. The IDT register can be changed only bythe LIDT (load lOT) instruction (RESTORE$INTERRUPUTABLE in PL/M-<strong>286</strong>). Only PL-Oprocedures (Le., the operating system) can execute an LIOT instruction.The SlOT instruction (SA VE$INTERRUPUTABLE in PL/M-<strong>286</strong>) reads the contents of the lOTregister.Refer to Chapters 6 and 7 for more detailed information on how the IDT is used.SELECTORSA selector references a segment indirectly by identifying the location in a descriptor table where adescriptor for that segment is stored.Format of SelectorSee figure 2-10 for the format of a selector.2-15 121960-001

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

Saved successfully!

Ooh no, something went wrong!