From owner-freebsd-current Tue Aug 6 19:50:59 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id TAA25826 for current-outgoing; Tue, 6 Aug 1996 19:50:59 -0700 (PDT) Received: from relay.hp.com (relay.hp.com [15.255.152.2]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id TAA25820 for ; Tue, 6 Aug 1996 19:50:47 -0700 (PDT) Received: from fakir.india.hp.com by relay.hp.com with ESMTP (1.37.109.16/15.5+ECS 3.3) id AA254646237; Tue, 6 Aug 1996 19:50:41 -0700 Received: from localhost by fakir.india.hp.com with SMTP (1.37.109.16/15.5+ECS 3.3) id AA276586370; Wed, 7 Aug 1996 08:22:50 +0530 Message-Id: <199608070252.AA276586370@fakir.india.hp.com> To: "Michael L. VanLoon -- HeadCandy.com" Cc: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch), freebsd-current@freebsd.org (FreeBSD-current users) Subject: Re: Patch to recognize AMD 5x86 cpus In-Reply-To: Your message of "Tue, 06 Aug 1996 08:47:33 MST." <199608061547.IAA18751@MindBender.HeadCandy.com> Date: Wed, 07 Aug 1996 08:22:49 +0530 From: A JOSEPH KOSHY Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >>>> ""Michael L. VanLoon -- HeadCandy.com"" writes > > >As Michael L. VanLoon -- HeadCandy.com wrote: > >> If you wanted to do this The "Correct" Way, you might be better off > >> rewriting the CPU identification code in locore.s to a more general, > > > identcpu.c > >(It has been divorced from locore.s some time ago.) > > Is it modular, well abstracted, comprehensive and all encompassing? I Well from my (possibly inadequate) understanding, we now have a new instruction `CPUID', which returns information about the CPU in the register. Sub-functions are requested using a sub-function code specified in %eax. In order to detect if the CPUID instruction exists, the documented approach is to check the writability of a bit in EFLAGS. If the instruction exists, we call it with %eax = 0 and 1 to extract the standard information about the chip. >From this point the CPU implementations are allowed to diverge. AMD for example, specifies that their K5 series of chips return more information about internal organization etc when %eax = 0x80000000-0x80000005. Other vendors support different subfunction codes. The code in -current retrieves the `basic' CPUID information in locore.s and updates some globals. identcpu.c then looks at this information to determine the exact type/model of CPU and takes the appropriate action specific to the chip. To the best of my understanding, the -current code confirms to the `standard' intel recommended processor identification method and my code confirms to AMD's published processor identification procedure. For more information you could look at intels processor recognition app-note in the developers corner of their web-site. AMD's documents on this are similarly available on the web. Koshy My Personal Opinions Only