Linux Device Driver Development - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Linux Device Driver Development

Description:

Gets complicated very quickly (lots of macros, code) Need to have a sense of ... Acer Labs M5632 Bridge Cable. Worked fine using the standard USB 1.0 Driver ... – PowerPoint PPT presentation

Number of Views:938
Avg rating:3.0/5.0
Slides: 21
Provided by: christoph100
Category:

less

Transcript and Presenter's Notes

Title: Linux Device Driver Development


1
Linux Device Driver Development
  • Chris Lydick
  • Spring 2007

2
Class Schedule
3
Textbook List
  • J. Corbet, A Rubini, G Kroah-Hartman. Linux
    Device Drivers, 3rd Ed.
  • Available for download online!
  • http//lwn.net/Kernel/LDD3/

4
Operating Systems 101
  • Ive not had Operating Systemsbut
  • Role of Device Drivers
  • Mechanism vs. Policy
  • Black Box
  • Semi/undefined interface (device) -gt Well defined
    interface (Linux API)

5
Operating Systems 102
  • Uses C Language
  • Gets complicated very quickly (lots of macros,
    code)
  • Need to have a sense of ...
  • concurrency, race conditions
  • interrupts, deferred work
  • mutual exclusion
  • kernel and user-space memories
  • pointers, structures, (lots to consider)

6
Operating Systems 103
  • Textbook has provided lots of skeletons and
    demos (Wheew!)
  • My testbed Fedora Core 4, 2.6.11 (book requested
    2.6.10)
  • Should we start with. Hello World?

7
(No Transcript)
8
(No Transcript)
9
(No Transcript)
10
Operating Systems 104
  • OK, easy So what.
  • Before digging deeper, consider 3 types of device
    drivers
  • Character Devices (stream of bytes)
  • Block Devices (file systems)
  • Network Interfaces (duh.)

11
Operating Systems 105
  • Char devices
  • Scull (Simple Character Utility for Loading
    Localities) testbed for Char devices.
  • Scull0..3 global/persistent memory
  • Scullpipe0..3 FIFO pipes demonstrate contention
  • Scullpriv private data for each console

12
Operating Systems Lab Exercises
  • Scull0 demonstration
  • Scullpipe0 demonstration
  • Scullpriv demonstration
  • Short (Temperature Sensor)
  • Shortprint demonstration

13
(No Transcript)
14
Operating Systems Final
  • Other Areas of Interest
  • Snull (network interface skeleton)
  • USB-Skeleton (yep.)
  • PCI-Skeleton (ok.)
  • Sample Disk Driver (cool.)
  • TTY Drivers, DMA and Memory Mapping, etc.

15
Motivation
  • My Thesis Supercomputing Cluster in 031
    Rathbone
  • USB Connectivity driver timeouts/overflows in
    OpenBSD
  • Communicated with Chris Pascoe (OpenBSD Developer)

16
Motivation
  • Acer Labs M5632 Bridge Cable
  • Worked fine using the standard USB 1.0 Driver
  • Issues arose with the USB 2.0 (EHCI) driver diff
    file
  • Abused the kernel profiling framework to check
    at runtime for kernel stack overflows.
  • Were switching to Linux (no issues), but its
    good to know how to dig into drivers right?
  • Plus, isnt Linux supposed to be better than
    Windoze?

17
Reverse Engineering 101
  • Reverse Engineering Getting something to work by
    watching it work when correctly loaded.
  • Usually occurs within Windows (sorry, we just
    cant get away from Microsoft!)

18
Reverse Engineering 102
  • USB Devices (URB)
  • USB Analyzer/Sniffer (Snoopy, USB Monitor,..)
  • Acts similarly to Ethereal
  • /sys/devices/pci000000/0000002.0/usb2/
  • PCI Bus
  • Hardware Sniffers (much more difficult to
    analyze!)

19
(No Transcript)
20
Conclusions
  • GET THE BOOK! Its very helpful and is a great
    reference!
  • Examples are available for download
  • Book is freely available (wget it before its
    gone!)
  • Next step USB!
Write a Comment
User Comments (0)
About PowerShow.com