Find the answer to your Linux question:
Results 1 to 3 of 3
The temperature of the core is determined using the coretemp driver. I need to use this core temperature information in my project. I need to use this temperature information in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2014
    Posts
    11

    How to calculate n use d temperature of the core in Linux Source code


    The temperature of the core is determined using the coretemp driver. I need to use this core temperature information in my project. I need to use this temperature information in Linux Source code itself.

    As far as I understand, the temperature value can be retrieved using the following function defined in coretemp.c:

    static ssize_t show_temp(struct device *dev, struct device_attribute *devattr, char *buf)
    I am unable to determine the parameters to be given to the function to calculate the temperature of the core. What should they be?

    I'd also be interested in hearing about other methods of calculating and using temperature values of the core in Linux Source code itself, if there are any.

  2. #2
    Linux Engineer
    Join Date
    Dec 2013
    Posts
    1,298
    Both of the first parameters are declared in linux/device.h and represent the hardware device as you might expect. The third param is for the returned value.

    You might have a look at the source of lm-sensor. I think this module is written to interface with it.

  3. #3
    Just Joined!
    Join Date
    Jan 2014
    Posts
    11

    Red face Solved

    Quote Originally Posted by gregm View Post
    Both of the first parameters are declared in linux/device.h and represent the hardware device as you might expect. The third param is for the returned value.

    You might have a look at the source of lm-sensor. I think this module is written to interface with it.

    I solved the question using rdmsr instruction on model specific register IA32_THERM_STATUS.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •