[Answered] Quick question about /sys and /proc

If I've understood it right /sys and /proc are virtual filesystems that provides information about processes (/proc) or hardware (/sys), but if they are only supposed to provide information why are some files writable?

Have I missed something?

You can give the kernel information through some files.

For example on my Cubietruck

# Control onboard LEDs
echo 0 > /sys/class/leds/blue\:ph21\:led1/brightness
echo 0 > /sys/class/leds/green\:ph07\:led4/brightness
echo 0 > /sys/class/leds/orange\:ph20\:led2/brightness
echo 0 > /sys/class/leds/white\:ph11\:led3/brightness

# Control CPU speed
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 1008000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 408000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
1 Like

Ah, that's interesting! Thanks for replying!

1 Like