A Comparative Study of the Linux and Windows

  • Slides: 32
Download presentation
A Comparative Study of the Linux and Windows Device Driver Architectures with a focus

A Comparative Study of the Linux and Windows Device Driver Architectures with a focus on IEEE 1394 (high speed serial bus) drivers Melekam Tsegaye g 98 t 4414@campus. ru. ac. za Supervisors Prof. Richard Foss, Bradley Klinkradt

Overview The Linux and Windows driver architectures The Linux and Windows IEEE 1394 driver

Overview The Linux and Windows driver architectures The Linux and Windows IEEE 1394 driver stacks Driver development on the two platforms Results of the study

Why the study was conducted ? Microsoft Windows and Linux n n Two of

Why the study was conducted ? Microsoft Windows and Linux n n Two of the most popular operating systems No previous comparisons of their driver architectures done by other researchers IEEE 1394 (firewire) n n Popular bus offering high data transfer rates Active research area for the CS department’s Audio Engineering Group

IEEE 1394 Data Transfer rates of 100, 200 and 400 Mbps Isochronous mode of

IEEE 1394 Data Transfer rates of 100, 200 and 400 Mbps Isochronous mode of transfer n Guaranteed bandwidth (80%) Asynchronous mode of transfer n Guaranteed packet delivery (20% or more) Fully plug ‘n play

IEEE 1394 Consumer Products

IEEE 1394 Consumer Products

Device Drivers A driver is a piece of software that extends a kernel’s functionality

Device Drivers A driver is a piece of software that extends a kernel’s functionality Drivers enable applications (through the kernel) n n to transfer data to and from a device to control the a device to allow modification of its attributes Composed of a set of routines that a kernel calls at appropriate times e. g. read/write

Typical driver routines A driver would implement n n n n Initialisation Cleanup Open

Typical driver routines A driver would implement n n n n Initialisation Cleanup Open Read Write I/O Control (ioctl) Close

The Windows driver architecture Standard model n The Windows Driver Model (WDM) bus, functional

The Windows driver architecture Standard model n The Windows Driver Model (WDM) bus, functional & filter drivers n n Pn. P & Power management Communication I/O request packets (IRPs)

The Linux driver architecture No standard driver model n n n Drivers are modules

The Linux driver architecture No standard driver model n n n Drivers are modules No Pn. P & Power management message dispatching Communication through direct function calls

Side by side comparison of the two driver architectures Linux Windows

Side by side comparison of the two driver architectures Linux Windows

IEEE 1394 driver stacks The Windows IEEE 1394 stack n n n closed source

IEEE 1394 driver stacks The Windows IEEE 1394 stack n n n closed source maintained by Microsoft stable The Linux IEEE 1394 stack n n n open source maintained by the Linux 1394 community (private individuals) tagged experimental

The Windows IEEE 1394 stack Host controller Bus driver Client drivers Communication n I/O

The Windows IEEE 1394 stack Host controller Bus driver Client drivers Communication n I/O request block (IRB)

The Linux IEEE 1394 stack Host controller Bus drivers Client drivers Communication n direct

The Linux IEEE 1394 stack Host controller Bus drivers Client drivers Communication n direct function calls Direct driver possible

Side by side comparison of the two IEEE 1394 stacks Windows Linux

Side by side comparison of the two IEEE 1394 stacks Windows Linux

The Windows IEEE 1394 implementation

The Windows IEEE 1394 implementation

The Linux IEEE 1394 implementation

The Linux IEEE 1394 implementation

What operations should IEEE 1394 client drivers provide ? Asynchronous Operations n n n

What operations should IEEE 1394 client drivers provide ? Asynchronous Operations n n n Read Write Lock Listen Register Asynchronous Listening Deregister Asynchronous Listening Isochronous operations n n n Listen Talk Asynchronous streaming

What operations should IEEE 1394 client drivers provide ? (Continued) Bus reset handling n

What operations should IEEE 1394 client drivers provide ? (Continued) Bus reset handling n n Register Bus Reset Handler Generate Soft Bus Reset Obtain Bus Information (e. g. node count) Local configuration ROM manipulation Network troubleshooting n Pinging of nodes

Device Driver Development Environments

Device Driver Development Environments

Issues to be considered when creating drivers Memory management n n The kernel provides

Issues to be considered when creating drivers Memory management n n The kernel provides memory allocation/deallocation routines Has two pools of memory (swappable, nonswappable) Data structures n n The kernel provides implementations for queues, lists, stacks Synchronisation with spin locks, mutexes, semaphores, signal objects

Issues to be considered when creating drivers (Continued) Drivers routines n n must be

Issues to be considered when creating drivers (Continued) Drivers routines n n must be re-entrant i. e. should be executable by multiple threads with no problems avoid recursion Hardware Abstraction Layer n use HAL routines provided by the kernel to access hardware

Map of software produced during this study

Map of software produced during this study

Windows raw 1394 driver

Windows raw 1394 driver

Linux raw 1394 -2 driver

Linux raw 1394 -2 driver

Linux Ieee 1394 diag

Linux Ieee 1394 diag

Driver Tests were run to determine n n highest data transfer rates that can

Driver Tests were run to determine n n highest data transfer rates that can be achieved by each of the IEEE 1394 drivers how close these came to theoretical maximum of 50 MB/s Bus analyser used to measure n n the duration of data transfers the amount of data transferred Calculated n the data transfer rate in MB/s

Test results Isochronous mode n Windows raw 1394 8. 9 MB/s packet size 1024

Test results Isochronous mode n Windows raw 1394 8. 9 MB/s packet size 1024 bytes n Linux raw 1394 4. 5 MB/s packet size 512 bytes Isochronous mode (buffered) n Linux raw 1394 -2 8. 9 MB/s packet size 1024 bytes n Windows raw 1394 17. 7 MB/s packet size 2048 bytes

Test results (continued) Drivers from both Linux and Windows do not transfer data at

Test results (continued) Drivers from both Linux and Windows do not transfer data at a rate close to theoretical n n 50 MB/s They achieve almost half that due to the PCI bus bottleneck (theoretical 132 MB/s) n n n In practice have that available shared by all I/O devices attached to the PCI bus The PCI bus has latency problems driver implementation may not be efficient

Conclusion A comparison of the Windows and Linux driver architectures has shown that n

Conclusion A comparison of the Windows and Linux driver architectures has shown that n Drivers for the two platform have similar components composed of routines for performing n I/O and device control drivers are modules which are loadable at runtime n n Windows has a formally defined driver model, Linux does not. Pn. P and power management support integrated in the Windows architecture, not so in Linux

Conclusion (continued) A comparison of the Windows and Linux IEEE 1394 stacks has shown

Conclusion (continued) A comparison of the Windows and Linux IEEE 1394 stacks has shown that n Their IEEE 1394 driver stacks are broken up into similar layers host controller, bus and client driver layers n Each stack provides the standard IEEE 1394 operations (both asynchronous and isochronous) The Linux IEEE 1394 stack is open source while the Windows stack is proprietary n Easier to create IEEE 1394 drivers for Linux than Windows since all source code is available

Future work IEEE 1394. 1 bridge awareness IEEE 1394. 1 n n allows extending

Future work IEEE 1394. 1 bridge awareness IEEE 1394. 1 n n allows extending the no. of nodes to 64 K instead of the current 63 still in draft phase The Windows and Linux IEEE 1394 driver developers did not take into account IEEE 1394. 1 bridging in their design This study identified bridge awareness requirements n n implementation possible for the Linux 1394 stack not for the Windows 1394 stack (closed source) Full IEEE 1394. 1 implementation and testing not done during this study n n no IEEE 1394. 1 bridging hardware available the standard may change

Questions ?

Questions ?