LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-10-2017, 10:33 AM   #1
tripialos
Member
 
Registered: Apr 2012
Posts: 169

Rep: Reputation: Disabled
writing a simple Driver for Linux


I would like to write a very simple driver for Linux just for experience and to get better understanding of the kernel internals.

I found this article where this guy writes a driver for a USB Visual Signal Indicator. I really enjoyed the article and got me in the mood to do something similar however the specific hardware is quite expensive for me.

Is there any other simple hardware where you can write a simple driver?

Can you recommend any other idea for writing a simple driver for a device ?

I don`t like to just create a "hello world" driver for a virtual device"
 
Old 02-10-2017, 11:28 AM   #2
swampthing001
Member
 
Registered: May 2005
Distribution: LFS, CentOS, Slack, Ubuntu
Posts: 112

Rep: Reputation: 8
A little off topic but have you seen the Eudytula Challenge? It's pretty interesting and if I remember right there is a section/challenge for drivers. Best of luck.
 
Old 02-10-2017, 12:06 PM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,009

Rep: Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627
if you wish you can buy a raspberry pi (or similar) and some hardware (a few leds, or whatever you like). You can write a simple driver for that and also user space programs to check if that works.
 
Old 02-10-2017, 04:21 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,148

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Get the full scoop with a modern book. This is older but has basis. https://lwn.net/Kernel/LDD3/

I think BeOS had blinky lights. You could write a driver to make the lights go on or off. Doubt it would be that easy in any of today's hardware. More than a few layers to go through.

Steps on making a driver.

One is to look at others work, for example on a NIC. They may have documented that they used this or that to get going. Having the source code of a similar device is MOST helpful. Writing from scratch is very difficult for a newbie. If you have source for some device then you can look at it and use tools to step it through or view errors. The simple changing of a chip model on a very common product is enough to make driver writers go crazy.

I'll say this but you rarely have access to it. If you have design metrics or other inside information about a device that tends to be the most help. In some cases looking at windows drivers or mac drivers helps the author create a driver.

I wish you the best of luck. Some folks seem to do much better at figuring out drivers than others. You may have a knack for it.

Last edited by jefro; 02-10-2017 at 04:23 PM.
 
  


Reply

Tags
drivers


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
Writing a simple DHCP server (for Linux) prushik Programming 0 11-29-2012 06:44 AM
Writing a Simple Pass-through driver for the ethernet....?? gauravholey Linux - Kernel 0 07-09-2009 08:20 AM
Writing Simple Device Driver In Linux i_love_linux Linux - Kernel 6 09-04-2007 08:16 PM
writing a simple file system in linux Deepthi_57 Linux - Newbie 1 05-03-2004 01:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:45 AM.

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