请输入您要查询的百科知识:

 

词条 Sysfs
释义

  1. History

  2. Supported buses

  3. Sysfs and userspace

  4. See also

  5. References

  6. External links

{{Lowercase title}}

sysfs is a pseudo file system provided by the Linux kernel that exports information about various kernel subsystems, hardware devices, and associated device drivers from the kernel's device model to user space through virtual files.[1] In addition to providing information about various devices and kernel subsystems, exported virtual files are also used for their configuration.

sysfs provides functionality similar to the sysctl mechanism found in BSD operating systems, with the difference that sysfs is implemented as a virtual file system instead of being a purpose-built kernel mechanism, and that, in Linux, sysctl configuration parameters are made available at /proc/sys/ as part of procfs, not sysfs which is mounted at /sys/.[2]

History

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

  • No unified method of representing driver-device relationships existed.
  • There was no generic hotplug mechanism.
  • procfs was cluttered with non-process information.

Sysfs was designed to export the information present in the device tree which would then no longer clutter up procfs. It was written by Patrick Mochel.[3][4] Maneesh Soni later wrote the sysfs backing store patch to reduce memory usage on large systems.

During the next year of 2.5 development the infrastructural capabilities of the driver model and driverfs, formerly called ddfs, began to prove useful to other subsystems.[5][6] kobjects were developed to provide a central object management mechanism and driverfs was renamed to sysfs to represent its subsystem agnosticism.

Sysfs is mounted under the /sys mount point. If it is not mounted during initialization, you can always mount it using the command: "mount -t sysfs sysfs /sys"

Supported buses

PCI

Exports information about PCI devices.

USB

Contains both USB devices and USB hosts.

S/390 buses

As the S/390 architecture contains devices not found elsewhere, special buses 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: Artificial devices like netiucv devices which use VM's IUCV interface.

Sysfs and userspace

Sysfs is used by several utilities to access information 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

{{Portal|Linux}}
  • procfs
  • configfs
  • tmpfs
  • sysctl, alternative way of exporting configuration used in BSD systems

References

1. ^{{cite web|url=https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt|title=sysfs - _The_ filesystem for exporting kernel objects|author=Patrick Mochel and Mike Murphy|publisher=kernel.org}}
2. ^{{cite web|quote=sysctl is used to modify kernel parameters at runtime. The parameters available are those listed under /proc/sys/. Procfs is required for sysctl support in Linux. You can use sysctl to both read and write sysctl data.|url=https://www.freebsd.org/cgi/man.cgi?query=sysctl&sektion=8&manpath=SuSE+Linux%2fi386+11.3|publisher=FreeBSD|author=SUSE|title=sysctl man page}}
3. ^{{cite web |first=Linus |last=Torvalds |title=Linux v2.5.44 - and offline for a week |date=18 October 2002 |url=https://lkml.org/lkml/2002/10/19/8}}
4. ^{{cite web |first=Linus |last=Torvalds |title=Linux v2.5.46 |date=4 November 2002 |url=https://lkml.org/lkml/2002/11/4/213}}
5. ^{{cite web |first=Patrick |last=Mochel |title=[RFC] New Driver Model for 2.5 |date=17 October 2001 |url=https://lkml.org/lkml/2001/10/17/147}}
6. ^{{cite web |first=Tim |last=Jansen |title=Re: [PATCH] 2.5 PROPOSAL: Replacement for current /proc of shit. |date=1 November 2001 |url=https://lkml.org/lkml/2001/11/1/38}}

External links

  • [https://lwn.net/Articles/31185/ Driver model overview from the LWN porting to 2.6 series]
  • [https://lwn.net/Articles/54651/ kobjects and sysfs from the LWN porting to 2.6 series]
  • Ramfs
  • [https://www.kernel.org/pub/linux/kernel/people/mochel/doc/papers/ols-2005/mochel.pdf The sysfs Filesystem, OLS'05]
  • Documentation/filesystems/sysfs.txt Linux kernel documentation for sysfs
{{Linux kernel}}{{File systems}}

4 : Free special-purpose file systems|Interfaces of the Linux kernel|Linux kernel features|Pseudo file systems supported by the Linux kernel

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/23 4:34:22