LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how can i make my driver working?:):) (https://www.linuxquestions.org/questions/programming-9/how-can-i-make-my-driver-working-115789/)

jcbetterman 11-13-2003 08:38 PM

how can i make my driver working?:):)
 
hi all. i'm a newbie. and i wanna write a usb driver.
my OS is RH9.0
kernal version is 2.4.20

i complied the usb-skeleton.c and rename it myusb.o
then i guessed i should register myusb.o module in the kernel but failed

what i did is in the following:

1. insmode myusb.o
2. cp myusb.o /lib/modules/`uname -r`/kernel/drivers/usb

then i saw a nod created in /dev/usb called myusb

ok.that's all i've done.

then i wrote a test.c to access the node
int main(void)
{
int fd=open(" /dev/usb/myusb ");
cout<<fd << endl;

return 0;
}

run it, return -1. it means the node cannnot be accessed.

i guess there is something wrong when i install myusb.o in the kernel.
but i donot konw what is wrong.
anyone who can help me that how can i install my driver in RH and run it
properly plz?

thx.
:p :p :)

infamous41md 11-13-2003 10:13 PM

im really no driver whiz, im just starting on 'linux device drivers', but from that description it could probably be numerous things. when u do lsmod, does it list your module? you have the source, so look at the open_ method and see why it returns -1. if the source is any good it should have some comments explaining what's happening or u should have some documentation.


All times are GMT -5. The time now is 06:13 PM.