From owner-freebsd-questions@FreeBSD.ORG Sat Jan 21 20:33:05 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5003B16A41F for ; Sat, 21 Jan 2006 20:33:05 +0000 (GMT) (envelope-from prvs=johnl=0169977992@simone.iecc.com) Received: from xuxa.iecc.com (xuxa.iecc.com [208.31.42.42]) by mx1.FreeBSD.org (Postfix) with SMTP id AE5A243D55 for ; Sat, 21 Jan 2006 20:33:04 +0000 (GMT) (envelope-from prvs=johnl=0169977992@simone.iecc.com) Received: (qmail 26303 invoked from network); 21 Jan 2006 20:33:03 -0000 Received: from simone.iecc.com (208.31.42.47) by mail2.iecc.com with QMQP; 21 Jan 2006 20:33:03 -0000 Date: 21 Jan 2006 20:33:06 -0000 Message-ID: <20060121203306.25121.qmail@simone.iecc.com> From: John Levine To: freebsd-questions@freebsd.org In-Reply-To: <200601211310.38269.nb_root@videotron.ca> Organization: Mime-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit Cc: nb_root@videotron.ca Subject: Re: C/C++ call to detect cpu? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 20:33:05 -0000 >Other than 'grep'ing dmesg, is there a way to know the current cpu such as a >struct with the machine's cpu and cpu feature (kinda like a time_t struct)? $ sysctl hw.model hw.model: AMD Athlon(tm) 64 Processor 3000+ If you want more details write a tiny assembler routine that does a CPUID instruction and decode the result. Intel has a detailed application note about it at http://developer.intel.ru/design/xeon/applnots/241618.htm R's, John