Msc Present

Embed Size (px)

Citation preview

  • 8/2/2019 Msc Present

    1/32

    A Comparative Study of the Linux

    and Windows Device DriverArchitectures with a focus on

    IEEE1394 (high speed serial bus)

    drivers

    Melekam [email protected]

    Supervisors Prof. Richard Foss, Bradley Klinkradt

  • 8/2/2019 Msc Present

    2/32

    Overview

    The Linux and Windows driverarchitectures

    The Linux and Windows IEEE 1394

    driver stacksDriver development on the two platforms

    Results of the study

  • 8/2/2019 Msc Present

    3/32

    Why the study was conducted ?

    Microsoft Windows and Linux

    Two of the most popular operating systems

    No previous comparisons of their driverarchitectures done by other researchers

    IEEE 1394 (firewire)

    Popular bus offering high data transfer rates

    Active research area for the CS departments

    Audio Engineering Group

  • 8/2/2019 Msc Present

    4/32

    IEEE 1394

    Data Transfer rates of 100, 200 and 400Mbps

    Isochronous mode of transfer

    Guaranteed bandwidth (80%)

    Asynchronous mode of transfer

    Guaranteed packet delivery (20% or more)

    Fully plug n play

  • 8/2/2019 Msc Present

    5/32

    IEEE 1394 Consumer Products

  • 8/2/2019 Msc Present

    6/32

    Device Drivers

    A driver is a piece of software that extends akernels functionality

    Drivers enable applications (through the kernel)

    to transfer data to and from a device

    to control the a device to allow modification of itsattributes

    Composed of a set of routines that a kernel callsat appropriate times e.g. read/write

  • 8/2/2019 Msc Present

    7/32

    Typical driver routines

    A driver would implement

    Initialisation

    Cleanup

    Open

    Read

    Write

    I/O Control (ioctl)

    Close

  • 8/2/2019 Msc Present

    8/32

    The Windows driver architecture

    Standard model The Windows

    Driver Model

    (WDM)bus, functional &filter drivers

    PnP & Power

    management Communication

    I/O request packets(IRPs)

  • 8/2/2019 Msc Present

    9/32

    The Linux driver architecture

    No standard drivermodel

    Drivers aremodules

    No PnP & Powermanagementmessage

    dispatching Communication

    through directfunction calls

  • 8/2/2019 Msc Present

    10/32

    Side by side comparison of the two driverarchitectures

    LinuxWindows

  • 8/2/2019 Msc Present

    11/32

    IEEE 1394 driver stacks

    The Windows IEEE 1394 stack closed source

    maintained by Microsoft

    stable

    The Linux IEEE 1394 stack open source

    maintained by the Linux 1394 community(private individuals)

    tagged experimental

  • 8/2/2019 Msc Present

    12/32

    The Windows IEEE 1394 stack

    Host controller

    Bus driver

    Client driversCommunication

    I/O request

    block (IRB)

  • 8/2/2019 Msc Present

    13/32

    The Linux IEEE 1394 stack

    Host controller

    Bus drivers

    Client driversCommunication

    direct function calls

    Direct driver

    possible

  • 8/2/2019 Msc Present

    14/32

    Side by side comparison of the twoIEEE 1394 stacks

    LinuxWindows

  • 8/2/2019 Msc Present

    15/32

    The Windows IEEE 1394implementation

  • 8/2/2019 Msc Present

    16/32

    The Linux IEEE 1394implementation

  • 8/2/2019 Msc Present

    17/32

    What operations should IEEE 1394client drivers provide ?

    Asynchronous Operations Read Write Lock Listen Register Asynchronous Listening Deregister Asynchronous Listening

    Isochronous operations Listen Talk Asynchronous streaming

  • 8/2/2019 Msc Present

    18/32

    What operations should IEEE 1394client drivers provide ? (Continued)

    Bus reset handling

    Register Bus Reset Handler

    Generate Soft Bus Reset

    Obtain Bus Information (e.g. node count)

    Local configuration ROM manipulation

    Network troubleshooting Pinging of nodes

  • 8/2/2019 Msc Present

    19/32

    Device Driver DevelopmentEnvironments

  • 8/2/2019 Msc Present

    20/32

    Issues to be considered whencreating drivers

    Memory management The kernel provides memory allocation/de-

    allocation routines

    Has two pools of memory (swappable, non-swappable)

    Data structures The kernel provides implementations for

    queues, lists, stacks

    Synchronisation with spin locks, mutexes,semaphores, signal objects

  • 8/2/2019 Msc Present

    21/32

  • 8/2/2019 Msc Present

    22/32

    Map of software produced during

    this study

  • 8/2/2019 Msc Present

    23/32

    Windows raw1394 driver

  • 8/2/2019 Msc Present

    24/32

    Linux raw1394-2 driver

  • 8/2/2019 Msc Present

    25/32

    Linux Ieee1394diag

  • 8/2/2019 Msc Present

    26/32

    Driver Tests

    Tests were run to determine

    highest data transfer rates that can be achieved byeach of the IEEE 1394 drivers

    how close these came to the theoretical maximum of50MB/s

    Bus analyser used to measure

    the duration of data transfers

    the amount of data transferred

    Calculated

    the data transfer rate in MB/s

  • 8/2/2019 Msc Present

    27/32

    Test results

    Isochronous mode Windows raw1394

    8.9 MB/spacket size 1024 bytes

    Linux raw1394

    4.5 MB/spacket size 512 bytes

    Isochronous mode (buffered) Linux raw1394-2

    8.9 MB/spacket size 1024 bytes

    Windows raw139417.7 MB/spacket size 2048 bytes

  • 8/2/2019 Msc Present

    28/32

    Test results (continued)

    Drivers from both Linux and Windows donot transfer data at a rate close to thetheoretical

    50MB/s They achieve almost half that

    due to the PCI bus bottleneck (theoretical132MB/s)

    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

  • 8/2/2019 Msc Present

    29/32

    Conclusion

    A comparison of the Windows and Linux driverarchitectures has shown that

    Drivers for the two platform have similar components

    composed of routines for performing I/O and device control

    drivers are modules which are loadable at runtime

    Windows has a formally defined driver model, Linuxdoes not.

    PnP and power management support integrated inthe Windows architecture, not so in Linux

  • 8/2/2019 Msc Present

    30/32

    Conclusion (continued)

    A comparison of the Windows and Linux IEEE1394 stacks has shown that Their IEEE 1394 driver stacks are broken up into

    similar layers

    host controller, bus and client driver layers

    Each stack provides the standard IEEE 1394operations (both asynchronous and isochronous)

    The Linux IEEE 1394 stack is open source while

    the Windows stack is proprietary Easier to create IEEE 1394 drivers for Linux than

    Windows since all source code is available

  • 8/2/2019 Msc Present

    31/32

    Future work

    IEEE 1394.1 bridge awarenessIEEE 1394.1 allows extending the no. of nodes to 64K instead of the current 63 still in draft phase

    The Windows and Linux IEEE 1394 driver developers did not take

    into account IEEE1394.1 bridging in their designThis study identified bridge awareness requirements 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 thisstudy

    no IEEE 1394.1 bridging hardware available the standard may change

  • 8/2/2019 Msc Present

    32/32

    Questions ?