1 / 35

Ch 1. Windows 2000 Driver 개요

Ch 1. Windows 2000 Driver 개요. 한국외국어대학교 정보통신공학과 2004.11.01 박성환 ( shpark@dislab.hufs.ac.kr ). Contents. 종합적인 System Architecture Kernel Mode I/O 구성요소 특별한 Driver Architecture Summary. 1. 종합적인 System Architecture. Windows 3.1. Windows 2000, XP, 2003. Windows 운영체제의 변화. Windows 9x.

aulani
Télécharger la présentation

Ch 1. Windows 2000 Driver 개요

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ch 1. Windows 2000 Driver 개요 한국외국어대학교 정보통신공학과 2004.11.01 박성환 (shpark@dislab.hufs.ac.kr)

  2. Contents • 종합적인 System Architecture • Kernel Mode I/O 구성요소 • 특별한 Driver Architecture • Summary

  3. 1. 종합적인 System Architecture

  4. Windows 3.1 Windows 2000, XP, 2003 Windows 운영체제의 변화 Windows 9x

  5. Windows 2000의 설계 목표 호환성 견고성 신뢰성 성 능 확장성 이식성

  6. User Mode Trap Kernel Mode 실행 Mode • User mode • System에 나쁜영향을 미칠 수 없는 user application code • Trap (system call) • 실행중인 프로그램 내에 테스트를 위해 특별한 조건을 걸어 놓은 것 • Kernel mode • System에 있는 모든 code

  7. User Mode Kernel Mode I/O Manager Executive Device Driver Kernel HAL (Hardware Abstraction Layer) Hardware Platform Windows 2000 운영체제의 계층적 구조 호환성 & 확장성 • 호환성 • Layer 구조를 통해 상호 의존적인 부분을 줄임 (추상화) • 확장성 • 모듈화를 통해 다른 Layer와 독립성을 유지한다. (이식성)

  8. 성능 • 모든 계층을 kernel mode에서 수행 • kernel내에서의 호출은 CALL정도의 명령만 수반 • HAL routine을 사용해, inline함수 정도의 수행 속도 • 서로 다른 작업의 단위를 thread로 병렬수행 • Busy-waiting을 최소화 • 주의 : device driver code는 결코 block되어서는 안됨

  9. Excutive • System Service Interface • Object Manager • Configuration Manager • Process Manager • Virtual Memory Manager • Local Procedure Call • I/O Manager • Active Directory Service • Environment SubSystem • Win32 SubSystem • 필수 SubSystem

  10. System Service Interface • User mode에서 kernel mode로의 전이 • 단순한 CPU 명령어 • 정교한 context switching User Mode SSI Kernel Mode

  11. Object Manager • Kernel은 항상 object단위로 관리 • User mode는 handle을 통해서만 access 가능 User Mode Handle Kernel Mode Mutex Thread Register file Process Memory

  12. Configuration Manager • Registry • Hardware에 설치된 software의 configuration value를 저장하는 database • Device driver가 실행될 때 정보 제공 • Windows 2000부터 제공하는 plug & play 등장으로 역할이 급격한 감소

  13. Process Manager • : Process • 소유단위 • 각각의 주소공간 소유 • 보안 식별자 소유(security identity) • : Thread • 실행단위 • 각각 process주소공간 내에 stack소유 Process (Thread 소유)

  14. Kernel Code Kernel Code User Code User Code Virtual Memory Manager 32bits Addr • Process 별로 4G의 virtual memory 공간을 소유함 • Thread는 4G안에서 공유함 2G ……… 2G Process Process

  15. Kernel Code Virtual Memory Manager 2G Device Driver Code DLL Code Code 2G Stack Heap …

  16. Page Page Page … … … … … … … … … … … … … … … … … … Page Page Page Virtual Memory Manager Kernel Page Table Kernel Code 2G Frame … … … 128M … User Code … … Frame 2G Page Table Physical Memory Virtaul Memory

  17. Local Procedure Call • Process 간에 호출 기법 • Memory 공간이 다르기 때문에 보호를 받음 • Interprocess call 이라고도 함 • Device driver code는 이를 이용하지 않음

  18. I/O Manager • User mode process가 I/O를 수행할 수 있게추상화 시킨 kernel의 code • 목적 : User modecode의 I/O 접근을 device와 무관하게 동작 • IRP(I/O Request Packet) 을 통해 user mode에서 kernel mode로 요청

  19. I/O Manager • I/O manager는 하나의 layer 역할을 함 User Mode Code I/O Manager(IRP) Kernel Mode Code

  20. Active Directory Service • Windows 2000에서 새롭게 등장한 개념 • Network 전반에 걸친 namespace를 제공 • 자기의 directory 뿐만 아니라 network상의 directory를 관리 • DNS같은 directory object까지도 관리 가능 • 보안에 주의해야 함

  21. Environment SubSystem • Win32 SubSystem • Virtual DOS Machine SubSystem • 32Bits 환경에서 16Bits를 직접실행 시 신뢰성에 문제 • 이를 중간에서 신뢰성을 보장해줌 • Windows On Windows SubSystem • 16 Bits Windows app를 실행 시 개별적인 thread 공간 할당 • 각 Thread간의 정보 공유는 불가 • POSIX SubSystem • Unix style의 API 제공을 위함이지만, 제대로 동작하지 않음 • 오히려 win32 style로 바꾸어 실행 • OS/2 SubSystem • Intel의 x86 버전만을 지원

  22. Win32 SubSystem • Windows 2000 의 native API • GUI (Graphical User Interface) • Console I/O • Win32 API

  23. Win32 SubSystem Kernel Service (kernel32.dll Function) Win32 SubSystem Win32 Application User Mode Kernel Mode 실행부 서비스 Win32k.sys 다른 실행부 구성 요소들 Windows Manager (user32.dll function) GDI (GDI32.dll Function) User와 GDI의 Kernel 구성 요소

  24. 필수 SubSystem • Security SubSystem • Service Control Manager • RPC Locator (Remote Procedure call)

  25. Kernel Mode I/O 구성 요소

  26. I/O SubSystem의 설계 목표 • Platform간의 호환성 • Sofeware와 hardware 모두에게 관련된 설정성 • Preemption과 interrupt가 가능 • Multiprocessor 환경에서의 안전한 code • Object 기반 • Packet 구동 • Asynchronous I/O 지원

  27. Windows 2000 Driver의 종류 • 상위 Level driver : ex) FSD • 하위 Level driver : ex) Disk driver

  28. 특별한 Driver Architecture

  29. 특별한 Driver Architecture • Video Driver • Print Driver • MultiMedia Driver • Network Driver

  30. Video Driver • Graphic card에 있는 graphic 가속기 유무 • 이러한 hardware를 지원해야만 함 • 가속기가 없는 경우 또한 호환성을 유지해야 함 • Standard I/O architecture는 I/O manager와 직접 통신 • Video driver는 GDI (Graphic Device Interface)와 통신 • GDI • 화면에 선을 그리고 글자를 출력 • Display driver와 직접 통신 (DDI)

  31. Video Driver Architecture Application User Mode Kernel Mode Graphics Engine(GDI) I/O Manager IRP 전송 Eng 호출 DDI 호출 NT 실행부 Video Port VRP 전송 Display Driver Video Mini Port Video Adaptor

  32. Print Driver GDI Application • 실제 device에 전송전에 spooling mechanism을 거침 • RPC 이 spooling에 대한 처리를 함 Job을 File처리 Winspool.drv Client Server Winspoolsv.drv Job에 대한 Serialize Winspoolss.drv Serialize 된 Job을 전송 Print Provider

  33. MultiMedia Driver • Win2k가 kernel streaming(KS) 을 지원 • Function streaming • Filter streaming • Application은 마치 COM처럼 kernel streaming과 통신 • Method , properties , event • Kernel streaming의 4가지 object • Fliter object • Pin object • Clock object • Allocator object • Windows 2000은 stream.sys를 제공하기에 multimedia device driver를 작성하려면 Mini Driver만을 작성함

  34. Network Driver NIC Driver를 지원하는 Library 제공 NDIS Protocol Driver • OSI (Open Systems Interconnection) model을 따름 • Transport layer은 개별적인 protocol driver에 의해 제공 NDIS 인터미디엇 Driver Hardware를 제어하기 위해 NDIS Lib를 이용 NDIS Mini Port Network Hardware (NIC)

  35. Summary • Windows 2000은 application을 위해 다양한 구조와 library를 제공함 • Device driver는 절대 kernel 영역에 변화를 주는 영향을 미쳐서는 안됨 • 호환성, 견고성 & 신뢰성, 이식성, 확장성, 성능을 고려해 device driver를 작성해야 함 • Device driver를 level별로 잘 고려해서 구조를 잡아야 함

More Related