Date: Fri, 14 Sep 2001 20:22:42 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Warner Losh <imp@harmony.village.org> Cc: Marcel Moolenaar <marcel@xcllnt.net>, KATO Takenori <kato@nendai.nagoya-u.ac.jp>, <ru@FreeBSD.org>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org> Subject: Re: hw.machine vs hw.machine_arch Message-ID: <20010914201048.W18027-100000@delplex.bde.org> In-Reply-To: <200109140648.f8E6mFt19413@harmony.village.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 14 Sep 2001, Warner Losh wrote:
> In message <20010913224828.B8717@dhcp01.pn.xcllnt.net> Marcel Moolenaar writes:
> : I don't have a pc98 to check, but I don't see the evidence in the
> : code that hw.machine=pc98 on pc98. Please check.
>
> These are both i386 on my pc98 machine, but I may have messed up when
> building the kernel on my FreeBSD/i386 machine.
It's certainly i386. UTSL :-)
> : Also, given the above definition, what remains of the function of
> : the hw.ispc98 MIB?
>
> machdep.ispc98 you mean? That is 0 on my FreeBSD/i386 boxes and 1 on
> my pc98 machines.
machdep.ispc98 is used mainly to give an unusual setting of ${MACHINE} for
make(1). From make/main.c:
#if defined(__i386__) && defined(__FreeBSD_version) && \
__FreeBSD_version > 300003
/*
* PC-98 kernel sets the `i386' string to the utsname.machine and
* it cannot be distinguished from IBM-PC by uname(3). Therefore,
* we check machine.ispc98 and adjust the machine variable before
* using usname(3) below.
* NOTE: machdep.ispc98 was defined on 1998/8/31. At that time,
* __FreeBSD_version was defined as 300003. So, this check can
* safely be done with any kernel with version > 300003.
*/
if (!machine) {
int ispc98;
size_t len;
len = sizeof(ispc98);
if (!sysctlbyname("machdep.ispc98", &ispc98, &len, NULL, 0)) {
if (ispc98)
machine = "pc98";
}
}
#endif
Note that this doesn't break cross-building. It is just for convenience,
so that you don't have to remember to set MACHINE explitly when building
pc98 userland with a pc98 kernel. But it is just confusing in other
configurations.
Bruce
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?20010914201048.W18027-100000>
