160 likes | 535 Views
Local Descriptor Table. LDTs contain descriptors which are Task Specific. LDT may contain only code, data, stack, task gate and call gate descriptors. LDTs isolates a given task's code and data segments from the rest of the OS.
E N D
Local Descriptor Table • LDTs contain descriptors which are Task Specific. • LDT may contain only code, data, stack, task gate and call gate descriptors. • LDTs isolates a given task's code and data segments from the rest of the OS. • Unlike the 6 byte GDT or IDT registers, the visible portion of LDT register contains only a 16-bit selector. • This selector refers to a Local Descriptor Table Descriptor in the GDT.
Interrupt Descriptor Table • IDT contains descriptors to point to the location of up to 256 interrupt service routines. • IDT should be atleast256 bytes to hold 32 Intel Reserved Interrupts(32*8) • Every interrupt used must have an entry in IDT. • IDT entries are referenced via INT instructions, external interrupt vectors and exceptions. • Interrupts handle asynchronous external events(eg.pressing a key) and exceptions handle instruction faults (e.g. page permission fault)
Descriptors • The object to which the segment selector points to is called a descriptor. • Descriptors are 8 byte quantities which contain 32 bit base address, 20-bit limit and attributes (12 bits) about a given segment.
General Format of a Descriptor UQ: Write short note on structure of segment descriptor field
General Format of a Descriptor • All segments have 3 attribute fields in common: the P-bit, the DPL bit and the S-bit. • P-bit : P=1 segment is loaded in physical memory. If P=0, then exception 11
General Format of a Descriptor • DPL-bit: 2-bit field which specifies the protection level 0-3 associated with a segment. • There are two main categories of segments: system segments and non-system segments( for code and data) • S-bit: S=1 non-system segment. S=0 system segment
Non-system segment descriptor • G-bit (Granularity Bit): It specifies if a segment length is byte granular or page granular. • G = 0 byte granular (max 1MB) segment size may be 1, 2, ..., 220 bytes G = 1 page granular (max 4GB) segment size may be 1 × 212,2 × 212,...,220 ×212 bytes
Non-system segment descriptor • D-bit : It indicates default length for operands and effective addresses. • D = 1 32-bit operands and 32-bit addressing modes D = 0 16-bit operands and 16-bit addressing modes
Non-system segment descriptor • B-bit : It indicates size of stack pointer • B = 1 32-bit ESP register B = 0 16-bit SP register