80 likes | 201 Vues
Εργαστήριο Λειτουργικών Συστημάτων Φροντιστήριο 6–Device Drivers. Ντίρλης Νικόλαος. Device Drivers. Operates Controls Hiding Details Enable users to use high level functions Example: Serial Port High Level Functions: (1) Send Data, (2) Receive Data
E N D
Εργαστήριο Λειτουργικών ΣυστημάτωνΦροντιστήριο6–Device Drivers Ντίρλης Νικόλαος
Device Drivers • Operates • Controls • Hiding Details • Enable users to use high level functions • Example: Serial Port • High Level Functions: (1) Send Data, (2) Receive Data • Different low-level commands for 16550 UART or FTDI • RS-232 standard compatible
Help Please? - Windows • How difficult is to write a driver? • Windows Driver Foundation: User-Mode Driver Framework (recommended, message-based) and Kernel-Mode Drivers Framework (standard implementations of functions that are known to cause problems, including cancellation of I/O operations, power management, and plug and play device)
Help Please? – Mac OS • X is Not Unix Kernel • I/O Kit • subset of C++ (omits features that Apple feels are unsafe for use in a multithreaded kernel)
APIs • Windows Display Driver Model (WDDM) – the graphic display driver architecture for Win Vista-7-8 • Windows Driver Model (WDM) • Network Driver Interface Specification (NDIS) – a standard network card driver API • Advanced Linux Sound Architecture (ALSA) – as of 2009 the standard Linux sound-driver interface • Scanner Access Now Easy (SANE) – a public-domain interface to raster-image scanner-hardware • Installable File System (IFS) – a filesystem API for IBM OS/2 and Microsoft Windows NT • Open Data-Link Interface (ODI) – a network card API similar to NDIS • Uniform Driver Interface (UDI) – a cross-platform driver interface project • Dynax Driver Framework (dxd) – C++ open source cross-platform driver framework for KMDF and I/O Kit
Others • Firmware • Embedded Systems
The “Hello” Driver • usr/src/drivers/hello int main(intargc, char **argv) { sef_startup(); printf("Hello, World!\n"); return EXIT_SUCCESS; } • make install
System Services • cdetc • vi system.conf • /hello # service up /usr/sbin/hello # service down hello #cd dev #ls| grep “hello” http://wiki.minix3.org/DevelopersGuide/DriverProgramming