Intel 80386 DJ Equipment User Manual


 
inter
80386
4.3.3.2 GLOBAL DESCRIPTOR TABLE
The Global Descriptor Table (GDT) contains de-
scriptors which are possibly available to all of the
tasks
in
a system. The GDT can contain any type
of
segment descriptor except for descriptors which are
used for servicing interrupts
(Le.
interrupt and trap
descriptors). Every
3B6
system contains a GDT.
Generally the GDT contains code and data
seg-
ments used by the operating systems and task state
segments, and descriptors for the
LDTs
in
a system.
The first slot of the Global Descriptor Table
corre-
sponds to the null selector and
is
not used. The null
selector defines a null pointer value.
4.3.3.3 LOCAL DESCRIPTOR TABLE
LDTs
contain descriptors which are associated with
a given task.
Generally, operating systems are de-
signed so that each task has a separate
LDT.
The
LDT
may contain only code, data, stack, task gate,
and
call gate descriptors. LDTs provide a mecha-
nism
for isolating a given task's code and data seg-
ments from the rest of the operating system, while
the GDT contains descriptors for segments which
are common to
all tasks. A segment cannot
be
ac-
cessed by a task if its segment descriptor does not
exist
in
either the current LDT or the GDT. This pro-
vides both isolation and protection for a task's seg-
ments, while still allowing global data to
be
shared
among tasks.
Unlike the 6 byte GDT or
IDT registers which contain
a base address and limit, the visible portion of the
LDT register contains only a 16-bit selector. This
se-
lector refers to a Local Descriptor Table descriptor
in
the
GDT.
31
4.3.3.4 INTERRUPT DESCRIPTOR TABLE
The third table needed for
B03B6
systems
is
the
In-
terrupt Descriptor Table. (See Figure 4-4.) The IDT
contains the descriptors which point to the location
of
up
to 256 interrupt service routines. The IDT may
contain only task gates, interrupt gates, and trap
gates. The
IDT should be at least 256 bytes
in
size
in
order to hold the descriptors for the 32 Intel Re-
served Interrupts. Every interrupt used by a system
must have an entry
in
the
IDT.
The IDT entries are
referenced via
INT instructions, external interrupt
vectors, and exceptions.
(See
2.9 Interrupts).
I
32
CPU S
" 0
~
lOT
BASE
0
"\,
MEMORY
"\.,.,
r
~
GATE
FOR
INTERRUPT
#n
GATE
FOR
INTERRUPT #n·1
·
·
·
GATE
FOR
INTERRUPT #1
GATE
FOR
INTERRUPT
#0
-C
~
INTERRUPT
DESCRIPTOR
TABLE
(IDT)
231630-58
Figure 4-4. Interrupt Descriptor
Table Register Use
4.3.4 Descriptors
4.3.4.1 DESCRIPTOR ATTRIBUTE BITS
The object to which the segment selector points to
is
called a descriptor. Descriptors are eight byte
quantities which contain attributes about a given
re-
gion of linear address space
(Le.
a segment). These
o BYTE
ADDRESS
SEGMENT BASE 15
...
0 SEGMENT LIMIT 15
...
0
o
BASE
31
...
24 G D 0
0
LIMIT
P
DPL
S TYPE A
BASE
19
...
16
I I I
23
...
16
+4
BASE
Base
Address of the segment
LIMIT
The
length of the segment
P Present
Bit
1 = Present 0 = Not Present
DPL
Descriptor Privilege
Level
0-3
S Segment Descriptor 0 = System Descriptor 1 =
Code
or
Data
Segment Descriptor
TYPE
Type
of Segment
A Accessed Bit
G
Granularity Bit t = Segment length is
page
granular 0 = Segment length is byte granular
D Default Operation
Size
(recognized
in
code segment descriptors only) 1 = 32·bit segment 0 = 16·bit segment
o Bit must
be
zero
(0)
for compatibility
with
future processors
Figure 4·5. Segment Descriptors
36