Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "ISLab Flash Team Ch 3. Kernel-Mode I/O Processing."— Presentation transcript:

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

2 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

3 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

4 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

5 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 을 호출

6 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)

7 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

8 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

9 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

10 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

11 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

12 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

13 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

14 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

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


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

Similar presentations


Ads by Google