O PERATING I N P ROTECTED M ODE Prof.P.C.Patil Department of Computer Engg Matoshri College of Engg.Nasik M ICROPROCESSOR A RCHITECTURE.

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

Scenario: EOT/EOT-R/COT Resident admitted March 10th Admitted for PT and OT following knee replacement for patient with CHF, COPD, shortness of breath.
Chapter 8: Main Memory.
Process Description and Control
AP STUDY SESSION 2.
1
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Processes and Operating Systems
Copyright © 2013 Elsevier Inc. All rights reserved.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
David Burdett May 11, 2004 Package Binding for WS CDL.
Local Customization Chapter 2. Local Customization 2-2 Objectives Customization Considerations Types of Data Elements Location for Locally Defined Data.
CALENDAR.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt BlendsDigraphsShort.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt FactorsFactors.
1 Chapter 12 File Management Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
Break Time Remaining 10:00.
Figure 12–1 Basic computer block diagram.
Microprocessor Architecture Pipelined Architecture
Turing Machines.
Table 12.1: Cash Flows to a Cash and Carry Trading Strategy.
PP Test Review Sections 6-1 to 6-6
Briana B. Morrison Adapted from William Collins
Memory Management Unit
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
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,
Chapter 10: Virtual Memory
Operating Systems Operating Systems - Winter 2012 Chapter 4 – Memory Management Vrije Universiteit Amsterdam.
Exarte Bezoek aan de Mediacampus Bachelor in de grafische en digitale media April 2014.
O PERATING I N R EAL M ODE Prof.P.C.Patil Department of Computer Engg Matoshri College of Engg.Nasik M ICROPROCESSOR A RCHITECTURE.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
1 RA III - Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Buenos Aires, Argentina, 25 – 27 October 2006 Status of observing programmes in RA.
Adding Up In Chunks.
MaK_Full ahead loaded 1 Alarm Page Directory (F11)
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Synthetic.
: 3 00.
5 minutes.
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Types of selection structures
Speak Up for Safety Dr. Susan Strauss Harassment & Bullying Consultant November 9, 2012.
Essential Cell Biology
Converting a Fraction to %
Numerical Analysis 1 EE, NCKU Tien-Hao Chang (Darby Chang)
Clock will move after 1 minute
PSSA Preparation.
Chapter 11 Creating Framed Layouts Principles of Web Design, 4 th Edition.
Physics for Scientists & Engineers, 3rd Edition
Energy Generation in Mitochondria and Chlorplasts
Select a time to count down from the clock above
1.step PMIT start + initial project data input Concept Concept.
Intel MP.
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 MP (32-bit microprocessor) Designed to overcome the limits of its predecessor while maintaining the software compatibility with the.
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 月.
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.
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.
1 Microprocessors CSE Protected Mode Memory Addressing Remember using real mode addressing we were previously able to address 1M Byte of memory.
Microprocessor and Assembly Language Addressing Models
Information Security - 2. Descriptor Tables Descriptors are stored in three tables: – Global descriptor table (GDT) Maintains a list of most segments.
Descriptor Table & Register
16.317: Microprocessor System Design I
Microprocessor Systems Design I
Operating Modes UQ: State and explain the operating modes of X86 family of processors. Show the mode transition diagram highlighting important features.(10.
Presentation transcript:

O PERATING I N P ROTECTED M ODE Prof.P.C.Patil Department of Computer Engg Matoshri College of Engg.Nasik M ICROPROCESSOR A RCHITECTURE UOP S.E.C OMP (S EM -I)

lntroduction 2

The complete capabilities of the 80386DX are unlocked when the 803B6DX operates in protected mode. After reset 80386DX enters into real mode but setting bit 0 in CRO register it is possible to operate 80386DX in protected mode. lntroduction 3

Features of protected mode 4

1. Protected mode vastly increases the linear address space to 4 Gigabytes (2 32 bytes) and allows the running of virtual memory programs of almost unlimited size (64 terabytes or 2 46 bytes ). 2. Protected mode allows the 80386DX to run all of the existing 8086 and programs. 3. It provides a sophisticated memory management and a hardware-assisted protection mechanism. 4. It provides special instructions for multitasking operating systems. 5. It supports paging mechanism. Features of protected mode 5

Protected Mode Register Model 6

1. Global Descriptor Table Register (GDTR) - 48 bits : It holds the 32-bit linear base address and 16-bit limit of the Global Descriptor Table (GDT). 2. lnterrupt Descriptor Table Register (IDTR) - 48 bits : It holds the 32-bit linear base address and 16-bit limit of the Irterrupt Descriptor Table (IDT). 3. Local Descriptor Table Register (LDTR) - 16 bits : It holds the 16-bit selector for the local descriptor table 4. Task Register (TR) 16 bits : It holds the 16 bit selector for the task state segment descriptor. Protected Mode Register Model 7 Link

In protected mode register set, funcfion of few registers have been extended. 1. The instruction pointer is now 32bit.Called as EIP. 2. More bits of the flag registers (EFLAGs) are active 3. All four control registers CR 0 -CR 3 are active 8 Protected Mode Register Model

9

Protected Mode Addressing Mechanism 10

The DX has three distinct address spaces : 1. Logical, 2. Linear and 3. Physical A logical address (also known as virtual address) consists of a selector and an offset. A selector is the contents of a segment register 11 Protected Mode Addressing Mechanism

In real mode : the segmentation unit shifts the selector left four bits & adds the result to the offset to form the linear address. In protected mode : Every segment selector has a linear base address associated with it, and it is stored in the segment descriptor. A selector : is used to point a descriptor for the segment in a table of descriptors. The linear base address from the descriptor is then added to the 32 Bit offset to generate the 32-bit linear address. This process is known as segmentation 12 Protected Mode Addressing Mechanism

If paging unit is not enabled then the 32-bit linear address corresponds to the physical address. But if paging unit is enabled, paging mechanism translates the linear address space into the physical address space by paging translation. 13 Protected Mode Addressing Mechanism

14

Segment Descriptor 15

16

In protected mode, Memory Management Unit (MMU) uses the segment selector to access a descriptor for the desired segment in a table of descriptors in memory. Segment descriptor is a special structure which describes the segment. Exactly one segment descriptor must be defined for each segment of the memory. 17 Segment Descriptor

Descriptors are eight type quantities which contain attributes about a given region of linear address space (i.e. a segment). These attributes include the 32-bit base linear address of the segment, the 20-bit length and granularity of the segment, the protection level, read, write or execute privileges, the default size of the operands (15-bit or 32Bit), and the type of segment. 18 Segment Descriptor

Base : It contains the 32-bit base address for a segment. Thus defines the location of the segment within the 4 gigabyte linear address space. The concatenates the three fragments of the base address to form a single 32-bit address. Limit : It defines the size of the segment. The concatenates the two fragments of the limit field to form a 20 bit value. The interprets this 20-bit value in two ways, depending on the setting of the granularity bit (G) : If G bit 0 : In units of 1 byte, to define a limit of up to 1 M byte (2 20 ) If G bit 1. : In units of 4 kilobytes, to define a limit of up to 4 gigabytes. 19 Segment Descriptor

Granularity Bit : It specifies the units with which the limit field is interpreted. When bit is 0, the limit is interpreted in units of one byte; otherwise limit is interpreted in units of 4 Kbytes. 0 (Reserved by lntel) : It neither can be defined nor can be used by user. This bit must be zero for compatibility with future processors. AVL/U (User Bit) : This bit is completely undefined, and ignores it. This is available field/bit for user or operating system. 20 Segment Descriptor

Access rights byte : P (Present Bit) : The present P bit is 1 if the segment is loaded in the physical memory, if P = 0 then any attempt to access this segment causes a not present exception (exception 11). DPL (Descriptor Privilege Level) : It is a 2-bit field defines the level of privilege associated with the memory space that the descriptor defines – DPL 0 is the most privileged whereas DPL 3 is the least privilege Type : This specifies the specific descriptors among various kinds of descriptors. 21 Segment Descriptor

S (System Bit) : The segment S bit in the segment descriptor determines if a given segment is a system segment or a code or a data segment. If the S bit is 1 then the segment is either a code or data segment, if it is 0 then the segment is system segment. A (Accessed Bit) : The automatically sets this bit when a selector for the descriptor is loaded into a segment register. This means that sets accessed bit whenever a memory reference is made by accessing the segment. 22 Segment Descriptor

Types Segment Descriptor 23

24 Types Segment Descriptor

25 Types Segment Descriptor: Non-System Segment Descriptors Data Segment Descriptor Non-System Segment Descriptors

26 Code Segment Descriptor Types Segment Descriptor: Non-System Segment Descriptors

27 Systeme Segment Descriptor Types Segment Descriptor: System Segment Descriptors

28 Types Segment Descriptor: System Segment Descriptors

29 Types Segment Descriptor: System Segment Descriptors

30 Types Segment Descriptor: System Segment Descriptors

31 Gate Descriptor Types Segment Descriptor: System Segment Descriptors

Descriptor Table 32

Segment descriptors are grouped and placed one after the other in contiguous memory locations. This group arrangement is known as a descriptor table. The maximum limit for the length of descriptor table is 64 kbytes and each descriptor takes 8 bytes to store the information of a particular segment. So descriptor table can have as many as 8192 descriptors. The upper 13 bits of a selector are used as an index into the descriptor table. 33 Descriptor Table

There are three types of descriptor tables : Global Descriptor Table (GDT) : It is a general purpose table of descriptors, can be used by all programs to reference segments of memory. The GDT can have any type of segment descriptor except for descriptors which are used for serving interrupts. Interrupt Descriptor Table (IDT) : It holds the segment descriptors that define interrupt or exception handling routines. The IDT is a direct replacement for the interrupt vector table used in 8085 system. Local Descriptor Tables (LDT) : They are set up in the system for individual task or closely related group of tasks. 34 Descriptor Table

35 Descriptor Table

GDTR 36

37 Descriptor Table : GDTR

GDTR is a 48-bit register located inside the 80386DX. The lower two bytes of this register specifies the LIMIT (in bytes) for the GDT. The value of limit is 1 less than the actual size of the table. For example, if LIMIT is 03FFH then the table is 1024( ) bytes in length (03FFH =102316). Since the LIMIT field is 16 bit long, the GDT can grow up to 65,536 bytes long. The upper four bytgs of GDTR specifies the 32-bit linear address of the base of the Global Descriptor Table (GDT). 38 Descriptor Table : GDTR

IDTR 39

40 Descriptor Table : IDTR

Like global descriptor table register, Interrupt descriptor table register (IDTR) holds the 16-bit limit and 32-bit linear address of the base of the Interrupt Descriptor Table (IDT). Interrupt Descriptor Table Register are used to define a Interrupt Descriptor Table (IDT) in the 80386DX physical memory address space. Like GDTR the IDTR is also 48 bit in length, with lower two bytes defines Limits and upper 4 bytes defines the base address. Since limit field is two bytes, the IDT can also be up to 65,536 bytes long. But the 803B6DX only supports upto 256 interrupts or exceptions; therefore, the size of the IDT should not be set to support more than 256 interrupts. 41 Descriptor Table : IDTR

LDTR 42

43 Descriptor Table : LDTR

Unlike GDTR and IDTR, the LDTR is a 16-bit register. It does not specify any limit or base address for the segment but it specifies the address of the LDT descriptor stored in the Global Descriptor Table (GDT) LDTR holds a selector that points to an LDT descriptor in the GDT. Whenever a selector is loaded into the LDTR, the corresponding descriptor is located in the global descriptor table. The contents of this descriptor defines the local descriptor table. The 32-bit base value defines starting point of the table in the 80386DX physical memory address space and 16-bit limit specifies the size of the table. 44 Descriptor Table : LDTR

The GDT can contain many LDT descriptors. To put particular LDT in service, it is necessary to load the LDTR with corresponding selector. For loading the values in GDTR, IDTR and LDTR registers, 80336DX provides LGDT, LLDT, and LIDT instructions. It also provides SGDT, SLDT and SIDT instructions. These (48 bits) instructions copy the contents of the descriptor table registers into the six bytes of memory pointed by the destination operand. These tables are manipulated by the operating system. Thus, the instructions used for loading the descriptor tables are privileged instructions. 45 Descriptor Table : LDTR

Segmentation 46

47

Segmentation is a process of converting logical address into a linear address. The 13-bit index part of selector is multiplied by 8 and used as a pointer to the desired descriptor in a descriptor table. The index value is multiplied by 8 because each descriptor requires 8 bytes in the descriptor table. The descriptor in the descriptor table contains mainly base address, segment limit and access right byte. The adds the base address from the descriptor to the effective address or offset to generate a linear address. 48 Segmentation

The selector component of each logical address contains 2 bits which represent the privilege level of the program section requesting access to a segment. Level 0 is the most privileged and level 3 is the least privileged. More previleged levels are numerically smaller than less privileged levels. The descriptor of each segment contains 2 bits which represent the privilege level of that segment. When an executing program attempts to access a segment, the memory management unit compares the privilege level in the selector with the privilege level in the descriptor 49 Segmentation

If the segment selector has the same or greater privilege level, then the memory management unit allows the segment to be accessed. If the selector privilege level is lower than the privilege level of the segment, the memory management unit denies the access and sends an interrupt signal to the CPU indicating a privilege level violation. 50 Segmentation

There are two major categories of descriptor table in a system : Global Descriptor Table (GDT) is a general purpose table of descriptors, can be used by all programs to reference segments of memory. Local Descriptor Table (LDT) are set up in the system for individual task or closely related group of tasks. The Table Indicator (TI) bit in the selector decides which descriptor table should be referred by the selector. When TI bit is 0, the index portion of the selector refers to a descriptor in the GDT. When TI bit is 1, it refers to descriptor in the current LDT. 51 Segmentation

52