Subdirectories under / sys
content
# ls /sys/
block class firmware kernel power
bus devices fs module
-----------------------------------------------------------------------------------------------------------------------------
1./sys/devices
# ls /sys/devices/
platform system
# ls /sys/devices/platform/
dm9000.0 s3c2410-rtc s3c2440-uart.0 s3c24xx_led.2
power s3c2410-wdt s3c2440-uart.1 s3c24xx_led.3
s3c2410-iis s3c2440-i2c s3c2440-uart.2 serial8250
s3c2410-lcd s3c2440-nand s3c24xx_led.0 serial8250.0
s3c2410-ohci s3c2440-sdi s3c24xx_led.1 uevent
# ls /sys/devices/system/
clocksource s3c2410-core s3c2440-core s3c2443-core timekeeping
cpu s3c2412-core s3c2442-core s3c24xx-dma timer
This directory is a global device architecture, comprising all the various physical register is found on a variety of bus devices. In general, all physical devices on its bus topology is shown, but with two exceptions, namely platform devices and system devices. hanging platform devices are generally high-speed chip, or various controllers and peripherals on the low speed bus, they can be addressed directly to the CPU; system devices not peripheral, but the core structure inside the chip, such as CPU, etc. Timer they generally do not have the relevant drivers, but there will be some architecture-dependent code to configure them.
(Sys / devices are hierarchical representation model for all devices in the system kernel, but also the / sys directory structure of the most important file system management device)
----------------------------------------------------------------------------------------------------------------------------
2.sys/dev
According to safeguard a number of primary and secondary character and block device in the directory: Link to really device (/ sys / devices) of (major minor) symbolic link file.
----------------------------------------------------------------------------------------------------------------------------
3./sys/class
# ls /sys/class/
graphics misc printer sound vc
hwmon mmc_host rtc spi_master vtconsole
i2c-adapter mtd scsi_device tty
input net scsi_disk usb_endpoint
mem ppdev scsi_host usb_host
Registered in the kernel include all types of equipment inside the catalog, this device is a device according functional classification model, the expression of each type of device having an apparatus function. Each device type is the subdirectory symbolic links to various specific equipment of this type of device, which links to a particular device under / sys / devices / name. The device type and device is not one to one relationship, the physical device may have a plurality of device types; a device having a device type expressing only one function, for example: all system devices will appear in the input / sys / class / input of next, whether they are based on what is connected to the bus system. (/ Sys / class also form part of a unified linux device models)
----------------------------------------------------------------------------------------------------------------------------
/sys/block
# ls /sys/block/
loop0 loop4 mtdblock0 ram0 ram12 ram2 ram6
loop1 loop5 mtdblock1 ram1 ram13 ram3 ram7
loop2 loop6 mtdblock2 ram10 ram14 ram4 ram8
loop3 loop7 mtdblock3 ram11 ram15 ram5 ram9
All subdirectories of the directory represents all system devices currently found in the block. By function is placed under / sys / class would be more appropriate, but because of the historical legacy of factors have been present in the / sys / block, but linux2.6.22 start this part of the kernel has been marked as the past, only to open the configuration CONFIG_SYSFS_DEPRECATED will have compiled this list exists, and the contents of which start from linux2.6.26 version has officially moved to the / sys / class / block, the old interface / sys / block reserved for backward compatibility exist, but the content has they point to become the real device in / sys / devices / symbolic link file.
----------------------------------------------------------------------------------------------------------------------------
/sys/bus
# ls /sys/bus/
i2c mmc platform scsi serio spi usb
Each subdirectory under this directory is kernel support and has registered bus type. This is a kernel type of device is placed in a hierarchical directory structure in accordance with the bus, all the equipment / sys / devices are connected to the bus under certain, specific for each bus under the subdirectory of the bus can be found in each particular device symbolic link, generally comprising each subdirectory (bus type) two subdirectories, one devices, and the other is Drivers; wherein the devices are all devices in the bus type, these devices are symbolic links, which are real pointing device (/ sys / devices / name / down); and the lower drivers are registered in all the bus drivers, each driver under a number of subdirectories may be observed and modified driver parameters.
(It also forms part of a unified linux device models)
-----------------------------------------------------------------------------------------------------------------------------
/sys/fs
【air】
By design, the directory use to describe all the file systems in the system, including the file system itself and in accordance with the file system has been classified storage mount point.
-----------------------------------------------------------------------------------------------------------------------------
/sys/kernel
# ls /sys/kernel/
uevent_helper uevent_seqnum
Stored in this directory is the kernel of all adjustable parameters
-----------------------------------------------------------------------------------------------------------------------------
/sys/firmware
【air】
This directory contains the firmware interface objects (firmware object) and the operating and monitoring attributes, i.e., where the system loading mechanism firmware interface user space. (About firmware dedicated to load a set of firmware API)
-----------------------------------------------------------------------------------------------------------------------------
/sys/hypervisor【X】
The directory is associated with the Xen virtualization device. (The Xen is an open-source virtual machine monitor)
-----------------------------------------------------------------------------------------------------------------------------
/sys/module
# ls /sys/module/
8250 loop rcupdate snd_pcm usb_storage
atkbd lp rd snd_soc_core usbcore
dm9dev9000c mousedev s3c2410_wdt snd_timer usbhid
hid nfs s3c_ts sunrpc vt
keyboard ohci_hcd scsi_mod tcp_cubic yaffs
lockd printk snd tsdev
All modules have information systems in the directory, whether these modules are inline (inlined) compiled into the kernel image file is compiled as a module outside (.ko file), it may appear in the / sys / module in. That is the next module directory contains all of the kernel module is loaded.
----------------------------------------------------------------------------------------------------------------------------
/sys/power
\# ls /sys/power/
state
The directory is the Power Options system, descriptions of the power subsystem is used. There are several attributes files in this directory can be used to control the entire machine power state, as can be written to the control command wherein the machine shutdown / restart, etc.
from:http://tscsh.blog.163.com/blog/static/20032010320131051738843/