Descriptor Examples

These examples come from DUMP1, which is used for several exercises.

DL 7 37
0007  Data    Bas=ac6d7000 Lim=0000ffff DPL=3 P  RO
000f  Code    Bas=00010000 Lim=00002e77 DPL=3 P  RE    A
0017  Data    Bas=00020000 Lim=0000290f DPL=3 P  RW    A
001f  Data    Bas=00030000 Lim=000018af DPL=3 P  RW    A
0027  Data    Bas=00040000 Lim=0000030a DPL=3 P  RW    A
002f  Data    Bas=00050000 Lim=00000fff DPL=3 P  RW
0036  Data    Bas=00060000 Lim=00000fff DPL=2 P  RW    A

DL BECF
bece  Code    Bas=17d90000 Lim=00000010 DPL=2 P  RE    A

DL BFD7 BFEF
bfd7  Data    Bas=17fa0000 Lim=0000ffff DPL=3 P  RW    A
bfdf  Data    Bas=17fb0000 Lim=0000ffff DPL=3 P  RW    A
bfee  Code    Bas=17fd0000 Lim=00000aa2 DPL=2 P  RE    A

DG 20 78
0020  Data    Bas=ffe5b000 Lim=000003ff DPL=0 P  RW       UV
0028  LDT     Bas=ac6d7000 Lim=0000ffff DPL=0 P
0030  Data    Bas=ffe09de4 Lim=0000421b DPL=0 P  RW ED A  UV
003b  Data    Bas=ff4cbe2c Lim=00000073 DPL=3 P  RW
0040  Data    Bas=ffe5a400 Lim=000003bf DPL=0 P  RW       UV
004a  Data    Bas=00000000 Lim=1bffffff DPL=2 P  RW    A  G4k BIG UV
0053  Data    Bas=00000000 Lim=1bffffff DPL=3 P  RW    A  G4k BIG UV
005a  Code    Bas=00000000 Lim=1bffffff DPL=2 P  RE C  A  G4k C32 UV
0063  Data    Bas=00000000 Lim=1fffffff DPL=3 P  RW       G4k BIG UV
006b  Data    Bas=00000000 Lim=1bffffff DPL=3 P  RW    A  G4k BIG UV
0070  Data    Bas=ffe22000 Lim=000074e4 DPL=0 P  RO    A
0078  Data    Bas=ffe22000 Lim=000074e4 DPL=0 P  RW

DG 148 L 4
0148  Code    Bas=fff39000 Lim=00009262 DPL=0 P  RE    A
0150  Code    Bas=fff43000 Lim=0000e137 DPL=0 P  RE    A
0158  Data    Bas=00000000 Lim=ffffffff DPL=0 P  RW    A  G4k BIG
0160  Code    Bas=00000000 Lim=ffffffff DPL=0 P  RE    A  G4k C32

The top section of the above output was created by entering the command DL 7 37

By inspecting the type, base, and limit fields in the above output, we can see the following about the descriptor referenced by 002F:

The storage is described as data having a base, or linear, address of 00050000. The linear address is not normally written with leading zeros. If there were any chance that the address might be mistaken for physical, a percent sign would be used, for example, %50000. The limit is FFF, which means that the segment is 4K, or 1000(hex) long. The privilege level is 3, the segment is present, and the flags indicate Read/Write storage. It has NOT been accessed, because the 'A' flag is not present, and OS/2 no longer uses this flag; once set by the hardware, it remains set.

Examples related to privilege level protection follow below:

  CS:IP     CPL   DS:xxxx   RPL   lesser        DPL     Access
                                 privilege    (from       allowed?
                                 CPL & RPL    descriptor)
  000F:xxxx   3   17:xxxx     3      3           3        Yes
  000F:xxxx   3   16:xxxx     2      3           3        Yes
  000F:xxxx   3   14:xxxx     0      3           3        Yes
  000F:xxxx   3   37:xxxx     3      3           2        No
  000F:xxxx   3   36:xxxx     2      3           2        No
  000F:xxxx   3   34:xxxx     0      3           2        No
  000F:xxxx   3   43:xxxx     3      3           0        No
  000F:xxxx   3   42:xxxx     2      3           0        No
  000F:xxxx   3   40:xxxx     0      3           0        No

  BECE:xxxx   2   17:xxxx     3      3           3        Yes
  BECE:xxxx   2   16:xxxx     2      2           3        Yes
  BECE:xxxx   2   14:xxxx     0      2           3        Yes
  BECE:xxxx   2   37:xxxx     3      3           2        No
  BECE:xxxx   2   36:xxxx     2      2           2        Yes
  BECE:xxxx   2   34:xxxx     0      2           2        Yes
  BECE:xxxx   2   43:xxxx     3      3           0        No
  BECE:xxxx   2   42:xxxx     2      2           0        No
  BECE:xxxx   2   40:xxxx     0      2           0        No

  0150:xxxx   0   17:xxxx     3      3           3        Yes
  0150:xxxx   0   16:xxxx     2      2           3        Yes
  0150:xxxx   0   14:xxxx     0      0           3        Yes
  0150:xxxx   0   37:xxxx     3      3           2        No
  0150:xxxx   0   36:xxxx     2      2           2        Yes
  0150:xxxx   0   34:xxxx     0      0           2        Yes
  0150:xxxx   0   43:xxxx     3      3           0        No
  0150:xxxx   0   42:xxxx     2      2           0        No
  0150:xxxx   0   40:xxxx     0      0           0        Yes

In each case, as you read across you will see that CPL comes from the value of the CS register, RPL comes from the two low-order bits of the selector, and DPL comes from the descriptor. The column titled 'lesser privilege' is calculated remembering that higher numbers are lower privilege. The final column is obtained by following the access rules, a short way back.


[Back: When Checking Is Done]
[Next: Exercise 1: Selectors and Descriptors]