Pip
Architecture-dependent parts of Pip: MAL, IAL and boot
|
Meant to be written inside the GDT. Provides the processor with the size and location of a segment, as well as access control and status information. More...
#include <gdt.h>
Data Fields | |
unsigned | limit_low: 16 |
Lower bits of the size of the segment (bits 15..0) More... | |
unsigned | base_low: 16 |
Lower bits of base address (bits 15..0) More... | |
unsigned | base_middle: 8 |
Middle bits of base address (bits 23..16) More... | |
unsigned | type: 4 |
See below defines. More... | |
unsigned | s: 1 |
0 => system segment, 1 => code or data segment (see 3/) More... | |
unsigned | dpl: 2 |
Descriptor privilege level. More... | |
unsigned | present: 1 |
Preset flag (validity of descriptor) More... | |
unsigned | limit_high: 4 |
Higher bits of the size of the segment (bits 19..16) More... | |
unsigned | avl: 1 |
Available for use by system software. More... | |
unsigned | l: 1 |
Long? flag (only useful in IA-32e) 64 bits code segment. More... | |
unsigned | d_b: 1 |
default operation size (0 => 16-bit, 1 => 32-bit) More... | |
unsigned | granularity: 1 |
granularity (see 2/ in above comment) More... | |
unsigned | base_high: 8 |
Higher bits of base address (bits 31..24) More... | |
Meant to be written inside the GDT. Provides the processor with the size and location of a segment, as well as access control and status information.
1/ Base addresses must be 16-bits aligned to maximize performance 2/ Limit field's (size of segment) behaviour depends on the granularity flag :
3/ The "s" field should always be 1, system segments are either LDT, TSS, Callgate, Interrupt-gate, Trap-gate, or Task-gate descriptors, which have their own structs.
Intel 64 and IA-32 Architectures Software Developer's Manual - Vol. 3a - Sec. 3.4.5 and Fig. 3-8.
unsigned segment_descriptor_s::avl |
Available for use by system software.
unsigned segment_descriptor_s::base_high |
Higher bits of base address (bits 31..24)
unsigned segment_descriptor_s::base_low |
Lower bits of base address (bits 15..0)
unsigned segment_descriptor_s::base_middle |
Middle bits of base address (bits 23..16)
unsigned segment_descriptor_s::d_b |
default operation size (0 => 16-bit, 1 => 32-bit)
unsigned segment_descriptor_s::dpl |
Descriptor privilege level.
unsigned segment_descriptor_s::granularity |
granularity (see 2/ in above comment)
unsigned segment_descriptor_s::l |
Long? flag (only useful in IA-32e) 64 bits code segment.
unsigned segment_descriptor_s::limit_high |
Higher bits of the size of the segment (bits 19..16)
unsigned segment_descriptor_s::limit_low |
Lower bits of the size of the segment (bits 15..0)
unsigned segment_descriptor_s::present |
Preset flag (validity of descriptor)
unsigned segment_descriptor_s::s |
0 => system segment, 1 => code or data segment (see 3/)
unsigned segment_descriptor_s::type |
See below defines.