Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Sep 2001 09:10:43 +0300
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Warner Losh <imp@harmony.village.org>
Cc:        Marcel Moolenaar <marcel@xcllnt.net>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   hw.machine vs hw.machine_arch (was: Re: cvs commit: src/sbin/reboot Makefile)
Message-ID:  <20010913091043.C10963@sunbay.com>
In-Reply-To: <200109122218.f8CMIst43283@harmony.village.org>; from imp@harmony.village.org on Wed, Sep 12, 2001 at 04:18:54PM -0600
References:  <200109122216.f8CMGLt43250@harmony.village.org> <20010912134640.A639@dhcp01.pn.xcllnt.net> <200109121221.f8CCL9q93334@freefall.freebsd.org> <200109122216.f8CMGLt43250@harmony.village.org> <200109122218.f8CMIst43283@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 12, 2001 at 04:18:54PM -0600, Warner Losh wrote:
> In message <200109122216.f8CMGLt43250@harmony.village.org> Warner Losh writes:
> : : >   Use ${MACHINE}, it works with cross-builds.
> : : 
> : : More specifically, ${MACHINE} can be pc98 while ${MACHINE_ARCH}
> : : is i386. In userland you want to test for i386; not pc98.
> : 
> : uname -m is the ${MACHINE_ARCH}, so that should be used instead.
> : Marcel is right.
> 
> I just confirmed on my pc98 machine.  arch -m is "i386" on pc98.
> 
Hmm, I always thought that hw.machine_arch should be what the
${MACHINE_ARCH} is set to during `buildworld', and hw.machine
should be what the ${MACHINE} is.  And we know that the only
exotic combination currently is i386/pc98.  Well, well...

`uname -m' fetches the value of:

	if (flags & MFLAG) {
		mib[0] = CTL_HW;
		mib[1] = HW_MACHINE;
	...

Not the HW_MACHINE_ARCH.

But then in sys/i386/i386/identcpu.c (which is also in files.pc98)
we have:

char machine[] = "i386";
SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD,
    machine, 0, "Machine class");

I wonder, should that be "pc98" for PC98's.  Anyone cares to explain
why it is "i386" on PC98, and why then we have both hw.machine and
hw.machine_arch?


Thanks,
-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010913091043.C10963>