Overview of sysfs File System in Linux2.6 Kernel

Source: Internet
Author: User
Linux Kernel sysfs File System Overview-general Linux technology-Linux programming and kernel information, the following is a detailed description. Starting from Fedora 2, there will be a/sys directory under the root directory. For more information, see mount. This directory contains a sysfs file system.

The Linux 2.6 kernel introduces the sysfs file system. Sysfs is regarded as a file system similar to proc, devfs, and devpty. Sysfs organizes devices and bus connected to the system into hierarchical files that can be accessed from the user's space. This is an option designed to process devices and drivers that previously reside in/proc/and to process dynamic loading devices that were previously supported by devfs. In earlier sysfs implementations, some drivers and applications were still regarded as old proc entries. However, sysfs is the future direction.

Sysfs is loaded in/sys/system. Its directories can be used to manage devices connected to the system in different ways. Sub-Directories In/sysfs/include:

The/devices/directory contains/css0 /. Its Sub-directories represent all sub-channels detected by the Linux kernel. The name format of the sub-channel directory is 0.0.nnnn, where nnnn is the hexadecimal code (0 to ffff) of the sub-channel ). The sub-channel Directory includes the status file and other sub-directories of devices that represent the actual device. The format of the Device directory is 0.0.xxxx, where xxxx is the unit address of the device. /Devices/also includes status information and device configuration options.

The/bus/directory contains two subdirectories:/ccw/AND/ccwgroup. CCW devices can be accessed by using channel commands. Only one sub-channel is used for devices in the/ccw/directory. CCW devices can also be accessed by using channel commands, but each of them uses more than one sub-channel. For example, a 3390-3 DASD device uses a sub-channel, but the QDIO network connection of an OSA adapter uses three sub-channels. The/ccw/AND/ccwgroup/directories both include the Device directory and the drive directory:

The/devices/directory contains a symbolic link to the Device directory in the/sys/devices/css0/directory. The/drivers directory contains the directories of all drivers that represent the devices loaded by the system. The zFCP driver has a directory here. The/driver/directory contains the settings of the device driver and the symbolic link used by the device (/sys/devices/css0/directory) /class/directory contains a group of devices with similar functions (ttys, SCSI tape drive, network device ...) directory.

The/block/directory contains the directory of each block device in the system. Block devices are mainly disk devices, such as DASD, send-back devices, and Redundant Array devices of software disks. In contrast to earlier Linux versions, Linux systems that use sysfs must use the name of the device in sysfs to specify the device. In a 2.4 kernel image, the zFCP driver is specified by its device address. However, in kernel images of version 2.6, its driver is specified by 0.0.1600.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.