Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jul 2004 18:28:09 -0700
From:      Peter Wemm <peter@wemm.org>
To:        freebsd-amd64@freebsd.org
Subject:   Re: How to convert from i386 to amd64
Message-ID:  <200407191828.09877.peter@wemm.org>
In-Reply-To: <20040720003325.GM1070@dragon.nuxi.com>
References:  <200407122317.i6CNHUuc015500@m5p.com> <20040720003325.GM1070@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 19 July 2004 05:33 pm, David O'Brien wrote:
> On Mon, Jul 12, 2004 at 04:17:30PM -0700, george+freebsd@m5p.com 
wrote:
> > The following are probably all frequently-asked questions, but I
> > haven't been able to find the answers yet.
> >
> > 1. How can I compile an amd64 kernel while running an i386 kernel? 
> > The CPU I'm on is and amd64, if that matters.
>
> This is not supported.  Down load the amd64 install CD from
> ftp.freebsd.org and do a normal install to get a 64-bit machine
> running.

If anybody is up for an adventure, this is how I used to do it.  No, I 
will not give specific details.  If you need to ask for a step-by-step, 
then you're already way out of your depth. :)

What I did, was build a 64 bit kernel, and cross build a userland.  I'd 
steal a spare partition (I used the swap partition and changed it from 
swap to 4.2bsd for the purpose back then), newfs/mount it as /mnt, and 
do a destdir install into /mnt.  Then, boot the 64 bit kernel, with a 
vfs.root.mountfrom=ufs:/dev/ad0s1b,  and then either mount the original 
obj/src stuff stuff and install it into the real root, or copy the 
files over.  I usually cheated and copied the files. :-)  Then, reboot 
and do a real 'make world' to finish off any loose ends.

And dont forget to turn the ad0s1b partition back into swap.

These days I just install from a CD or from a pxeboot/nfsroot 
environment.  It's a lot less hassle.  But, if you're doing it for fun 
and know how to dig yourself out of deep sh!t if you make a mistake, 
its worth doing once.  But only if its for fun.

And no, a 64 bit kernel will not happily boot a 32 bit userland.  I 
haven't tried it for ages, but I know there are problems with the 
mount(2) interface, sysctl(2), and so on.  The 32 bit ABI stuff is 
limited to syscalls that applications were likely to run into.  I never 
got around to even trying the things needed for things like running a 
full 32 bit OS.  This doesn't mean that it can't be done, just that I 
never got around to it.  nmount(2) should help, but things like 
mount_nfs ABI are just evil.  And a sysctl wrapper needs to be done.

-- 
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407191828.09877.peter>