1 / 11

Segmentation

Segmentation. Segmentation provides the basis of protection which encapsulates regions of memory which have common attributes. All information about a segment is stored in an 8-byte data structure called a descriptor . All descriptors are contained in tables recognized by hardware. 1.

phyre
Download Presentation

Segmentation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Segmentation • Segmentation provides the basis of protection which encapsulates regions of memory which have common attributes. • All information about a segment is stored in an 8-byte data structure called a descriptor. • All descriptors are contained in tables recognized by hardware. 1

  2. Selector (Segment Register) • A selector in protected mode has 3 fields: • TI (Table Indicator): Local or Global Descriptor Table Indicator • Index(Descriptor Entry Index ): Selects one of 8K descriptors • RPL (Requestor Privilege Level): allows testing of selector’s privilege attributes • Level 0: Most Privilege Level • Level 3: Least Privilege Level 2

  3. Selector 3

  4. Descriptor Tables • It defines all the segments used in x86 system • There are 3 types of table: • Global Descriptor Table(GDT) • Local Descriptor Table(LDT) • Interrupt Descriptor Table(IDT) • All tables are variable length memory arrays • They can range in size from 8 bytes to 64KB (213 x 23) (3 bits are implied as descriptor size is fixed)

  5. Descriptor Tables • Each table can hold up to 8192(213) 8-byte descriptors. • The table has registers associated with them named GDTR, LDTR and IDTR which hold the 32-bit linear base address and 16-bit limit of each table. • These tables are manipulated by the OS using privileged instructions.

  6. Global Descriptor Table • It contains descriptors which are possibly available to all of the tasks in a system. • Every Intel386 DX system contains a GDT. • It contains code and data segments used by the operating systems and task state segments and descriptors for the LDTs in a system. • The first slot of GDT corresponds to the null selector and is not used.

  7. Global Descriptor Table Register

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

  9. Local Descriptor Table Register

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

  11. Interrupt Descriptor Table

More Related