Skip to contentSkip to conversation

lm sensors sysfs file structure

DISCUSSION Albert Cahalan 3 participants 4 messages Mar 27, 2003 – Mar 28, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines · Greg KH

temp_max[1-3] Temperature max value.
Fixed point value in form XXXXX and should be divided by
100 to get degrees Celsius. Read/Write value.

Celsius can go negative, which may be yucky and hard to test. Kelvin generally doesn't suffer this problem. (yeah, yeah, quantum stuff...)

Getting temperature display into "top" would sure be nice, but not if that means requiring a library that almost nobody has installed. It's good to give apps a simple way to get CPU temperature, including per-CPU data for SMP systems when available.

Info about sensor quality would be good. For example, my CPU measures temperature in 4-degree increments and is not calibrated.

#1 lore raw
Quoted 11 lines · Albert Cahalan
Quoted 5 lines · Greg KH

temp_max[1-3] Temperature max value.
Fixed point value in form XXXXX and should be divided by
100 to get degrees Celsius. Read/Write value.

Celsius can go negative, which may be yucky and hard to test. Kelvin generally doesn't suffer this problem. (yeah, yeah, quantum stuff...)

Wow, only 4 hours before someone mentioned Kelvin, I think I lost a bet with someone :)

Seriously, let the value go negative, no problem. As long as it isn't floating point input which has to be parsed by the kernel. That's all I care about.

Quoted 5 lines

Getting temperature display into "top" would sure be nice, but not if that means requiring a library that almost nobody has installed. It's good to give apps a simple way to get CPU temperature, including per-CPU data for SMP systems when available.

libsensors is installed on almost all distros these days.

Quoted 3 lines

Info about sensor quality would be good. For example, my CPU measures temperature in 4-degree increments and is not calibrated.

I doubt the kernel driver knows this information.

thanks,

greg k-h

#2 lore raw
Quoted 13 lines · Greg KH
Quoted 11 lines · Albert Cahalan
Quoted 5 lines · Greg KH

temp_max[1-3] Temperature max value.
Fixed point value in form XXXXX and should be divided by
100 to get degrees Celsius. Read/Write value.

Celsius can go negative, which may be yucky and hard to test. Kelvin generally doesn't suffer this problem. (yeah, yeah, quantum stuff...)

Quoted 7 lines

Wow, only 4 hours before someone mentioned Kelvin, I think I lost a bet with someone :)

Seriously, let the value go negative, no problem. As long as it isn't floating point input which has to be parsed by the kernel. That's all I care about.

Silly w83781d again. temp1 is a u8, and temp2 and temp3 is u16 (if they are supported on the specific model.

Should we do any bounds checking on input via sysfs ?

Regards,

Signature · 1 line
Martin Schlemmer
#3 lore raw
Quoted 5 lines · Martin Schlemmer

Silly w83781d again. temp1 is a u8, and temp2 and temp3 is u16 (if they are supported on the specific model.

Should we do any bounds checking on input via sysfs ?

So that you can't hurt your hardware or crash the os, yes.

I think the write ability is limited to root, so that's a good first step too.

thanks,

greg k-h