Presentation is loading. Please wait.

Presentation is loading. Please wait.

Linux Device Driver Development Chris Lydick Spring 2007.

Similar presentations


Presentation on theme: "Linux Device Driver Development Chris Lydick Spring 2007."— Presentation transcript:

1 Linux Device Driver Development Chris Lydick Spring 2007

2 Class Schedule CIS e (π*i) TU10:30 Intro to Device Drivers Lydick PSYCH 012 MWF11:30 My Motivation Lydick EECE MWF9:30 Reverse Engineering Lydick LAB 0 F2:30p Demonstrations Lydick

3 Textbook List J. Corbet, A Rubini, G Kroah-Hartman. Linux Device Drivers, 3rd Ed. Available for download online!

4 Operating Systems 101 Ive not had Operating Systems…but… –Role of Device Drivers Mechanism vs. Policy Black Box Semi/undefined interface (device) -> 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, (book requested ) Should we start with…. Hello World?

7

8

9

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 13

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][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/pci0000:00/000:00:02.0/usb2/ PCI Bus Hardware Sniffers… (much more difficult to analyze!)

19

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!


Download ppt "Linux Device Driver Development Chris Lydick Spring 2007."

Similar presentations


Ads by Google