ISLab Flash Team Ch 3. Kernel-Mode I/O Processing.

Slides:



Advertisements
Similar presentations
WDM 드라이버의 기본 구조 What is WDM?
Advertisements

计算机系 信息处理实验室 Lecture 3 System Mechanisms (1)
李盈賢.  Start a process with a specific priority class  Methods: 1)Cmd: start /’priority’ ‘filename’ 2)Create a shortcut.
Lecture Objectives: 1)Explain the limitations of flash memory. 2)Define wear leveling. 3)Define the term IO Transaction 4)Define the terms synchronous.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
Operating Systems (OS) Threads, SMP, and Microkernel, Unix Kernel
Windows XP 1 © Silbershatz, Galvin, Gagne CS502 Spring 2006 Windows XP CS-502 Operating Systems Slides excerpted from Silbershatz, Ch. 22.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Processes 1 CS502 Spring 2006 Processes Week 2 – CS 502.
CS-3013 & CS-502, Summer 2006 Windows XP1 CS-502 Operating Systems Slides excerpted from Silbershatz, Ch. 22.
1 I/O Management in Representative Operating Systems.
CSE 451: Operating Systems Winter 2010 Module 15 I/O Mark Zbikowski Gary Kimura.
Driver Verifier Advancements In Windows 7 Daniel Mihai Principal Software Design Engineer Windows Engineering Tools.
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS3: Concurrency 3.5. Lab Slides & Lab Manual.
© Microsoft Corporation1 Windows Kernel Internals I/O Architecture *David B. Probert, Ph.D. Windows Kernel Development Microsoft Corporation.
Kernel, processes and threads Windows and Linux. Windows Architecture Operating system design Modified microkernel Layered Components HAL Interacts with.
Windows NT and Real-Time? Reading: “Inside Microsoft Windows 2000”, (Solomon, Russinovich, Microsoft Programming Series) “Real-Time Systems and Microsoft.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
2: Computer-System Structures
Chapter 2: Computer-System Structures 2.1 Computer System Operation 2.5 Hardware Protection 2.6 Network Structure.
Windows 2000 Course Summary Computing Department, Lancaster University, UK.
计算机系 信息处理实验室 Lecture 4 System Mechanisms (2)
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Windows 2000 System Mechanisms Computing Department, Lancaster University, UK.
NT Kernel CS Spring Overview Interrupts and Exceptions: Trap Handler Interrupt Request Levels and IRT DPC’s, and APC’s System Service Dispatching.
LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System.
WHDC PowerPoint Template Notes & Handouts
3. System Mechanisms ■ Trap Dispatching - Trap : A Processor`s mechanism for capturing an executing thread an exception or an interrupt occurs and transferring.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
Lecture Topics: 10/29 Architectural support for operating systems –timers –kernel mode –system calls –protected instructions.
4P13 Week 2 & 3 Talking Points 1. Kernel Processes 2.
1.4 Hardware Review. CPU  Fetch-decode-execute cycle 1. Fetch 2. Bump PC 3. Decode 4. Determine operand addr (if necessary) 5. Fetch operand from memory.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
System Mechanisms Instructor: 許富皓 Speaker: 彭文秈 呂坤錡 謝英成 12/16/
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
1/9/ :46 1 Priority Model Real-time class Idle Above Normal Normal Below Normal Lowest Highest 31 Time-critical Dynamic classes.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS3: Concurrency 3.3. Advanced Windows Synchronization.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
Managing Processors Jeff Chase Duke University. The story so far: protected CPU mode user mode kernel mode kernel “top half” kernel “bottom half” (interrupt.
3.2. Windows Trap Dispatching, Interrupts, Synchronization
Overview of Windows Driver Development Reference: us/gstart/hh/gstart/gs_intro_031j.asp.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edit9on Lecture 3 Chapter 1: Introduction Provided & Updated by Sameer Akram.
Interrupts and Interrupt Handling David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
WORKING OF SCHEDULER IN OS
Chapter 13: I/O Systems.
Crash Dump Analysis - Santosh Kumar Singh.
I/O Manager, 64-bit Porting, and New Driver Models
CSE 120 Principles of Operating
Chapter 3: Windows7 Part 2.
CSCI 315 Operating Systems Design
Module 2: Computer-System Structures
I/O Systems I/O Hardware Application I/O Interface
Chapter 3: Windows7 Part 2.
Direct Memory Access Disk and Network transfers: awkward timing:
3.3. Advanced Windows Synchronization
CSE 451: Operating Systems Spring 2008 Module 15 I/O
CSE 451: Operating Systems Spring 2007 Module 15 I/O
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
LINUX System : Lecture 7 Lecture notes acknowledgement : The design of UNIX Operating System.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Module 2: Computer-System Structures
Interrupts and Interrupt Handling
Module 2: Computer-System Structures
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

ISLab Flash Team Ch 3. Kernel-Mode I/O Processing

ISLab Flash Team Made By Povolon Ch 3. Kernel-Mode I/O Processing2 Contents 1. 커널모드의 코드 수행 2. 인터럽트 Priority 3.Deferred Procedure Calls(DPCs) 4.Access to User Buffers 5.Structure of a Kernel-Mode Driver 6.I/O Processing Sequence 7.Summary

ISLab Flash Team Made By Povolon Ch 3. Kernel-Mode I/O Processing3 How Kernel-Mode Code Executes CPU Context –Trap or Exception Context User mode -> Kernel Mode (System Call) Direct I/O 요청 시 I/O Manager 의 Dispatch routine –Interrupt Context Interrupt 발생시 –Kernel-Mode Thread Context Device polling or Time out

ISLab Flash Team Made By Povolon Ch 3. Kernel-Mode I/O Processing4 Use of Interrupt Priorities by Windows 2000 CPU Priority level –Interrupt Request Level (IRQL) Priority 를 정의하는 숫자 Interrupt Processing Sequence 1. 현재 명령의 수행 중지 2. 상태정보 저장 3. 현재 CPU 의 IRQL 을 요청된 IRQL 값과 같게 함 4. 적절한 Interrupt service routine 수행 Software-generated Interrupt

ISLab Flash Team Made By Povolon Ch 3. Kernel-Mode I/O Processing5 Deferred Procedure Calls (DPCs) DPC 의 동작 – 높은 IRQL 작업을 지연 수행을 함 DPC 1 DPC 2 … DPC 3 Interrupt Service Routine DPC Dispatcher DPC Routine 1 DPC Routine n DPC Routine 2 … DPC Software Interrupt DIRQL System DPC Queue Schedules DPC Object DPC 객체 를 꺼내옴 꺼내온 DPC 객체 의 DPC Routine 을 호출

ISLab Flash Team Made By Povolon Ch 3. Kernel-Mode I/O Processing6 DPC 의 특성 – 오직 한 개의 DPC 객체의 인스턴스가 존재해야 함 DPC 큐에 이미 존재하는 DPC 객체를 중복으로 Schedule 불가 DPC 요청에 대한 카운트를 유지 or 개별적인 큐의 구현 –Multiprocessor 상에서 작업의 동기화 병렬적인 processor 의 interrupt routine Deferred Procedure Calls (DPCs)

ISLab Flash Team Made By Povolon Ch 3. Kernel-Mode I/O Processing7 Buffer Access Mechanisms –I/O manager 에게 User buffer 를 RAM 에 복사 요청 (Buffered I/O) RAM 의 내용을 Write 하거나 I/O 를 통한 Read 내용을 저장시킴 –Driver 가 User buffer 를 직접 접근 (Direct I/O) I/O Manager : User buffer 에 Lock 을 설정함 Access to User Buffers

ISLab Flash Team Made By Povolon Ch 3. Kernel-Mode I/O Processing8 I/O Manager 의 Driver routine 호출 시점 –Driver load –Driver Unload or System shutting sown –Device insert or remove –User-Mode 에서의 I/O 요청 (System Call) – 공유 hardware resource 의 사용 가능 시점 – 실제 Device 가 동작시 여러 상황 Structure of a Kernel-Mode Driver

ISLab Flash Team Made By Povolon Ch 3. Kernel-Mode I/O Processing9 Driver Initialization and Cleanup Routine –Driver Entry routine Driver load 시, 자원할당 - 조정 - 수락 –Reinitialize routine 부팅 시 초기화가 불가능한 Driver 의 초기화 –Unload routine Driver 의 동적 Unload –Shutdown routine System 종료 –Bug-check Call-Back routine System Crash 발생시 Structure of a Kernel-Mode Driver

ISLab Flash Team Made By Povolon Ch 3. Kernel-Mode I/O Processing10 I/O System Service Dispatch Routine –I/O Manager 가 I/O 요청에 알맞은 Driver 와 routine 을 찾음 –Open and Close Operation File –Device Operation Device Structure of a Kernel-Mode Driver

ISLab Flash Team Made By Povolon Ch 3. Kernel-Mode I/O Processing11 Data Transfer Routine –Start I/O routine Device 의 데이터 전송 –Interrupt Service Routine (ISR) Interrupt 생성 –DPC routine Device 동작의 완료 Structure of a Kernel-Mode Driver

ISLab Flash Team Made By Povolon Ch 3. Kernel-Mode I/O Processing12 Resource Synchronization Callback – 자원 공유시 동기화 (Kernel-Mode) –Controller Control routine Controller Register 공유 –Adapter Control routine DMA Hardware (DMAC) 공유 –Synchronize Critical Section routine 공유 버퍼 or 자원 Structure of a Kernel-Mode Driver

ISLab Flash Team Made By Povolon Ch 3. Kernel-Mode I/O Processing13 Other Driver Routine –Timer routine –I/O completion routine –Cancel I/O routine Structure of a Kernel-Mode Driver

ISLab Flash Team Made By Povolon Ch 3. Kernel-Mode I/O Processing14 I/O Processing Sequence I/O Request from User-Mode Win32 Subsystem I/O Manager Driver-Dispatch Driver – Start I/O Driver - ISR Driver - DPC I/O Manager Preprocessing by I/O Manager IRP Passed Preprocessing by Device Driver Device Start and Interrupt Service Postprocessing by the Driver Postprocessing by the I/O Manager

ISLab Flash Team Made By Povolon Ch 3. Kernel-Mode I/O Processing15 Summary Windows 2000 의 SubSystem Device Driver Architecture I/O Processing Sequence