From owner-freebsd-amd64@FreeBSD.ORG Tue Jul 20 01:28:10 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5748116A4CE; Tue, 20 Jul 2004 01:28:10 +0000 (GMT) Received: from daintree.corp.yahoo.com (daintree.corp.yahoo.com [216.145.52.172]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4729D43D2F; Tue, 20 Jul 2004 01:28:10 +0000 (GMT) (envelope-from peter@yahoo-inc.com) Received: by daintree.corp.yahoo.com (Postfix, from userid 2154) id 317378826; Mon, 19 Jul 2004 18:28:10 -0700 (PDT) From: Peter Wemm To: freebsd-amd64@freebsd.org Date: Mon, 19 Jul 2004 18:28:09 -0700 User-Agent: KMail/1.6.2 References: <200407122317.i6CNHUuc015500@m5p.com> <20040720003325.GM1070@dragon.nuxi.com> In-Reply-To: <20040720003325.GM1070@dragon.nuxi.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200407191828.09877.peter@wemm.org> Subject: Re: How to convert from i386 to amd64 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2004 01:28:11 -0000 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