免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1553 | 回复: 0
打印 上一主题 下一主题

Some virtual file systems occure in Linux [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-10-03 23:32 |只看该作者 |倒序浏览

                Sysfs
Sysfs is a virtual file system provided by Linux 2.6. Sysfs exports information about devices and drivers from the kernel device model to userspace, and is also used for configuration.
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 Soni later wrote the sysfs backing store patch to reduce memory usage on large systems.
sysfs is an in-memory filesystem that was originally based on ramfs. ramfs was written around the time Linux 2.4.0 was being stabilized. It was an exercise in elegance, as it showed just how easy it was to write a simple filesystem using the then-new VFS layer. Because of its simplicity and use of the VFS, it provided a good base from which to derive other in-memory based filesystems.
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 respective to the device. Using attribute groups, a subdirectory filled with attributes may also be created.
procfs
    On many Unix-like computer systems, procfs, short for process file system, consists of a pseudo file system (a file system dynamically generated at boot) used to access process information from the kernel. The file system is often mounted at the /proc directory. Because /proc is not a real file system, it consumes no storage space and only a limited amount of memory.
/proc/cmdline, giving the boot options passed to the kernel
/proc/filesystems, a list of the file systems supported by the kernel at the time of listing
/proc/interrupts, /proc/iomem, /proc/ioports and the directory /proc/irq, giving some self-explanatory details about the devices (physical or logical) using the various system resources
/proc/meminfo, containing a summary of how the kernel is managing its memory.
/proc/modules, one of the most important files in /proc, containing a list of the kernel modules currently loaded . It gives some indication ( not always entirely correct) of dependencies.
/proc/tty, containing information about the current terminals; /proc/tty/driver looks to be a list of the different types of tty available each of which is a list of those of each type
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/66754/showart_1272120.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP