Linux Drivers how to since kernel 2.6x  - Page 1
Forum section: electronics / projects

author: Morgoroth
author_rank: Regular Contributor
timestamp: October 06, 2016, 04:10:32 pm
content: Hi all !!!!Quick question for the masters of Linux, I have to make Linux driver and I don't write one since 2.6x Kernel version... we are on 4.x, I've checked a couple of books, but I'll feel better is someone more experienced could recommend whats better to get up to date.Best regards,JP

author: setq
author_rank: Frequent Contributor
timestamp: October 06, 2016, 04:27:59 pm
content: AFAIK it's the same. Last one I touched was 2.6 though as well and that was just fixing drivers, not writing them. Last driver I wrote was pre-1.0 NetBSD back in the dark ages and that was on SPARC.There's a nice tutorial here I had bookmarked though:http://derekmolloy.ie/writing-a-linux-kernel-module-part-1-introduction/

author: nctnico
author_rank: Super Contributor
timestamp: October 06, 2016, 04:31:40 pm
content: I bought the 3rd edition of 'Linux Device Drivers' a couple of years ago. Most of the stuff is relevant but it helps to use an example from the actual kernel.

author: rob77
author_rank: Super Contributor
timestamp: October 06, 2016, 10:29:24 pm
content: last time i wrote a driver for 2.6 (network). the very basic concepts should be the same, there were no drastic changes in the kernel as far as i know.and as always.. the best way to get up to date is to start writing and hitting the differences on the flyi did it the same way during 2.4 to 2.6 transition.

author: Morgoroth
author_rank: Regular Contributor
timestamp: October 07, 2016, 02:50:39 am
content: Quote from: setq on October 06, 2016, 04:27:59 pmthanks for the tutorial, quite complete for my needs.JP

author: Morgoroth
author_rank: Regular Contributor
timestamp: October 07, 2016, 02:55:09 am
content: well, seems like the general opinion is just start writing some driver with good probabilities to survive without incidents, as I read seems like the differences are minimal between different kernel versions.Thanks all for the comments.JP

author: bingo600
author_rank: Super Contributor
timestamp: October 07, 2016, 07:59:34 pm
content: The LDD 3'ed book is free herehttps://lwn.net/Kernel/LDD3//Bingo

author: blackbird
author_rank: Regular Contributor
timestamp: October 09, 2016, 08:34:40 pm
content: Last year I wrote a small device driver for Linux kernel 4.2, the documentation I've used as a reference was not very different to the kernel 2.6 docs.

author: Kohanbash
author_rank: Regular Contributor
timestamp: October 13, 2016, 01:16:23 pm
content: What type of driver? Are you interacting with direct memory registers (bit setting registers, etc..)? or standard serial/ethernet type devices?

author: Morgoroth
author_rank: Regular Contributor
timestamp: November 06, 2016, 02:32:58 pm
content: Sorry for the delay, but has been very bussy month with chango of country and all.Is a driver for DMD chip (DMD2010) for projectors, I want to improve the control of the device given some other sensors we have on board and hide the control of the device too.The device is controlled by I2C from the system on module we have running now (a variscite dart-sd410).JP

author: rob77
author_rank: Super Contributor
timestamp: November 06, 2016, 02:55:19 pm
content: Quote from: Morgoroth on November 06, 2016, 02:32:58 pmcan't you simply do the I2C communication from user space ?btw... how exactly is the DMD interfaced ? as per datasheet it's supposed to be paired with a display controller.

author: Morgoroth
author_rank: Regular Contributor
timestamp: November 06, 2016, 03:35:50 pm
content: yes, indeed is working in that way now, but seems like we have to change to Android as last news.the DMD is paired with two other controllers, DLPC3430 and DLPA2005, and the I2C line goes to the DLPC3430.JP