<#2296#>
<#2296#>
<#2239#> Explanation:<#2239#>
<#2251#> Linux system descriptors:<#2251#>
<#2254#> Linux regular kernel descriptors:<#2254#> (head.S)
<#2255#> The LDT for task[0] contains:<#2255#> (sched.h)
<#2256#> The default LDT for the remaining tasks:<#2256#> (<#2257#> exec()<#2257#>)
The size of the kernel segments is 0x40000 pages (4KB pages since G=1
= 1 Gigabyte.
The type implies that the permissions on the code segment is read-exec
and on the data segment is read-write.
<#2258#> Registers associated with segmentation.<#2258#>
Format of segment register: (Only the selector is programmer
visible)
The invisible portion of the segment register is more conveniently
viewed in terms of the format used in the descriptor table entries
that the programmer sets up.
The descriptor tables have registers associated with them that are used to
locate them in memory. The GDTR (and IDTR) are initialized at startup once
the tables are defined. The LDTR is loaded on each task switch.
<#2262#> Format of GDTR (and IDTR):<#2262#>
The TR and LDTR are loaded from the GDT and so have the format of the
other segment registers. The task register (TR) contains the
descriptor for the currently executing task's TSS. The execution of a
jump to a TSS selector causes the state to be saved in the old TSS,
the TR is loaded with the new descriptor and the registers are
restored from the new TSS. This is the process used by schedule to
switch to various user tasks. Note that the field <#2266#>
tss_struct.ldt<#2266#> contains a selector for the LDT of that task. It is
used to load the LDTR. (sched.h)
TSS: P=1, DPL=0, S=0, type=9, limit = 231 room for 1 <#2252#> tss_struct<#2252#>.
LDT: P=1, DPL=0, S=0, type=2, limit = 23 room for 3 segment descriptors.
The base is set during <#2253#> fork()<#2253#>. There is a TSS and LDT for each task.
code: P=1, DPL=0, S=1, G=1, D=1, type=a, base=0xc0000000, limit=0x3ffff
data: P=1, DPL=0, S=1, G=1, D=1, type=2, base=0xc0000000, limit=0x3ffff
code: P=1, DPL=3, S=1, G=1, D=1, type=a, base=0xc0000000, limit=0x9f
data: P=1, DPL=3, S=1, G=1, D=1, type=2, base=0xc0000000, limit=0x9f
code: P=1, DPL=3, S=1, G=1, D=1, type=a, base=0, limit= 0xbffff
data: P=1, DPL=3, S=1, G=1, D=1, type=2, base=0, limit= 0xbffff