How to access devices through sysfs?

2.8k views Asked by At

I am looking for a tutorial or example code that will help me understand how to work with sysfs in linux. I am a total beginner in this area and as such, will appreciate any help I can get.

My end goal is to write an application that will let me read/write data to an SPI EEPROM using the at25 driver.

So far, I have looked at the tutorial given at http://www.signal11.us/oss/udev/ and also at the libudev page at kernel.org, but they didn't help me much.

What good sites/articles/examples should I refer to get a deeper understanding about how sysfs works and how to use it?

1

There are 1 answers

3
Simon Richter On BEST ANSWER

The sysfs is a representation of kernel objects, which are a basic property tree containing configuration data. I'd rather not use these for user data, but instead write a device driver, providing read and write filesystem operations.