Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-13-2003, 09:38 PM   #1
LQ Newbie
Registered: Nov 2003
Posts: 4

Rep: Reputation: 0
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?

Old 11-13-2003, 11:13 PM   #2
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't make modem driver... markw8500 Linux - Software 14 08-27-2005 11:24 PM
Make not working? Please help! iansoundz Linux - General 7 07-06-2005 05:12 AM
Make not working eggoz Linux - Software 2 09-26-2004 07:33 PM
how to make a driver patch disk scarabs Linux - Hardware 1 03-18-2004 07:08 PM
how can i make my driver working jcbetterman Linux - Newbie 1 11-13-2003 10:09 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:59 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration