Topic: how to create .ko

Hi  i need a small help from u..
Right now i have written two kernel file called client.c and powermnt.c

powermnt.c is using the apis which has been exported by client.c
I need to compile these two files and get .ko.

my crooscompiler path is in /opt/metwk/user/local/gcc-3.3.2-glibc-2.3.2/arm-linux/bin/arm-linux
and my linux tree is in this path /home/mx21/ltib/rpm/BUILD/linux/.

Iam little bit stucked up with the makefile.

Do u have any makefile which i can reuse it.

Can i have my own folder where i can place my .c files and Makefile and do make.

Can u tell how can i compile and build .ko file.

Waiting for ur reply.
Regards,
MMK.

Re: how to create .ko

A good place to start for kernel hacking is KernelNewbies, they maintain a wiki for writing device drivers and how the kernel architecture works, as well as how to build and load modules into your kernel. I'd also recommend the O'Reilly book "Linux Device Drivers", I have a second edition version on my shelf that I often refer to that's made for the 2.4 kernel like what's in Chumby. There's also a third edition that helps with 2.6 kernels.

And of course, Google is your friend, there are hundreds of examples of kernel modules and extensions out there.