LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 11-13-2003, 08:38 PM   #1
jcbetterman
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?

thx.
 
Old 11-13-2003, 10:13 PM   #2
infamous41md
Member
 
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.
 
  


Reply



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 10:24 PM
Make not working? Please help! iansoundz Linux - General 7 07-06-2005 04:12 AM
Make not working eggoz Linux - Software 2 09-26-2004 06:33 PM
how to make a driver patch disk scarabs Linux - Hardware 1 03-18-2004 06:08 PM
how can i make my driver working jcbetterman Linux - Newbie 1 11-13-2003 09:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:17 PM.

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