Implement Linux Device Driver Version 1 of hello1.c: no parameter
Objective: Build and Install a Sample device driver and then compile "hello" program to verify it.
Requirements:
Procedure Step 1
$ cd /usr/src/kernels/linux-2.6.20.1/drivers/char
$ mkdir examples
$ cd examples
$ vi Makefile
Snapshot 1
$ vi hello1.c
Step 2
$ cd /usr/src/kernels/linux-2.6.20.1/drivers/char
$ cp Kconfig Kconfig.old
Snapshot 2
$ vi Kconfig
Snapshot 3
Step 3
Search Makefile for the name IPMI using -> /IPMI
Then add the following line as shown in Snapshot. Don’t put blank line after or before added line.
obj-$(CONFIG_EXAMPLES) += examples/
Snapshot 4
Step 4
$ cd /usr/src/linux-2.6.20.1
$ cp .config .config.old
$ make menuconfig
Snapshot 5 Step 5
$ make modules Snapshot 6 Step 6
$ make modules_install
Snapshot 7
Snapshot 8
$ cd /usr/src/kernels/linux-2.6.20.1/drivers/char/examples
Snapshot 9
Snapshot 10 Step 9
Snapshot 11
$ /sbin/modinfo /usr/src/linux-2.6.20.1/drivers/char/examples/hello1.ko Snapshot 12 |