[plt-scheme] still confused about 32/64 bit

From: Brian P. O'Hanlon (brainpo at gmail.com)
Date: Thu Sep 24 13:47:13 EDT 2009

On Thu, Sep 24, 2009 at 5:40 AM, Noel Welsh <noelwelsh at gmail.com> wrote:
> On Thu, Sep 24, 2009 at 10:15 AM, keydana at gmx.de <keydana at gmx.de> wrote:
>> After reading some articles on Wikipedia, my main question is now:  Does
>>  "architecture" refer to the hardware or to the software (the OS)?
>
> Depends on context
>
>> Because first I thought it referred to the hardware, like in "Intel x86
>> architecture". In that case, as my processor is an Intel Core 2 Duo, I guess
>> I should have an x86_64 architecture.
>
> 64-bit x86 chips can run in either 32-bit or 64-bit mode. So you have both. :)
>
>> On the other hand, when I type
>> $ arch
>>
>> I get "i386" which stands for 32 bit intel.
>> So "architecture" perhaps refers to how the OS uses the processor (I'm still
>> running Leopard, where the kernel runs in 32bit  mode)?
>
> Yes, Leopard is 32-bit only, so your CPU runs only in 32-bit mode and
> your architecture is reported as that.

Not quite.  When you run ``arch'' on OS X, it will print out either
``ppc'' or ``i386'', regardless of whether the machine is capable of
running 64 bit code.  My desktop at work is a G5 PPC, so it can
execute 64 bit code, and when I call gcc with -m 64, I can run the
binary that it spits out.  The arch program simply tells you whether
your machine is PowerPC or X86, not anything more about the processor.
 My personal laptop is a Core 2 Duo, and I definitely run 64 bit apps
in OS X, when arch (on Snow Leopard on this machine) returns ``i386''.

Leopard is actually 32 bit and 64 bit, and if a program is compiled
for both 32 and 64 bit architectures, and you run it on a Core 2
system, I believe that it will execute the 64 bit version.  Snow
Leopard changed some things in regards to this; I think that at least
the default is that gcc targets x86_64 rather than x86 for C code, and
maybe there are more 64-bit libraries available, but I would echo the
other person who replied and say that you should hold off on
upgrading.

But if you have a Core 2 Duo, and OS X Leopard, you should be able to
do 64 bit stuff just fine... in fact, when you run Activity Monitor,
there should be a field that says ``kind'' for each process that is
running, and some of those will probably say ``Intel (64-bit)''

-Brian


Posted on the users mailing list.