New AMD64 owner

David O'Brien obrien at freebsd.org
Thu Jan 29 10:54:31 PST 2004


On Thu, Jan 29, 2004 at 08:13:16AM -0500, Brian Tao wrote:
>     AMD64 CPU's are supposed to have "seamless" backwards
> compatibility with 32-bit x86 code... I've confirmed this by watching
> Windows 98 boot up on my new system (it was what the integrator had
> installed to do some burn-in testing, presumably).  If this is the
> case, why am I seeing references to broken ia32 compatibility?
> Shouldn't that "just work"?  Or is this a kernel/loader issue with a
> 64-bit aware install?

It is a CPU mode issue.  If you think back to your brand new i386 and
Windows 95, the CPU was switched back into real mode when you ran a
MS-Windows 3.1 program.  Along with MS-Windows 95 doing "Thunking" for
system services.

The "seemless" in AMD64 is the same that you saw when the i386 first came
out -- it ran 16-bit Real Mode code just fine.  In fact it was the
fastest 16-bit x86 machine in the world at the time.  Simply extend that
again to 64-bit and you get the idea behind AMD64.

So now the issue you're refering to is how can one run 32-bit code under
a 64-bit OS.  Issues are that the kernel must support system calls being
made by these 32-bit programs -- so one needs syscall translation.  If
you look at the function call ABI between 32-bit x64 and AMD64 you'll see
how things are very different and have to converted from one to the
other.

Same reason you can't just run a Linux 32-bit x86 binary under
FreeBSD/i386 before someone wrote the /sys/compat/linux bits which handle
system call translation and other things that are specific to Linux and
different from FreeBSD.


>     Related to the previous question:  should I be able to install
> either freebsd-i386 or freebsd-amd64, and both will work?

Yes -- assuming you are talking about dual-booting.  My FreeBSD/i386
build machine is actually an Athlon64 machine that is run purely and only
in 32-bit mode.  Athlon64 is the fastest 32-bit x86 machine in the world
today.

> the i386 install will run in 32-bit mode, but at least it will run
> (and act as a really fast Intel box, I'm hoping).

Correct.

> Or is there
> something inherent in the kernel or boot process that forces me to run
> freebsd-amd64, and cannot utilize the 32-bit compatibility of the CPU?

You are mixing machine capabilities, with OS capabilities.  Please think
back to the 8088/80286 -> i386 transition.


> normal IDE drive.  However, when I tried to boot the 5.2-RELEASE
> installer, it was not able to find any drives.  I noticed that Soren
> recently committed a change to support the 3114's, but that doesn't
> help me if I can't get FreeBSD on the damn disks in the first place.  ;-)

I will make a new snapshot w/in a week that will have SoS's Si3114 change
in it.


> Is it possible to subsequently do a source build upgrade to amd64?  Or
> do we not have the tools to do that yet?

No, not at this time.
 
-- 
-- David  (obrien at FreeBSD.org)


More information about the freebsd-amd64 mailing list