Segment Descriptor Segments are areas of memory defined by a programmer and can be a code, data or stack segment. In 80386 segments need not be all the.

Slides:



Advertisements
Similar presentations
Memory Management Unit
Advertisements

Types of Code Segments Conforming Code Segment
1/1/ / faculty of Electrical Engineering eindhoven university of technology Memory Management and Protection Part 3:Virtual memory, mode switching,
Memory Management Paging &Segmentation CS311, CS350 & CS550.
Unit 4 Chapter-1 Multitasking. The Task State Segment.
16.317: Microprocessor System Design I
4/14/2017 Discussed Earlier segmentation - the process address space is divided into logical pieces called segments. The following are the example of types.
Intel MP.
CSC 322 Operating Systems Concepts Lecture - 18: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
X86 segmentation, page tables, and interrupts 3/17/08 Frans Kaashoek MIT
Memory Management (II)
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Fall 2012 Lecture 15: Protected mode intro.
UNIT 2 Memory Management Unit and Segment Description and Paging
Intel
80386DX.
Intel MP (32-bit microprocessor) Designed to overcome the limits of its predecessor while maintaining the software compatibility with the.
Address Translation Mechanism of 80386
Microprocessor system architectures – IA32 segmentation Jakub Yaghob.
The Pentium Processor.
The Pentium Processor Chapter 3 S. Dandamudi To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer,
The Intel Microprocessors. Real Mode Memory Addressing Real mode, also called real address mode, is an operating mode of and later x86-compatible.
Multitasking Mr. Mahendra B. Salunke Asst. Prof. Dept. of Computer Engg., STES SITS, Narhe, Pune-41 STES Sinhgad Institute of Tech. & Science Dept. of.
CS 6560 Operating System Design Lecture 8: Memory Management.
CSC 660: Advanced Operating SystemsSlide #1 CSC 660: Advanced OS Memory Addressing / Kernel Modules.
System Address Registers/Memory Management Registers Four memory management registers are used to specify the locations of data structures which control.
80386DX.
1 i386 Memory Management Professor Ching-Chi Hsu 1998 年 4 月.
Virtual 8086 Mode  The supports execution of one or more 8086, 8088, 80186, or programs in an protected-mode environment.  An 8086.
EFLAG Register of The The only new flag bit is the AC alignment check, used to indicate that the microprocessor has accessed a word at an odd.
Microprocessor system architectures – IA32 tasks Jakub Yaghob.
80386DX.
D P L s G D X U P Segment Descriptor A T Y P E
1 Microprocessors CSE Protected Mode Memory Addressing Remember using real mode addressing we were previously able to address 1M Byte of memory.
Page Replacement Implementation Issues Text: –Tanenbaum ch. 4.7.
Lecture 5 Rootkits Hoglund/Butler (Chapters 1-3).
Information Security - 2. Memory Segmentation Segment Descriptors – to In 8086, the program is not expected to generate a non- existent memory.
Microprocessor and Assembly Language Addressing Models
Information Security - 2. Task Switching Every process has an associated Task State Segment, whose starting point is stored in the Task register. A task.
Memory Management Unit and Segment Description and Paging
Information Security - 2. Descriptor Tables Descriptors are stored in three tables: – Global descriptor table (GDT) Maintains a list of most segments.
OS Memory Addressing. Architecture CPU – Processing units – Caches – Interrupt controllers – MMU Memory Interconnect North bridge South bridge PCI, etc.
Privilege Check for Control Transfer(Code Access) Control transfers (except interrupts) are accomplished by the instructions JMP, CALL, and RET The "near"
Chapter 2 Instruction Addressing and Execution. Lesson plan Review some concepts in the first week First assembly program with EMU8086 Related concepts.
Microprocessor Systems Design I
32- bit Microprocessor-Intel 80386
Protection in Virtual Mode
Descriptor Table & Register
Memory Management Paging (continued) Segmentation
16.317: Microprocessor System Design I
MICROPROCESSOR BASED SYSTEM DESIGN
COMBINED PAGING AND SEGMENTATION
Microprocessor Systems Design I
Microprocessor Systems Design I
Anton Burtsev February, 2017
Privilege Levels.
Address Translation Mechanism of 80386
Protection UQ: Explain the protection mechanism of X86 Intel family microprocessor(10 Marks)
x86 segmentation, page tables, and interrupts
System Segment Descriptor
Page Replacement Implementation Issues
Operating Modes UQ: State and explain the operating modes of X86 family of processors. Show the mode transition diagram highlighting important features.(10.
Memory Management Paging (continued) Segmentation
CS 301 Fall 2002 Computer Organization
Page Replacement Implementation Issues
Lecture 36 Syed Mansoor Sarwar
Architectural Support for OS
Lecture 37 Syed Mansoor Sarwar
Architectural Support for OS
Assembly Language for Intel-Based Computers, 5th Edition
Memory Management Paging (continued) Segmentation
Presentation transcript:

Segment Descriptor

Segments are areas of memory defined by a programmer and can be a code, data or stack segment. In segments need not be all the same size and aligned. And segments need not be exactly 64 KB long, but we can define them to be any length from 1 byte to 4 GB. In memory segmentation, it is not possible to use a 16-bit segment register to represent all the information related to segment. When multiple privilege levels and intertask protection are required a special structure called a segment descriptor is used.

Segment Descriptor The description of a segment includes its base address, length, type, privilege level and some security information. The lower base address is specified in bits 16 to 39 and upper 8 bits are specified in bits 56 to 63. The lower 16 bits of segments limit are specified in 0-15 and the remaining 4 bits are specified in

Types of segment descriptors

Non System Segment descriptors Defines data, code, stack segments. Used by both system and application programs. S=1 in access right byte.

Descriptors

Non System Segment descriptors P bit indicates whether segment is present in memory or not. P = 0 -> Segment is not present and P = 1-> Segment is present. DPL: defines privilege level of the segment. Used to protect segment from low privilege caller.

Non System Segment descriptors S: Used to distinguish between non system segment and system segment descriptors. S = 1-> Non system segment descriptor. E: Executable; Used to distinguish between data and code segments. E=0 -> Data segment including stack. E = 1 -> Code segment. ED/C: Expand direction/conforming; When E=0, then this bit functions as ED, ED indicates whether the segment is data or stack. ED = 0 -> Data segment( access segment randomly). Offset address  limit. ED = 1 -> Stack segment LIFO.

Non System Segment descriptors When E =1, then this bit functions as C ( conforming) bit. Used to distinguish between conforming and nonconforming code segments. C= 0 -> Non conforming code segment. C = 1 -> Conforming code segment. R/W Read/Write. When E= 0( data segment), then this bit functions as W bit. This bit indicates whether data segment is writable or not. W = 0 -> data segment is not writable. W= 1 -> data segment is writable.

Non System Segment descriptors When E =1 (code segment) then this bit functions as R bit. This bit indicates whether code segment is readable or not. R = 0 -> code segment is not readable and R = 1 -> code segment is readable. A: Accessed; This bit indicates whether the segment is accessed or not. A= 1 -> Segment accessed. This bit is reset by OS periodically. A= 0 -> Segment not accessed

System Segment descriptor Type All system descriptors are present in GDT while some system descriptors are present in LDTs. Normally system segment descriptor are used by OS. The value of S in right access byte is 0. Their functions are fixed and specified by Intel. The type of system descriptor is indicated by type field. The system segment descriptors have no Accessed bit, instead the type field (3 bits) is now extended to 4 bits. The system segment descriptors contain the information about tables (LDT), tasks(TSS) and gates (call gate, interrupt gate, task gate, trap gate) of the OS.

System descriptors

LDT descriptor (s=0, Type 2)

The LDT descriptors are present in the GDT. They contain the information about the LDT. LDT contains the segment descriptors that are unique to a particular task. The DPL field of the descriptor is ignored as this descriptor can only be accessed with a privilege level of 0. Here type field =2 i.e. it specifies a LDT descriptor.

TSS (Task State Segment) Descriptors (s=0, Type 1, 3, 9 and B) Whenever a computer is performing more than one tasks at a time it may also switch between these tasks. The task may be a single program or a group of program. When one task switches to another task, it stores all the necessary information required to restart the task where it was left. This information is called as the “ state of the task” For storing the state of the task the processor uses a special segment called the “Task State Segment (TSS)”

TSS (Task State Segment) Descriptors (s=0, Type 1, 3, 9 and B) The task segment is addressed with the help of TSS descriptor. It contains information about the location, size and privilege level of a TSS. A TSS descriptor appears only in GDT and not in IDT or LDT. The TSS consists the linkage field for the nest task that permits the nesting of the tasks.

TSS (Task State Segment) Descriptors (s=0, Type 1, 3, 9 and B) B bit indicates whether task is busy or not. B=0 : Task is not busy B=1 : Task is busy

Gate descriptors (S=0, Type 4,5,6,7,C,F) Whenever 4,5,6,7 is specified in type field it specifies a call gate, task gate, interrupt gate and trap gate respectively. All fields are same as specified earlier except the word count, selector and offect. The word count field specifies the number of parameters that are to be copied from caller’s stack to the called procedure’s stack.

Gate descriptors (S=0, Type 4,5,6,7,C,F) Call gate are used to modified privilege levels. Trap and interrupt gates are used in interrupt and exception handling. The task gates are used in multitasking system

Protected Virtual Address Mode Physical address calculation in the protected virtual address mode

Protected Virtual Address Mode 1) PLs > Pldesc->access to segment allowed. 2)MMU checks__> Pdesc determine__> seg present__> phy mem. 3) exception load__>seg mem return__> interrupted prog. 4) 1 st & 2 nd step satisfied MMU will add 16 bit offset.