I and my colleague were discussing sometime back about the kernel and how the data flow occurs from user to the hardware. How is the kernel driver api is called and in what sequence? Then He poped one question to me - why do we require the SYSFS when we already have DEVFS?
My first answer was - devfs is the one which actually talk to device driver and the using sysfs, we set or get the attributes for the device. But this answer was not convincing. He posted the question in stackoverflow.com and searched but it was not convincing. Even I wondered how two are different.
Searching the internet tells that the sysfs was originally developed to test the new device model which was being written for the kernel 2.5 version. That time the procfs was used primarily for the testing but since the procfs is basically fs for the information on process and other system related information. Due to this, procfs was cluttered with lots of non-process information. So the whole idea was to write a new file system which can aide to the development of new device model. Moreover, there was no mechanism for hotplug in linux kernel. So with the development of new sysfs (previously called ddfs which was based on in-memory fs, ramfs), these were achieved.
Sysfs is a virtual filesystem which provides a userspace-visible representation of the device model. The sysfs filesystem is usually mounted on /sys. Sysfs is designed to export the information present in the device tree which would then no longer clutter up procfs. Sysfs is used by several utilities to access information about hardware and its driver such as udev. Scripts have been written to access information and some scripts configure device drivers and devices via their attributes. For every kobject that is registered with the system, a directory is created for it in sysfs.
I think, this is a good point to start discussion on this topic. Hope, this clears some of the doubts. Still I have some doubts, which I am googling right now ;)
cya then...for now The Big Bang Theory (specially Penny) waiting for me...Bazingaaaa