GATE and Gate Descriptor Format

Posted By on October 25, 2014


Download PDF
Recursive Procedures
Virtual Memory

Gate specifies an exactly defined point of re-entry point into a more highly privileged routine.

Gate descriptor format

The fields P (“Praesenz”bit) and DPL (“Descriptor Privilege level”) possess the same function as the appropriate fields of a segment descriptor. If the p-bit is set, the described segment (and/or the subroutine described by the gate) is momentarily in the memory. The DPL limits the access to the descriptor by programs (and/or tasks). That access is permitted only if the DPL of the descriptor numerically larger or equal the Current Privilege level is (“CPL “= DPL of the current code segment), i.e., which must appropriate gate a smaller or the same privilege stage as its Aufrufer to possess. If that is not the case, the processor reacts with the attempt to use the gate with an exception.

As was mentioned already further above, the neglected “Segment” bit marks the descriptor as system segment descriptor. Over 4 bits the long type field can be differentiated then between gate descriptors and special system descriptors. Further the value of the type field over decides whether it concerns with the respective descriptor a 80286 or 80386 gate descriptor. For example the 80286 the fourth word of the descriptor (offset address, bit 16,,31) does not use, since 16 bits an offset address is sufficient due to the restriction 80286 on only 24 address lines.

Table gives an overview of all possible system segment types. All grey colored descriptor types belong to the group of the special system segments, it become under point: 3 special Protected mode functions more near regards.

Worth binary Description
0 0000b unused, invalidly
1 0001b 80286-tss
2 0010b LDT
3 0011b active 80286-tss
4 0100b 80286 call gate
5 0101b Task gate
6 0110b 80286 interrupts gate
7 0111b 80286 Trap gate
8 1000b reserved
9 1001b 80386-tss
10 1010b reserved
11 1011b active 80386-tss
12 1100b 80386 call gate
13 1101b reserved
14 1110b 80386 interrupts gate
15 1111b 80386 Trap gate

Table : possible system segment types

 

Beispiel The following structure represents a gate descriptor:

  gate_deskriptor:  dw 0200h;  Offset, bit 0,,15 dw 8;  Code segment lector railways 0;  not used railways 10101111b;  "Praesenz" bits, DPL and segment type dw 0;  Offset, bit 16..31 

Which type of gate descriptor does it concern and which destination address defines itself?

The described destination address (the address of the subroutine) results from first the two, as well as the fourth word to the Selektor:Offset pair 8:00000200h.

From the value of the byte with high order of the third word (10101111b) results:

  • The segment, in which the addressed routine is, is momentarily in the memory available (“Praesenz”bit = 1).
  • The field DPL possesses a value of 01b, i.e. a program, which uses this gate, needs at least a CPL of 1 (i.e. the privilege stage 1 or 0).
  • The type field possesses the value 1111b, it concerns thus 80386 Trap a gate.

Recursive Procedures
Virtual Memory

Download PDF

Posted by Akash Kurup

Founder and C.E.O, World4Engineers Educationist and Entrepreneur by passion. Orator and blogger by hobby

Website: http://world4engineers.com