I have written one driver for one device in Linux. How can I create (using
.ko file so that I can insert it into the kernel?
Assuming your module's source is in
Short answer: you can't. A .ko file is more than just a compiled version of your driver source. The kernel build system includes some extra information for instance (compiler version, module dependencies, ...).
You can probably dig through the kernel build system to find all required operations, but you shouldn't. It will almost certainly break with the next kernel release, or the one after that. You should use the makefile ephemient supplied.