LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 10-28-2007, 12:41 AM   #1
fateme-linux
LQ Newbie
 
Registered: Sep 2007
Posts: 2

Rep: Reputation: 0
Question sysfs filesystem


what 's the use of sysfs filesystem?
what's the difference between sysfs directory and other directories?
we 're reviewing the fedora source and have problem undrestanding this type of file system (sysfs)
 
Old 10-28-2007, 01:02 AM   #2
fateme-linux
LQ Newbie
 
Registered: Sep 2007
Posts: 2

Original Poster
Rep: Reputation: 0
The sysfs Filesystem
The sysfs filesystem is a special filesystem similar to /proc that is usually mounted on the /sys directory. The /proc filesystem was the first special filesystem designed to allow User Mode applications to access kernel internal data structures. The /sysfs filesystem has essentially the same objective, but it provides additional information on kernel data structures; furthermore, /sysfs is organized in a more structured way than /proc. Likely, both /proc and /sysfs will continue to coexist in the near future.

A goal of the sysfs filesystem is to expose the hierarchical relationships among the components of the device driver model. The related top-level directories of this filesystem are:



block

The block devices, independently from the bus to which they are connected.



devices

All hardware devices recognized by the kernel, organized according to the bus in which they are connected.



bus

The buses in the system, which host the devices.



drivers

The device drivers registered in the kernel.



class

The types of devices in the system (audio cards, network cards, graphics cards, and so on); the same class may include devices hosted by different buses and driven by different drivers.



power

Files to handle the power states of some hardware devices.



firmware

Files to handle the firmware of some hardware devices.

Relationships between components of the device driver models are expressed in the sysfs filesystem as symbolic links between directories and files. For example, the /sys/block/sda/device file can be a symbolic link to a subdirectory nested in /sys/devices/pci0000:00 representing the SCSI controller connected to the PCI bus. Moreover, the /sys/block/sda/device/block file is a symbolic link to /sys/block/sda, stating that this PCI device is the controller of the SCSI disk.

The main role of regular files in the sysfs filesystem is to represent attributes of drivers and devices. For instance, the dev file in the /sys/block/hda directory contains the major and minor numbers of the master disk in the first IDE chain.

you can find more information in chapter 13 of this book
undrestanding the linux kernel
 
Old 10-28-2007, 01:07 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Sounds like homework.
Read ../Documentation/filesystems/sysfs.txt
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sysfs use chessi Linux - Kernel 1 04-24-2007 03:59 PM
Sysfs info chessi Linux - Newbie 3 04-24-2007 03:53 PM
How to use sysfs? asahlot Linux - Kernel 1 01-21-2007 03:44 PM
Filesystem sysfs not supported by kernel Nishant Desai Linux - Kernel 1 11-25-2006 03:05 PM
Mounting sysfs ? mystique98ls Linux - Newbie 4 07-15-2005 11:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 08:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration