[fbsd_questions] i386 vs amd64, on intel_64
Michael Powell
nightrecon at hotmail.com
Mon Oct 4 22:51:52 UTC 2010
spellberg_robert wrote:
[snip]
> consider a dvd_image [ to pick an approach ] of a release to be found on
> ftp.freebsd.org.
>
> q: if the release_name includes the string "i386",
> am i restricted to 8 32_bit registers and 32_bit pointers,
> notwithstanding its installation on an intel_64 platform ?
I am certainly not an expert, and if I am interpreting the question
correctly I believe the answer here would be yes. x86 processors of today
can run either 32 bit or 64 bit OS. For example, you could install a 32 bit
Windows XP and it would run as 32 bit even thought the processor has 64 bit
capability. The restriction you are asking about here would be as a result
of using a 32 bit OS and not because of processor capabilities.
>
> next, from what i have been reading,
> those releases whose names contain "amd64" not only are for amd cpus,
> but, also, are for the intel_64 variant [ no doubt, probing the cpu for
> its feature_set ].
>
> q: if i install an "amd64" version on an "intel_64" platform,
> am i restricted to 16 64_bit registers and 48_bit pointers or
> can i compile for both cpu_models
> [ perhaps, with nothing more complicated than a compiler option
> [ ] ?
>
The "amd64" stuck primarily because the 64 bit extensions were initially
pioneered by AMD, and subsequently copied by Intel. Generally speaking, for
the most part it is possible to run 32 bit binaries on a 64 bit OS installed
to 64 bit x86 CPU hardware. Another Windows example: Let's say you have 64
bit version of Windows installed. It can run 32 bit apps using "WoW", or
Windows on Windows. amd64 processor can execute either 32 bit or 64 bit
simultaneously providing there are libraries contained within the OS to
facilitate this. You just wouldn't really want to do this because it is
slow.
I do not know enough about this as I have never had a need, but I think
similar facilities exist in FreeBSD. You can install amd64 to a 64 bit CPU
and still execute 32 bit software using a 32 compatibility library set. Look
at the GENERIC kernel config file for amd64 and you will see a line like
this:
options COMPAT_FREEBSD32 # Compatible with i386 binaries
You need to have the 32 bit library set built and installed. Investigate
this particular subject for further (and better) explanation. It isn't so
much a matter of compiling an app for both models as it is where they will
run. You cannot compile an app as 64 bit and run it on an i386 OS install,
whether or not the CPU is 64 bit. But with the help of 32 bit compatibility
libs you _can_ run a 32 bit binary on a 64 bit OS installed to a 64 bit
processor.
-Mike
More information about the freebsd-questions
mailing list