80386 System Tables

a reference page in our series on How to Write an Operating System

System Descriptor Types

1available 16-bit TSSSystem segment
2LDTSystem segment
3active 16-bit TSSSystem segment
416-bit Call GateGate
5Task GateGate
616-bit Interrupt GateGate
716-bit Trap GateGate
9available 32-bit TSSSystem segment
11active 32-bit TSSSystem segment
1232-bit Call GateGate
1432-bit Interrupt GateGate
1532-bit Trap GateGate

Task State Segment

Most of the fields in the TSS mirror the 32-bit register set.
MSW (upper 16 bits)LSW (lower 16 bits)Offset
I/O Map Base T+100 (64h)
0LDTR+96 (60h)
0GS selector+92 (5ch)
0FS selector+88 (58h)
0DS selector+84 (54h)
0SS selector+80 (50h)
0CS selector+76 (4ch)
0ES selector+72 (48h)
EDI+68 (44h)
ESI+64 (40h)
EBP+60 (3ch)
ESP+56 (38h)
EBX+52 (34h)
EDX+48 (30h)
ECX+44 (2ch)
EAX+40 (28h)
eFlags +36 (24h)
EIP+32 (20h)
CR3 (PDBR) +28 (1ch)
0SS for CPL2+24 (18h)
ESP for CPL2+20 (14h)
0SS for CPL1+16 (10h)
ESP for CPL1+12 (0ch)
0SS for CPL0+8 (08h)
ESP for CPL0+4 (04h)
0Backlink+0 (00h)