EBC Exercise 26 Device Drivers

From eLinux.org
Revision as of 18:57, 31 March 2011 by Yoder (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Chapter 8 of the text [1] gives a nice example of a minimal device driver. The purpose of this lab is to implement that driver.

Minimal Device Driver Example

Follow the 5 steps given in section 8.1.4 on page 205. You can get a copy of Listing 8-1 here (ECE497_Listings_for_Embedded_Linux_Primer_Chapter_8). Once finished you will have a file called hello1.c in .../drivers/char/examples and have the kernel configure file and Makefile updated for the new driver. See section 4.4 on page 89 for help with modifying the config files.

Note: There is a typo in Listing 8-2.

If you have created the crossCompileEnv.sh file and sourced it, all you have to do to make the modules is cd to the top of the kernel directory and then:

$ make modules

Mine took a while the first time as it appears to compile all the modules.