March 19, 2024, 04:32:53 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: Having trouble writing a kernel module  (Read 6901 times)

Offline SuperSpry

  • New Member
  • Posts: 1
Having trouble writing a kernel module
« on: September 06, 2012, 10:02:16 PM »
I'm trying to write an API as a kernel module and hope to be able to call functions from my module in device drivers. These are the steps I have followed. Am I missing anything?

1.) Write module with some functions (code.h and code.c).
2.) Build module, load with insmod.
3.) Copy code.h into <kernel>/include/linux directory.
4.) #include <linux/code.h> in a driver.
5.) Add a call to a function from my API in the driver.
6.) Build the driver, load with insmod.

But this isn't working. When I try to build the driver, I get warnings saying that the API functions are undefined. Any idea what's going on?