looking for simple module/driver programming examples in source tree

Robert P. J. Day rpjday at crashcourse.ca
Tue May 3 09:44:47 EDT 2011


On Tue, 3 May 2011, Mandeep Sandhu wrote:

> >> >   so have proc/seq file been massively deprecated in favour of sysfs
> >> > attribute files, then?
> >>
> >> Yes, that happened about 8 years ago :)
> >>
> >> No driver should ever add a proc file, it's that simple.
> >
> >  oh, i was aware that the preference was for sysfs attr files.  i
> > just didn't realize it was that stringent.  thanks.
>
> I think the 'strictness' comes from the fact the /proc system was
> heavily abused for dumping just about any info into it (in the early
> days 2.4 kernel, I think).
>
> /proc was originally meant for putting 'process' specific info
> (thats why the name - proc) and not for device drivers. CMIIW.
>
> sysfs is a dedicated place for device drivers to export info to
> userland.

  and i can accept that.  i'm still going to cover (briefly) how /proc
files work simply because there's a lot of them and i don't see them
going away any time soon, but i'll emphasize that they are a bad thing
for new drivers.

rday

p.s.  on that note, of course, i'm interested in really simple
examples of drivers that create increasingly complex collections of
sysfs attr files.  i *really* like to explain stuff like this by being
able to point at existing drivers in the tree.

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================


More information about the Kernelnewbies mailing list