Microprocessor system architectures – IA32 tasks Jakub Yaghob.

Slides:



Advertisements
Similar presentations
Memory Management Paging &Segmentation CS311, CS350 & CS550.
Advertisements

FEATURES OF 80386: Two versions of are commonly available: 1) 80386DX
Unit 4 Chapter-1 Multitasking. The Task State Segment.
16.317: Microprocessor System Design I
Intel MP.
Microprocessors system architectures – IA32 real and virtual-8086 mode Jakub Yaghob.
Microprocessor system architectures– IA32 debugging and performance monitoring Jakub Yaghob.
IA32 Paging Scheme Introduction to the Pentium’s support for “virtual” memory.
CS591 (Spring 2001) The Linux Kernel: Signals & Interrupts.
Task-Switching How the x86 processor assists with context-switching among multiple program-threads.
Operating Systems: Segments 1 Segmentation Hardware Support single user program system: – wish somehow to relocate address 0 to after operating system.
IA-32 Processor Architecture
Page-Faults in Linux How can we study the handling of page-fault exceptions?
Context Switch Animation Another one by Anastasia.
X86 segmentation, page tables, and interrupts 3/17/08 Frans Kaashoek MIT
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 2 The Microprocessor and its Architecture.
1 CE6105 Linux 作業系統 Linux Operating System 許 富 皓.
Linux Operating System
Linux Operating System
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Fall 2012 Lecture 15: Protected mode intro.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 2 The Microprocessor and its Architecture.
UNIT 2 Memory Management Unit and Segment Description and Paging
Intel IA32 OS Support -Refresh
80386DX.
Intel MP (32-bit microprocessor) Designed to overcome the limits of its predecessor while maintaining the software compatibility with the.
Windows Kernel Internals Traps, Interrupts, Exceptions
Microprocessor system architectures – IA32 segmentation Jakub Yaghob.
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.
A Lecture on Computer Architecture For Readers. 2 프로그래머입장에서 바라본 컴퓨터 구조와 보호 모드 컴퓨터 구조에 대한 이해 ; 자신이 작성한 프로그램이 어떻게 수행될지 좀더 세밀하게 이해하기 위해서는 컴퓨터 구조에 대한 이해가.
Fall 2012 Chapter 2: x86 Processor Architecture. Irvine, Kip R. Assembly Language for x86 Processors 6/e, Chapter Overview General Concepts IA-32.
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.
Operating Systems Engineering Based on MIT (2012, lec3) Recitation 2: OS Organization.
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.
6. HAL and IDT ENGI 3655 Lab Sessions. Richard Khoury2 Textbook Readings  Interrupts ◦ Section  Hardware Abstraction Layer ◦ Section
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.
Chapter 2 The Microprocessor Architecture Microprocessors prepared by Dr. Mohamed A. Shohla.
10. Epilogue ENGI 3655 Lab Sessions.  We took control of the computer as early as possible, right after the end of the BIOS  Our multi-stage bootloader.
Microprocessor system architectures – IA32 security
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 There are two descriptor tables – Global Descriptor Tables – Local Descriptor Tables The global descriptor.
Information Security - 2. Descriptor Tables Descriptors are stored in three tables: – Global descriptor table (GDT) Maintains a list of most segments.
The Microprocessor & Its Architecture A Course in Microprocessor Electrical Engineering Department Universitas 17 Agustus 1945 Jakarta.
Microprocessor Architecture
Protection in Virtual Mode
Memory Management Paging (continued) Segmentation
16.317: Microprocessor System Design I
Operating Systems Engineering
Microprocessor Systems Design I
Anton Burtsev February, 2017
Privilege Levels.
Anton Burtsev February, 2017
143A: Principles of Operating Systems Lecture 5: Address translation
Protection UQ: Explain the protection mechanism of X86 Intel family microprocessor(10 Marks)
Information Security - 2
Basic Microprocessor Architecture
x86 segmentation, page tables, and interrupts
System Segment Descriptor
Page Replacement Implementation Issues
Memory Management Paging (continued) Segmentation
CS 301 Fall 2002 Computer Organization
Information Security - 2
REGISTER ORGANIZATION OF 80386
Low-Level Thread Dispatching on the x86
Memory Management Paging (continued) Segmentation
Presentation transcript:

Microprocessor system architectures – IA32 tasks Jakub Yaghob

Using tasks in OS 1 thread = 1 task 1 process = 1 task All processes = 1 task

Structure of a task

Task state Segment selectors CS, DS, ES, FS, GS, SS General registers EAX - ESP Flags EFLAGS Instruction pointer EIP Control register CR3 Private paging virtual address space The state of TR Selector in LDTR The I/O map Software interrupt redirection map (Pentium+) Stack pointers to the 0-2 privilege level stacks Link to previously executed task

Involved registers and data structures Task State Segment TSS TSS descriptor Task gate descriptor Task register TR The flag NT in EFLAGS NT = Nested Task

TSS structure

Fields in the TSS 32b – I

Fields in the TSS 32b – II

Fields in the TSS 32b – III

TSS descriptor 32b

Task gate descriptor

Using task gate

Task register Holds a selector to a TSS descriptor Hidden part Current task

Task switching Explicit switch Explicit task switching as a subprogram using CALL Explicit task switching using JMP As a target is either TSS descriptor or task gate descriptor Checking EPL ≤ DPL Implicit switch Implicit switch (CPU makes it during some operation) for interrupt or exception handling A target task is provided by task gate descriptor in the IDT Return from a task using IRET with pre-set NT in EFLAGS Return from „subprogram“ A target task taken from the LINK field of the current TSS

Task switching – mechanism Obtaining a target TSS Checking EPL ≤ DPL The target task is present and its length≥67h The target task is available for jumps or busy for return Paging in current, target TSSs and all used descriptors Clearing B in the old descriptor for JMP and IRET, leaving original B (=1) for CALL and IRQ Clearing NT executing IRET Storing current state into current TSS Setting NT in new EFLAGS executing CALL or during IRQ, keeping the NT value from new EFLAGS executing JMP or IRET Setting B in the new descriptor for JMP, CALL, IRQ, leaving original B for IRET Loading TR with new TSS descriptor Loading a new state from TSS Loading new segment descriptors Executing the new task

Task linking Only when a task is switched using CALL or an interrupt/exception handling using a task gate It is not possible to make a recursion

Task management in long mode Task switching not available All attempts cause #GP 64-bit TSS must exist RSPn – stacks for privilege levels 0-2 ISTn – Interrupt Stack Table I/O map

Fields in the TSS 64b – I

Fields in the TSS 64b – II