LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 02-02-2008, 07:07 AM   #1
redarrow
Member
 
Registered: Jul 2005
Location: South Africa
Distribution: Fedora Core
Posts: 32

Rep: Reputation: 15
Linux USB device driver programming?


Hi,

I have a mostly unsupported device (Creative Prodikeys PC-MIDI keyboard).
I would like to learn about driver programming under Linux, in specific USB driver programming. I am capable in C (although I'm not an ace) and I have read through the "Linux Kernel Module Programming Guide".

What I'm looking for is some documentation or perhaps a "howto" dealing with USB driver writing under Linux.


Any pointers would be appreciated.

Thanks!
 
Old 02-02-2008, 08:09 AM   #2
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
lots involved with device driver writing/maintaining

You'll need a system you can trash. You'll also need this system, because as I recall (and this was many years ago), the only way to debug a device driver is through a serial connection to the target machine running your debug device driver.

You'll need to get hold of an existing USB driver, and look at its construction. That's easier in Linux, because there are so many source kits available.

Few people want to take on the task of writing a device driver. But if you must, be prepared for a lot of effort and hair pulling.
 
1 members found this post helpful.
Old 02-02-2008, 08:34 AM   #3
redarrow
Member
 
Registered: Jul 2005
Location: South Africa
Distribution: Fedora Core
Posts: 32

Original Poster
Rep: Reputation: 15
Yea, I'm aware that it'll probably mean a lot of hair pulling... But I figure that it'll be a worthwhile exercise to gain some more knowledge of the Linux kernel..

I never thought about reading existing sources - I guess that's a good place to start. Thanks!
 
Old 02-02-2008, 01:45 PM   #4
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
Device drivers are actually pretty straightforward.

Google for the O'Reilly book on Linux Device Drivers. You'll find Release 2 pretty quickly, but you really want Release 3. That one is available but is harder to find. I have a copy here that I downloaded as PDF files (I don't recall where from), and it has been a godsend for me.

The real problem you will have is if you don't have appropriate technical documentation for the device you are trying to control. Reverse engineering hardware by poking it in the interface is a simply HUGE job.

Last edited by jiml8; 02-02-2008 at 01:47 PM.
 
Old 02-02-2008, 02:35 PM   #5
redarrow
Member
 
Registered: Jul 2005
Location: South Africa
Distribution: Fedora Core
Posts: 32

Original Poster
Rep: Reputation: 15
I actually placed an order for "Linux Device Drivers" 3rd Edition only today ... but it's going to take a while to arrive..

Yea.. I realise that without the technical docs things are even more complicated.. My plan is to use a USB snooping program with the device on Windows, it's after all purely an input device so it can't be that hard to figure the protocol out.. (I hope!!)

To bad Creative is of no use with the technical docs..
 
Old 02-02-2008, 04:15 PM   #6
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
Yeah, you would think that a keyboard would be pretty simple. In fact, it is simple enough that you would think that some existing driver would work.

I suppose the midi portion is the issue, but if you can use the keyboard as a keyboard using any driver, then you are way ahead. Just take the driver that works and modify it to handle the midi stuff.
 
Old 02-03-2008, 02:54 AM   #7
redarrow
Member
 
Registered: Jul 2005
Location: South Africa
Distribution: Fedora Core
Posts: 32

Original Poster
Rep: Reputation: 15
Yea, the midi portion is the chief issue, but not the only one..
The regular "qwerty" keys mostly work fine, except that at various stages some of them go "dead" for a while and the "ctrl" keys don't work all the time either.. it also has some extra buttons (media control, browser, email etc..) some of them do work but not all of them..

I first want to focus on getting all the regular and extended keys completely functional before I start looking at the midi stuff..

Anyway, thanks for all the tips.. I'll be sure to announce any progress on this "attempt" of mine.. (and of course I'll publicize the driver should I succeed in writing one )
 
  


Reply


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
Newbie to device driver programming ben85 Programming 1 01-24-2008 04:48 PM
device driver programming rebel_angel Linux - Hardware 5 11-30-2006 04:48 AM
help on driver for USB HID device(finger print) in Linux malikamirshehzad Programming 1 02-18-2006 01:48 AM
Linux device driver programming iammisc Programming 1 11-26-2005 10:46 AM
linux device driver programming chandansingh Programming 1 03-26-2005 07:30 AM


All times are GMT -5. The time now is 06:44 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration