Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
Freenet DSL
Who's Online
14 user(s) are online (11 user(s) are browsing encyclopedia)

Members: 0
Guests: 14

more...
browser tip
recommendation!
Sponsored
partner

Sysfs

Sysfs is a virtual file system provided by the 2.6 Linux kernel. Sysfs exports information about devices and drivers from the kernel device model to userspace, and is also used for configuration.

= History =

During the 2.5 development cycle, the Linux driver model was introduced to fix several shortcomings of the 2.4 kernel:

  • No unified method of representing driver-device relationships existed.
  • There was no generic hotplug mechanism.
  • Procfs was cluttered with lots of non-process information.
  • Sysfs is designed to export the information present in the device tree which would then no longer clutter up procfs. It was written by Patrick Mochel. Maneesh Sony later wrote the sysfs backing store patch to reduce memory usage on large systems.

    = Technical Overview =

    For each object added in the driver model tree (drivers, devices including class devices) a directory in sysfs is created. The parent/child relationship is reflected with subdirectories under /sys/devices/ (reflecting the physical layout). The subdirectory /sys/bus/ is populated with symbolic links, reflecting how the devices belong to different busses. /sys/class/ shows devices grouped according to classes, like network, while /sys/block/ contains the block devices.

    For device drivers and devices, attributes may be created. These are simple files; the rule is that they should only contain a single value and/or allow a single value to be set (unlike some files in procfs, which need to be heavily parsed). These files show up in the subdirectory of the device driver respectively the device. Using attribute groups, a subdirectory filled with attributes may also be created.

    = Some busses =

    == PCI ==

    Exports information about Peripheral Component Interconnect devices.

    == USB ==

    Contains both USB devices and USB hosts.

    == S/390 busses ==

    As the S/390 architecture contains devices not found elsewhere, special busses have been created:

  • css: Contains subchannels (currently the only driver provided is for I/O subchannels).
  • ccw: Contains channel attached devices (driven by CCWs).
  • ccwgroup: Artificial devices, created by the user and consisting of ccw devices. Replaces some of the 2.4 chandev functionality.
  • iucv: Artifical devices like netiucv devices which use VM s IUCV interface.
  • = Sysfs and userspace =

    Sysfs is used by several utilities to access informations about hardware and its driver (kernel modules) such as Udev or HAL. Scripts have been written to access information previously obtained via procfs, and some scripts configure device drivers and devices via their attributes.

    =See also=

    *configfs *kobject

    =External links=

    *[http://lwn.net/Articles/31185/ Driver model overview from the LWN porting to 2.6 series] *[http://lwn.net/Articles/54651/ kobjects and sysfs from the LWN porting to 2.6 series]