Solved [Solved] AMD64 on 32-bit CPU

I have an old Optiplex GX280 with a 3 GHZ Celeron and 4 GB of RAM. It is currently running FreeBSD 9.2 i386. The CPU is 32-bit so FreeBSD can't use all of the memory:

real memory = 4294967296 (4096 MB)
avail memory = 3134971904 (2989 MB)

Is it possible to install the AMD64 version in order for it to use all the memory, and if so are there any drawbacks. Also, I have the AMD64 version burned to disk, however, FreeBSD sees the HD and the bootable DVD and doesn't know which to boot from. What's the easiest way to make the HD not visible as bootable (even if brutal) - rm -rf /boot?
 
Re: AMD64 on 32-bit CPU

I believe what you're looking for is to include PAE support in your kernel to allow you to address memory above the 4 GB limit of i386 processors. You may find it useful to read Thread 43177 by @sebastians entitled Large Memory Configuration (PAE) Kernel for FreeBSD 9.2 i386 (x86), as well as referring to section 9.4.1: Large Memory Configurations (PAE) in the FreeBSD handbook. The latter notes some limitations when using PAE.

To answer the specific question you asked, no, it is not possible to run amd64 binaries on an i386 processor. Machine code instructions intended for an amd64 chip simply won't make sense to an i386 chip; it would be a little like asking a chef who only spoke Spanish to cook something delicious using a recipe written in Korean.

I have a couple of Dell Optiplex GX260s myself (great machines), though neither with anywhere near 4 GB RAM so I've never ventured into PAE territory.
 
Last edited by a moderator:
Re: AMD64 on 32-bit CPU

Thanks for the quick reply. The AMD64 part of my question was over something I read on an unofficial forum - I didn't think it sounded right. It's been a[ ]while since I compiled a kernel, so I may just be happy with the amount that it can use. After all, I not used to using FreeBSD with more than half a gig GB anyway. I don't post much here, is there a way to mark this "solved"?
 
Re: AMD64 on 32-bit CPU

After I posted, I reread what you had written and spotted that you only have 4 GB RAM, not more than 4 GB. Section 5.1 in the FreeBSD Frequently Asked Questions: Why is FreeBSD finding the wrong amount of memory on i386 hardware? may have an answer for you and also suggests using a PAE enabled kernel. Your reply beat my post update :)

Update:
You may also want to check whether the machine has an on-board graphics card that uses system memory; certainly my GX260s do that.

I thought it would be sensible to include the FAQ quotation so others don't need to go looking:
Why is FreeBSD finding the wrong amount of memory on i386™ hardware?

The most likely reason is the difference between physical memory addresses and virtual addresses.

The convention for most PC hardware is to use the memory area between 3.5 GB and 4 GB for a special purpose (usually for PCI). This address space is used to access PCI hardware. As a result real, physical memory can not be accessed by that address space.

What happens to the memory that should appear in that location is dependent on your hardware. Unfortunately, some hardware does nothing and the ability to use that last 500 MB of RAM is entirely lost.
Luckily, most hardware remaps the memory to a higher location so that it can still be used. However, this can cause some confusion if you watch the boot messages.

On a 32-bit version of FreeBSD, the memory appears lost, since it will be remapped above 4 GB, which a 32-bit kernel is unable to access. In this case, the solution is to build a PAE enabled kernel.
 
Re: AMD64 on 32-bit CPU

:) That article explains why grep memory /var/run/dmesg.boot shows:
Code:
real memory  = 4294967296 (4096 MB)
avail memory = 3134971904 (2989 MB)

It appears it's not a problem.

Thanks again!
 
If you want to use that extra memory, I would advise replacing the processor rather than trying to deal with PAE. A 64-bit processor to fit in that system should be very cheap.

Actually, it seems odd to have a 32-bit processor in that desktop. Please show the output of grep 'AMD Features' /var/run/dmesg.boot.
 
Code:
AMD Features=0x100000<NX>
Socket type LGA775 Socket - It would be great if I could drop something better in there.
 
Hm, no "LM", so no 64-bit on that one. But certainly a replacement should be nearly free. Some searching suggests a Pentium 4 640 would work.
 
Back
Top