From owner-freebsd-questions@FreeBSD.ORG Sun Feb 22 07:07:25 2004 Return-Path: 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 C8E8116A4CE for ; Sun, 22 Feb 2004 07:07:25 -0800 (PST) Received: from conn.mc.mpls.visi.com (conn.mc.mpls.visi.com [208.42.156.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id B0A0F43D31 for ; Sun, 22 Feb 2004 07:07:25 -0800 (PST) (envelope-from hawkeyd@visi.com) Received: from sheol.localdomain (hawkeyd-fw.dsl.visi.com [208.42.101.193]) by conn.mc.mpls.visi.com (Postfix) with ESMTP id 96EEA810A; Sun, 22 Feb 2004 09:07:24 -0600 (CST) Received: (from hawkeyd@localhost) by sheol.localdomain (8.11.6p2/8.11.6) id i1MF7NT25730; Sun, 22 Feb 2004 09:07:23 -0600 (CST) (envelope-from hawkeyd) X-Spam-Policy: http://www.visi.com/~hawkeyd/index.html#mail Date: Sun, 22 Feb 2004 09:07:23 -0600 From: D J Hawkey Jr To: Tony Frank Message-ID: <20040222150723.GA25548@sheol.localdomain> References: <20040221160709.GA22447@sheol.localdomain> <1455334090.20040221175633@buz.ch> <20040221172328.GA22671@sheol.localdomain> <20040222140538.GA16873@marvin.home.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040222140538.GA16873@marvin.home.local> User-Agent: Mutt/1.4.1i cc: Gabriel Ambuehl cc: questions at FreeBSD Subject: Re: Clarification needed on Handbook: Tracking for Multiple Machines X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: hawkeyd@visi.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2004 15:07:25 -0000 On Feb 23, at 01:05 AM, Tony Frank wrote: > > On Sat, Feb 21, 2004 at 11:23:28AM -0600, D J Hawkey Jr wrote: > > On Feb 21, at 05:56 PM, Gabriel Ambuehl wrote: > > > > > > DJHJ> Second, two machines are of the same architecture, but they have different > > > DJHJ> CPUs: One is an Intel PIII, but the other is a PII. Will the world built > > > DJHJ> on a PIII be correct for a PII? Similarly, will the kernel for the PII > > > DJHJ> built on a PIII be correct for the PII, given the different variables and > > > DJHJ> settings in the two kernel configuration files? > > > > > > Just make sure you build for 686. If that doesn't work, make it 586 (I > > > think the PI qualifies as 686 but I'm not entirely sure). I think the extensions such as > > > SSE etc are detected dynamically and shouldn't cause any problem. > > > In all my years of messing with builds, I never run into this problem, > > > so I guess it's pretty safe. > > Yes, both [my] machines define I686_CPU. > > > > "Dynamically", as in "at runtime"? I think you're right, but I don't > > know for certain, either. This is exactly what I'm wondering about; > > the PII has only MMX, for instance, while the PIII has SSE and MMX2. > > > > I assume the world's codebase is CPU-agnostic within an architecture, > > but I really don't want to assume this; I'd rather know this. > > I have PII, Celeron, PIII and P4 in my environment. > All these use "I686_CPU" in my kernel configs (I got rid of the other I[345]_CPU types. In a desktop's kernel config: machine i386 cpu I686_CPU ident SHEOL In my laptop's kernel config: machine i386 cpu I686_CPU ident CHARON Getting difficult, isn't it? ;-, Boot messages on that desktop from kernel built on that desktop: CPU: Pentium III/Pentium III Xeon/Celeron (764.35-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x686 Stepping = 6 Features=0x383f9ff Boot messages on that laptop from kernel built on that laptop: CPU: Pentium II/Pentium II Xeon/Celeron (233.87-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x652 Stepping = 2 Features=0x183f9ff > In /etc/make.conf I include "CPUTYPE=p2" as the lowest common denominator if > including a CPUTYPE flag. > The resulting world & kernel run fine on all the systems. > > The higher flags p3 and p4 still just use -march=pentiumpro, however for SSE you > will need p3 or p4 as MACHINE_CPU does not include SSE for p2 level. > Check out /usr/share/mk/bsd.cpu.mk for specifics. If I read things right, the first chunk in bsd.cpu.mk results in "CPUTYPE = i686"; the conditional-on-CPU_TYPE-defined assignment sees "cpu I686_CPU" in the kernel configs, right?. The second chunk in bsd.cpu.mk also results in "CPUTYPE = i686" (fallthrough). The third chunk results in "_CPUCFLAGS = -march=pentiumpro", as you state. Finally, the last chunk in bsd.cpu.mk results in "MACHINE_CPU = i686 i586 i486 i386". If I specify "CPUTYPE=p2" in make.conf, and I'm still reading things right, the final result in bsd.cpu.mk would be the same _CPUCFLAGS, and "MACHINE_CPU = i686 mmx i586 i486 i386". But based on the boot messages, it would seem that the features of the chips are detected correctly without specifying a CPUTYPE in make.conf. So... As things are right now (no CPUTYPE in make.conf), it would appear that "CPU feature" code is built into the kernels on the respective machines, and that code correctly detects the features available. Therefore, I don't see where adding CPUTYPE in make.conf would get me anything I'm not already getting? That is, why make things more specific than they have to be? I don't see where adding "CPUTYPE=p2" on a PIII build machine would change anything for PII and/or PIII target machines. What have I missed? > > > DJHJ> /etc/defaults/make.conf doesn't mention KERNCONF; /usr/src/Makefile.inc1 > > > DJHJ> does. Since /usr/share/mk/sys.mk sucks in /etc/make.conf, that should > > > DJHJ> propogate KERNCONF to /usr/src/Makefile, right? > > To your original question, yes. > Just add a KERNCONF= line to /etc/make.conf. > First entry should be the local machine kernel (to install) and > any subsequent entries will also be built during 'make buildkernel' > eg: KERNCONF= MARVIN RAIDER RAIDERI GENERIC > make buildkernel builds all four. > make installkernel installs MARVIN. Cool. So, the -CURRENT (or is that -STABLE?) Handbook does apply to 4.5-REL, at least where this stuff is concerned. Dave -- ______________________ ______________________ \__________________ \ D. J. HAWKEY JR. / __________________/ \________________/\ hawkeyd@visi.com /\________________/ http://www.visi.com/~hawkeyd/