Lab 5
Purpose: Introduction to Device Drivers in Linux
Reading:Install your sonar onto the CerfBoard System. The CerfBoard has its own power supply, but MAKE SURE TO CONNECT THE SONAR AND CERF GROUNDS TOGETHER BEFORE TURNING ON POWER!! Refer to the CerfBoard hardware documentation and to the StrongARM documentation. Pick two pins that are available on Port0 or Port1 of the Cerf break-out-board that correspond to GPIO pins on the sa1100. Connect INIT to one of these pins and connect ECHO to the other. Make sure to check the output enable and port direction settings of the DIP switch on the Intrinsyc break-out-board.
1. It should allow any number of processes to open the same sonar device
mknod creates a special file, in this case a character special file
(that's the c option). We don't care about the minor version
number, so arbitrarily choose 0.
major_version_number is the number in the #define
directive in your driver module. The major version number in Linux is essentially an index by which the
operating system can refer to drivers. It does not have anything to do with the
particular release version of the driver. Indeed major version numbers can be
assigned dynamically (thus avoiding conflicts) but we are not going to take
this approach.
GPIO Hints
The kernel defines macros to make GPIO programming easier:
Edge triggering:
IRQs:
Breakout Board:
Device Driver Code