代码改变世界

sysfs

2011-08-06 23:59  RayLee  阅读(280)  评论(0编辑  收藏  举报

A feature introduced in version 2.6 of the kernel is sysfs. This is a virtual filesystem that provides well-organized and very detailed information about available devices, their configurations and their state. The information is accessible both from within the kernel and from user space.

One of the guiding principles of sysfs is that each file in /sys should represent only one attribute of the underlying device.

Originally, information about device configuration was found in the /proc filesystem if it was available at all. Although /proc will continue to hold run-time information about processes and the kernel, it is anticipated that device-specific information will be moved to /sys over time.