accessing a driver
sorry if the question seems trivial for some of you, it is not for me. Here is my problem :
the linux i use (embedded linux 2.4.27 for arm) has a driver for the spi bus that exports three functions (you can see them in the /proc/ksyms) which i want to access. It is obviously possible to do that by writing a module and then loading it in the kernel. But how can i access them from the user space ?
Thanks in advance for any help !
which functions are they? Certain userspace functions ultimately end up invoking a set of standard kernelspace functions.
The functions are :
They are really hardware specific (when you look into the code) and the problem is : which user space instruction would call these kernel space functions ?
They would probably be covered by open(), read()/write(), and close(), depending on how the driver was written.
Let's say that the device structure was called "spi". If spi's open was set to spi_access(), then the open() system call would call spi_access().
Catch my drift?
Ok, i understand now that the driver should implement the system calls that would make the link between the open(), ... syscalls and the spi_access, ... functions. But here is my misfortune : it doesn't. There is no implementation of any system calls in the code.
So here is what i am thinking at this point :
- do you think it would be a good solution to write my own module that would implement the system calls ?
- i still don't understand how this "driver" works : it seems to be registered as a classic driver (major number 153, as a good spi driver should be) with it's entry in /dev, but i don't get where and when this is done
- i know my question must seem quite clumbsy : sorry, i'm a kind of newcomer to linux !
Thanks in advance if you can help me, and thanks anyway for pointing me the system call mecanism.