Announcement

Collapse
No announcement yet.

Hardware info through C

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hardware info through C

    Hi all.I am a new user out here.Not as much experienced as all of you.I am stuck with this program,will anyone help???????
    How can I write a C(or C++) program that would give the CPU temp,fan speed etc as output???
    Is it possible to collect the serial no of Processor,mother board through such a program???
    Last edited by fury358; October 1, 2005, 22:12.

  • #2
    Originally posted by fury358
    Hi all.I am a new user out here.Not as much experienced as all of you.I am stuck with this program,will anyone help???????
    How can I write a C(or C++) program that would give the CPU temp,fan speed etc as output???
    Is it possible to collect the serial no of Processor,mother board through such a program???
    This isn't a tech support or 'teach me to program' forum.

    What you're looking for is a developers guide for the processor architecture that you're interested in. It *is* possible to get the information you want. I'm going to be nice today, consider this your freebie... google for "cpuinfo".

    meh - babies
    That's my story and I'm sticking to it.

    Comment


    • #3
      Originally posted by fury358
      Hi all.I am a new user out here.Not as much experienced as all of you.I am stuck with this program,will anyone help???????
      How can I write a C(or C++) program that would give the CPU temp,fan speed etc as output???
      Is it possible to collect the serial no of Processor,mother board through such a program???
      OpenSource offers you samples of how other people sought to solve similar problems.

      If Linux, consider the kernel-build-option:
      Kernel, Device Drivers, Character devices, IPMI
      "IPMI is a standard for managing sensors (temperature, voltage, etc.) in a system."
      It suggests /usr/src/linux/Documentation/IPMI.txt
      which takes you to
      http://www.intel.com/design/servers/ipmi/index.htm

      Another space to check:
      Kernel, Device Drivers, Hardware Monitoring support
      "Hardware monitoring devices let you monitor the hardware health of a system. Most modern motherboards include such a device. It can include temperature sensors, voltage sensors, fan speed sensors and various additional features such as the ability to control the speed of the fans."

      Your OS provides a fundamental method (and drivers) through which you application would need to talk. As a result, your question is answered through the intersection of the hardware you have, the OS you run and information provided by the device through the system to your application.

      There are also example of tools designed to talk to the OS. Google is your friend.
      Google/linux: monitor CPU temperature yeilds:
      http://www.linuxlinks.com/Software/M...g/Temperature/

      If windows or a commercial, closed source system, you may be able to still use google to find examples of how other users solved this problem.

      Edit:
      [Added content:]
      ndex beat me with an answer.
      Your problem is one of research. The above gives you one example of how research can be conducted.

      Comment


      • #4
        Originally posted by TheCotMan
        Edit:
        [Added content:]
        ndex beat me with an answer.
        Your problem is one of research. The above gives you one example of how research can be conducted.
        Is it a competition? What are we competing for? What's the prize?

        Who decides who wins?

        More importantly, why don't you give the kiddie a hummer with all that...
        Last edited by ndex; October 3, 2005, 18:56.
        That's my story and I'm sticking to it.

        Comment


        • #5
          Ask mr google www.google.com he can take care of all your needs.

          Search on terms such as developer sites, C/C++ and cpuinfo.

          Comment


          • #6
            Originally posted by foxyboy
            Ask mr google www.google.com he can take care of all your needs.
            And your job here is *not* to post this as the generic response to every question someone asks. This is the second time I've seen you do it today; if you don't have an actual useful answer, telling people to simply 'check google' isn't going to make you any friends. Back to the original poster's question:

            Look into ACPI. Part of its spec is to provide exactly the info you want to extract, and there's a lot of code out there you can look at to do exactly that.

            Comment


            • #7
              Originally posted by skroo
              And your job here is *not* to post this as the generic response to every question someone asks. This is the second time I've seen you do it today; if you don't have an actual useful answer, telling people to simply 'check google' isn't going to make you any friends. Back to the original poster's question:

              Look into ACPI. Part of its spec is to provide exactly the info you want to extract, and there's a lot of code out there you can look at to do exactly that.
              If you read ALL my posts you'll no doubt see that I don't post generic replies.

              The two questions posed have been a 'please tell me how to' which is often frowned upon on this forum. After they have actually gone away and done some ground work then the forum is happy to help.
              Last edited by foxyboy; October 6, 2005, 20:07.

              Comment


              • #8
                You know...I am not going to comment on your spelling 11 post wonder, but I think you should use the edit button to change it before someone else does.

                As for the assistance with the orginal topic of this thread, here's an idea.

                Go grab yourself a decompiler. Grab an overclocking program. I use giga-byte's easy tuner 4. Look for the code involving that specific function.

                You can learn from this, and then grab another and compare it to the first one. Eventually when you see a few of them, grab your own.
                -Ridirich

                "When you're called upon to do anything, and you're not ready to do it, then you've failed."

                Commander W.H. Hamilton

                Comment


                • #9
                  Originally posted by foxyboy
                  The two questions posed have been a 'please tell me how to' which is often frowned upon on this forum.
                  You're really not quite getting the message here, are you?

                  Comment


                  • #10
                    In Linux most everyone uses LM-Sensors for that. It comes with a pile of drivers for the various motherboard monitoring chips and other things though. It would probably be... nontrivial to implement those.

                    The Windows utilities look the same... they need to talk to different chips in different ways also, the stuff isn't standardized.

                    So yeah, logically you can write such a program... but the majority of the effort would probably be in writing the drivers.

                    Comment

                    Working...
                    X