Next: Segment descriptors
Up: 80386 Memory Mangament
Previous: Segments in the 80386
A segment selector is loaded into a segment register (cs, ds, etc.) to
select one of the regular segments in the system as the one addressed
via that segment register.
Segment selector Format:
- Table indicator:
0 means selector indexes into GDT
1 means selector indexes into LDT
- Privelege level. uses only two privelege levels.
0 means kernel
3 means user
- Kernel code segment
TI=0, index=1, RPL=0, therefore selector = 0x08 (GDT)
- User data segment
TI=1, index=2, RPL=3, therefore selector = 0x17 (LDT)
Selectors used in :
Selectors for system segments are not to be loaded directly into
segment registers. Instead one must load the TR or LDTR.
On entry into syscall:
- ds and es are set to the kernel data segment (0x10)
- fs is set to the user data segment (0x17) and is used to access
data pointed to by arguments to the system call.
- The stack segment and pointer are automatically set to ss0 and
esp0 by the interrupt and the old values restored when the syscall returns.
Mon Apr 1 10:20:16 EST 1996