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.

USING HARDWARE PROTECTION FEATURESPL/M-<strong>286</strong> COMPILER 960-505 date PAGE 1system-ID PL/M-<strong>286</strong> Vx.y COMPILATION OF MODULE POINTOBJECT MODULE PLACED IN :Fl:POINT.OBJCOMPILER INVOKED BY: PLM<strong>286</strong>.86 :Fl:POINT.PLM$ PAGEWIDTH(71) TITLE('960-505') INCLUDE (:Fl:NUCSUB.PLM)$ NOLIST1POINT:DO;234111/*******************************************************//* Global declarations. */DECLARE DESC STR LITERALLY'LIMIT WORD,LO BASE WORD, /* Format of a descriptor. */HI-BASE BYTE,RIGHTS BYTE,SW RESRVD WORD' ;DECLARE DT SIZE LITERALLY '200',GDTA SEL SELEC,TOR, /* Points to GDT alias */GDTA-WSEL WORD AT (@GDTA SEL)INITIAL (8); /* Slot #1 by convention */GDT BASED GDTA SEL (DT SIZE)STRUCTURE (OESC_STR);/*******************************************************//* Subroutine to determine either the alias for *//* the GDT or the alias for this task's LDT~ *//* depending on the TI bit in SEL. */FIND_DT_ALIAS: PROCEDURE (SEL) SELECTORPUBLIC REENTRANT;5622DECLARE SELWSELDECLARE LDT SELLDT-WSELSELECTOR,WORD AT (@SEL);SELECTOR,WORD AT (@LDT_SEL);789101112131422233332IF (WSEL AND 0004H)~0THEN /* It's a selector to the GDT. */RETURN GDTA_SEL;ELSE DO; /* It's a selector to this task's LDT. */LDT SEL=LOCAL$TABLE; /* PL/M <strong>286</strong> built-in; stores aselector to the GDT descriptor for this task's LDT. */LDT WSEL=LDT WSEL+8; /* Add 1 to index field. *//* By convention, next slot holds alias. */RETURN LDT_SEL;END;END FIND_DT_ALIAS;$ EJECTFigure 2-16. Descriptor Manipulation Example2-23 121960-001

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

Saved successfully!

Ooh no, something went wrong!