Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Fortunately writing Linux drivers is not overly complicated, although somewhat more than can be taught within this forum. However the good news is that there are many sources available on the web that does a very good job on explaining exactly what you are wanting to do. Here are just few that I have used (even to make GPIO/LED control drivers), and they do provide source code that works and can be used as a base for your driver.</p> <p><a href="http://www.freesoftwaremagazine.com/articles/drivers_linux" rel="noreferrer">Free Software Magazine article</a></p> <p><a href="http://tldp.org/LDP/lkmpg/2.6/html/lkmpg.html" rel="noreferrer">Linux Documentation Project article</a></p> <p><a href="http://www.makelinux.net/ldd3/" rel="noreferrer">O'Reilly Linux Drivers book</a></p> <p><a href="http://www.linuxjournal.com/article/2476?page=0,0" rel="noreferrer">Linux Journal article</a></p> <p>The very "TinkerToy" nature of Linux provides a lot of flexibility. For instance, you might consider having your driver attach to the "/proc" file system as well (using create_proc_entry() API), this way you can access your driver without needing to write a dedicated application by simply "echo YOURSTRING > /proc/mygpiomodule" strings to your driver. To read from the driver would use "cat /proc/mygpiomodule". The links above also include examples on doing this as well. This can help with testing, and accessing your driver via startup scripts if you need to do that.</p> <p>Take some time to review the articles/books I listed above, and certainly Google for more if you need to. Go ahead dive right in, and compile up and run some of the examples, and you will come up to speed rather quickly. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload