kernel driver question 2.6.12
I am fairly new to linux but not to C (fairly compitent) and understand some about the operating system.
I have been trying to implement some code that has been working well in user space but the overhead is too much and there is no simple way to open its functionality to more user.
I have currently implemented a pipe to allow a user to read the data that I have available in my fifo.
So I get an callback from hardware
memcpy into my fifo
pthread listens via non blocking open on pipe.
I then do non blocking writes to pipe.
I have subsiqently attempted to move the code into a kernel driver so that I can act as a basic char device and using the open close and read functions so I can serve multiple readers.
All is simple I can get the basic framework compiling and I can do the simple cat of the device to show the open read and close in operation.
I then ported accross the code that receives the callback from hardware and copies into a buffer. The problem I am facing is that in order to access the hardware now it is in another kernel driver (which I had hacked into previously but i need to be stand alone)
To access this kernel driver I need to use ioctls but from what I am experiencing I cannot open a dev device from a .ko and I cannot use ioctls from a .ko
I get a problem when linking that there are unknown references;
*** Warning: "b__set_error" [/opt/sandbox/module.ko] undefined!
*** Warning: "pthread_mutex_lock" [/opt/sandbox/module.ko] undefined!
*** Warning: "pthread_mutex_unlock" [/opt/sandbox/module.ko] undefined!
*** Warning: "b_kernel2user" [/opt/sandbox/module.ko] undefined!
*** Warning: "proc_open" [/opt/sandbox/module.ko] undefined!
*** Warning: "errno" [/opt/sandbox/module.ko] undefined!
*** Warning: "ioctl" [/opt/sandbox/module.ko] undefined!
but I have included the appropriate header files.
I cant find anywhere a list of functionality that is available to me from a .ko
If anyone can help or point me in the right direction I would be greatful.
I should add that I am cross compiling for an embedded platform that is using the UcLinux and 2.6.12 kernel.
Last edited by marcm; 10-09-2008 at 11:11 AM.
Reason: addition of CC info