Pip
Architecture-dependent parts of Pip: MAL, IAL and boot
Data Fields
segment_descriptor_s Struct Reference

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...
 

Detailed Description

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 :

G = 0 => range from 1 byte to 1 MByte, in byte increments.

G = 1 => range from 4 KBytes to 4 GBytes, in 4-KByte increments.

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.

Field Documentation

◆ avl

unsigned segment_descriptor_s::avl

Available for use by system software.

◆ base_high

unsigned segment_descriptor_s::base_high

Higher bits of base address (bits 31..24)

◆ base_low

unsigned segment_descriptor_s::base_low

Lower bits of base address (bits 15..0)

◆ base_middle

unsigned segment_descriptor_s::base_middle

Middle bits of base address (bits 23..16)

◆ d_b

unsigned segment_descriptor_s::d_b

default operation size (0 => 16-bit, 1 => 32-bit)

◆ dpl

unsigned segment_descriptor_s::dpl

Descriptor privilege level.

◆ granularity

unsigned segment_descriptor_s::granularity

granularity (see 2/ in above comment)

◆ l

unsigned segment_descriptor_s::l

Long? flag (only useful in IA-32e) 64 bits code segment.

◆ limit_high

unsigned segment_descriptor_s::limit_high

Higher bits of the size of the segment (bits 19..16)

◆ limit_low

unsigned segment_descriptor_s::limit_low

Lower bits of the size of the segment (bits 15..0)

◆ present

unsigned segment_descriptor_s::present

Preset flag (validity of descriptor)

◆ s

unsigned segment_descriptor_s::s

0 => system segment, 1 => code or data segment (see 3/)

◆ type

unsigned segment_descriptor_s::type

See below defines.


The documentation for this struct was generated from the following file: