From owner-freebsd-questions@FreeBSD.ORG Mon Oct 4 22:51:52 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4415F106564A for ; Mon, 4 Oct 2010 22:51:52 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id C45258FC15 for ; Mon, 4 Oct 2010 22:51:51 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1P2tsq-0005aW-Q9 for freebsd-questions@freebsd.org; Tue, 05 Oct 2010 00:51:48 +0200 Received: from pool-173-79-85-36.washdc.fios.verizon.net ([173.79.85.36]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Oct 2010 00:51:48 +0200 Received: from nightrecon by pool-173-79-85-36.washdc.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Oct 2010 00:51:48 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Michael Powell Followup-To: gmane.os.freebsd.questions Date: Mon, 04 Oct 2010 18:55:45 -0400 Lines: 59 Message-ID: References: <4CAA3030.3090001@emailrob.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: pool-173-79-85-36.washdc.fios.verizon.net Subject: Re: [fbsd_questions] i386 vs amd64, on intel_64 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 22:51:52 -0000 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