Questions tagged [sysfs]

Sysfs is a virtual file system provided by Linux. It is a ram-based file-system initially based on ramfs. It provides a means to export kernel data structures, their attributes, and the linkages between them to userspace.

Sysfs exports information about devices and drivers from the kernel device model to user space, and is also used for configuration. The Linux 2.6 kernel introduced this. It is similar to the sysctl mechanism found in BSD systems, but implemented as a file system instead of a separate mechanism.

It provides a view of the kobject object hierarchy. It enables users to view the device topology of their system as a simple filesystem.

The sysfs file system is mounted at /sys/ and contains directories that organize the devices attached to the system in several different ways. The /sysfs/ subdirectories include:

  • The /devices/ directory - represent all the subchannels detected by the Linux kernel and configuration options for the device
  • The /bus/ directory - contains contains a symbolic link to the device directories and for each device driver currently loaded on the system.
  • The /class/ directory - contains directories that group together similar devices such as ttys, SCSI tape drives, network devices, and other miscellaneous devices.
  • The /block/ directory - contains directories for each of the block devices on the system.

Read more

202 questions
0
votes
1 answer

C /sys/class/pwm init within a program

So you can see in this link that you have a pwm /sys/class/pwm/. So I am currently putting the right data into the appropriate files and things are working well. That is not the issue. The issue is that you need to do a "cat" on the…
napierzaza
  • 439
  • 4
  • 19
0
votes
0 answers

Restricting GPIOS to output-only or input-only through sysfs

I am using Ubuntu 11.10. I have written a driver for a GPIO chip which did not have its own driver in the kernel. I want to place a restriction on users from setting output-only pins to inputs, and vice-versa when using /sys/class/gpio. This is…
user54557
  • 1
  • 2
-1
votes
1 answer

How to add a disk back to sysfs after deleting it

A fs disk failure was simulated by: echo 1 > /sys/block/sda/device/delete which removes it from /dev dir. What is the procedure of adding it back?
-1
votes
1 answer

Linux/AM3352: setting gpio via sysfs seem not working

I have a board based on the beagle bone black. I have gpio that should do a hardware reset to the board (gpio117 = gpio3_21) While in the u-boot it is working - I am doing gpio clr 117 (set 0 causes the reset) and does get hardware reset I the…
Avner Flesch
  • 15
  • 1
  • 5
-1
votes
1 answer

Embedded linux - sysfs - disable pwm pin without disabling the whole channel

I have a raspberry pi, I want to use one single pwm channel to control a rgb led. There are 2 pins available for pwm0. So I connected red led on first pin and green led on second pin. I connected the blue one on a gpio. When I enable pwm0, the red…
-1
votes
1 answer

sysfs entries for hotpluggable devices

I have read that driver core sends uevents through netlink from sysfs to udev or some daemons which are listening to it and thenafter corresponding driver is recongnised by udev and loads it. But how this sysfs entries are created corresponding to a…
-3
votes
1 answer

How can i read sysfs attributes

How can i read sysfs attributes from user app. It is similar content from cat command. Such as I have a tag is brightness. How can i get the value of brightness tag? Because i need to read the USB infor from my app and i see they were exported to…
Tiktac
  • 800
  • 1
  • 7
  • 23
1 2 3
13
14