Subject: Re: NetBSD/i386 binaries
To: Ray Phillips <r.phillips@mailbox.uq.edu.au>
From: Frederick Bruckman <fb@enteract.com>
List: port-i386
Date: 03/07/2001 08:01:12
On Wed, 7 Mar 2001, Ray Phillips wrote:
> 2) Does NetBSD/i386 code use features of the more recent Intel CPUs?
> I presume the answer is "yes", so I guess the binaries installed by
> sysinst from the distribution's *.tgz files differ depending on which
> processor is in the machine?
Not by default. All binaries for 1.5/i386, including packages from the
pkgsrc collection, should therefore run on any 1.5/i386. You can build
your own binaries with optimizations, though, by adding the
appropriate switches in the "COPTS" (NetBSD-only) or "CFLAGS" (more
general) environment variables. I usually set "COPTS" in the kernel
config file, and don't bother anywhere else. For examples, "COPTS=-O2
-m486" for one 486 (-m486 doesn't mean exactly what it looks like --
see the man page for "gcc"), and "COPTS=-O3 -mcpu=pentium" for an AMD
K-6.
A few packages do make use of specific processor features. The
aperture driver (a kernel module for X server machines), for instance,
conditionally executes code to make use of some feature of the K-6,
based on detecting one. It doesn't matter what machine it's built on,
though. It's not unheard of for software to require some processor to
run, especially in the linux world, but I've never seen a package that
tried to make the determination at build time, and certainly nothing
like that in the NetBSD base system.
> 3) Leading on from 2), if NetBSD/i386 is installed on a disk in one PC can
> that disk be used in any another PC (assuming the swap space on the disk
> is appropriate for the amount of RAM in the second machine)?
Yes. The swap on the boot disk doesn't even matter. You don't need any
swap to boot unless you have very little memory, and if you need more
swap to run, you can add another disk.
Frederick