Segmentation

399 views
342 views

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
399
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Segmentation

  1. 1. Segmentation Pradyumna
  2. 2. Definition• Way of offering protection to different data types and code.
  3. 3. Descriptor Tables• Descriptor table is a array of 8k Descriptors• 3 types – Global Descriptor Table (GDT) – Local Descriptor Table (LDT) – Interrupt Descriptor Table (IDT)
  4. 4. GDT&LDTGDT LDT• Contains Global descriptors • Contains descriptors specific common to all tasks to a particular task• Contains al the descriptor • Contains segment , task types except interrupt & gate & call gate descriptors. trap descriptors
  5. 5. IDT• The Interrupt Descriptor Table (IDT) is a data structure used to implement an interrupt vector table.• The IDT is used by the processor to determine the correct response to interrupts & exceptions.• Use of the IDT is triggered by three types of events: hardware interrupts, software interrupts, and processor exceptions, which together are referred to as "interrupts".• The IDT consists of 256 interrupt vectors
  6. 6. Descriptors• These carry all the info about a segment and its access rights• These have 20 bit segment limit and 32-bit segment address.• 5 types of descriptors – Code or data segment Descriptors – System Descriptors – Local Descriptors – TSS (Task State segment) Descriptors – GATE Descriptors
  7. 7. Segment descriptor• Segment descriptors are a part of the segmentation unit, used for translating a logical address to linear address. Segment descriptors describe the memory segment referred in the logical address
  8. 8. TSS• The Task State Segment is a structure which holds information about a task.• It is used by the OS kernel for task management.• Specifically, the following information is stored in the TSS: – Processor register state – I/O Port permissions – Inner level stack pointers – Previous TSS link
  9. 9. Gate Descriptors• Mechanism, for changing the privilege level of the CPU when it executes a predefined function callusing a CALL FAR instruction.
  10. 10. • BASE  Base Address of the • A Accessed Bit segment • G  Granularity Bit-1=Segment• LIMIT the length of the Length is page segment granular,0=Segment length is byte granular• P Present BIT-1=Present,0=Not Present • D  Default Operation Size-1=32 bit segment,0=16-segment• DPL  Descriptor Privilege Level 0-3 • 0  Bit must be zero for compatibility with future• S  Segment Descriptor - processors 0=System Descriptor ,1=Code or Data Segment Descriptor • AVL  Available field for user or OS• TYPE  type of segment
  11. 11. Advantages• memory protection added to segment table like paging• sharing of memory similar to paging (but per area rather than per page)
  12. 12. Drawbacks• Allocation algorithms as for memory partitions• External fragmentation, back to compaction problem.

×