knewbies project? - updating LDD3 source
Javier Martinez Canillas
martinez.javier at gmail.com
Tue May 24 16:17:32 EDT 2011
On Tue, May 24, 2011 at 8:14 PM, DG <dangets at gmail.com> wrote:
> On Tue, May 24, 2011 at 11:47 AM, Robert P. J. Day
> <rpjday at crashcourse.ca> wrote:
>> On Tue, 24 May 2011, Jim Cromie wrote:
>>
>>> over at http://code.google.com/p/ldd3/
>>> it says:
>>> The famous "Linux Device Drivers" released the sample code. but the
>>> code does not reflect the latest kernel updates, some of code cannot
>>> even compile. This project is to make it compatible with the current
>>> kernel.
>>>
>>> http://lwn.net/Kernel/LDD3/
>>> http://examples.oreilly.com/9780596005900/
>>
>> the one caution i would give here is that quite a bit of code in
>> LDD3 shouldn't be updated, anyway, since it reflects features that
>> have been deprecated for quite some time.
>>
>> for instance, no one should be writing proc files anymore. also,
>> ioctl()s are also discouraged for the most part. so i would be
>> selective about what parts of LDD3 code *should* be updated as
>> examples of good kernel programming.
>>
>> rday
>
Robert is right, the drivers are quite old. As Robert says proc files
are deprecated in favor of sysfs and ioctl are discouraged in favor of
netlink sockets. Another example is that most LDD3 driver modules are
loaded with a script that create the device nodes. Unless your system
is a embedded device (an even in that case) you should let udev do
this). So instead of having drivers that just compile cleanly and
works, it would be better to update the APIs the drivers use and how
they interact with userspace.
> There is a repo on GitHub with the same purpose. I haven't checked it
> out personally, but it's probably worth a look.
>
> https://github.com/martinezjavier/ldd3
>
As the author of the repo I can tell that the drivers compile with
kernels 2.6.32, 2.6.35 and from 2.6.37 forward (including 2.6.39 and
linux-next). I create it for academic purposes, I haven't thest all
the drivers, only the ones I needed for the students.
Best regards,
--
Javier Martínez Canillas
(+34) 682 39 81 69
PhD Student in High Performance Computing
Computer Architecture and Operating System Department (CAOS)
Universitat Autònoma de Barcelona
Barcelona, Spain
More information about the Kernelnewbies
mailing list