From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 9 23:18:45 2007 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DD8616A419 for ; Thu, 9 Aug 2007 23:18:45 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id E4EE213C465 for ; Thu, 9 Aug 2007 23:18:44 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 83B3420B0 for ; Fri, 10 Aug 2007 01:18:34 +0200 (CEST) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id EA966208A for ; Fri, 10 Aug 2007 01:18:33 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id BBF9C8444F; Fri, 10 Aug 2007 01:18:33 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: hackers@freebsd.org Date: Fri, 10 Aug 2007 01:18:33 +0200 Message-ID: <86myx0pa9i.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Subject: Core temperature X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2007 23:18:45 -0000 I've written a quick-and-dirty driver for the built-in digital temperature sensor in Intel's Core and Core 2 CPUs (and Xeons built on the Core architecture). The driver exports four sysctl nodes under hw.coretemp: hw.coretemp.tjmax Maximum core temperature (currently hardcoded To 100=C2=B0C, may actually be 85=C2=B0C on some sy= stems) hw.coretemp.delta current temperature in =C2=B0C below Tj(max) hw.coretemp.interrupt Lower 32 bits of the IA32_THERMAL_INTERRUPT MSR hw.coretemp.status Lower 32 bits of the IA32_THERMAL_STATUS MSR I intend to move these into dev.cpu.N in a later version. Note that the driver currently makes no attempt to handle multi-CPU systems; it will simply report the temperature of the CPU that contains whichever core the requesting process happens to be running on. http://people.freebsd.org/~des/software/coretemp-20070810.diff DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no