Well here it is...
NOTE: "pgm means 'program' in this context"
1. Download a driver source pgm or construct it yourself. Choose as you wish...
2. write a make file that can handle the ordered compilation of your program and its dependencies.
For example:
obj-m:
pgm_name.o
pgm_name-objs:
dependency1.o dependency2.o .......
In this example obj-m represents that 'pgm_name' in this directory is built as a loadable kernel module and pgm_name-objs
represent the pgm's dependencies if any.....
if you need your driver to be a built in, then just use obj-y in place of obj-m....That's it.
3.then execute the make with the command
make -C $(dir of Top makefile) M=$(PWD) modules
Note: if the driver is to be a built-in then you have to compile the entire kernel.......Sorry, No way!
4.Now in the present directory you will get the .ko file.
5.Insert this module to the kernel, using
#insmod ./pgm_name.ko
('insmod' needs root permission)
Further questions are invited..........