Results 1 to 5 of 5
Hi,
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) ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-10-2005 #1Just Joined!
- Join Date
- May 2005
- Posts
- 3
accessing a driver
Hi,
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 !
bye
Thomas
- 05-10-2005 #2
which functions are they? Certain userspace functions ultimately end up invoking a set of standard kernelspace functions.
- 05-10-2005 #3Just Joined!
- Join Date
- May 2005
- Posts
- 3
The functions are :
- spi_access
- spi_transfer
- spi_release
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 ?
- 05-10-2005 #4
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?
- 05-11-2005 #5Just Joined!
- Join Date
- May 2005
- Posts
- 3
Hi,
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.
Thomas


Reply With Quote
