FW: 64 bit or 32 bit

FW: 64 bit or 32 bit

am 17.08.2007 20:18:47 von DAVID.A.KIRKWOOD

=46rom: Kirkwood, David A.=20
Sent: Friday, August 17, 2007 1:13 PM
To: Linux group (linux-admin@vger.kernel.org)
Subject: 64 bit or 32 bit

How can I tell if a given system is running a 32bit krnel or a 64bit ke=
rnel. I=A0 a system capable of running either, but I cannot figure out =
which kernel is installed on it.

David A. Kirkwood


-
To unsubscribe from this list: send the line "unsubscribe linux-admin" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: FW: 64 bit or 32 bit

am 17.08.2007 23:42:36 von terry white

.... ciao:

: on "8-17-2007" "Kirkwood, David A." writ:
: How can I tell if a system running a 32bit or 64bit kernel.

my first inclination is 'uname -a', which might offer a hint by virtue
of the cpu. in addition, you might take a look at "./.config" at the
root of the kernel source ...


--
.... i'm a man, but i can change,
if i have to , i guess ...

-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: FW: 64 bit or 32 bit

am 19.08.2007 21:48:34 von brouits

just make a C program like this:

int main()
{
printf("address bus is %d bytes\n",sizeof(void*));
}
and compile it with cc then run it.
If it prints 8, it is a 64 bit OS, if it prints 4, it is a 32 bit OS.
cheers
- Ben
Le vendredi 17 août 2007 à 14:18 -0400, Kirkwood, David A. a =
écrit :
>=20
> From: Kirkwood, David A.=20
> Sent: Friday, August 17, 2007 1:13 PM
> To: Linux group (linux-admin@vger.kernel.org)
> Subject: 64 bit or 32 bit
>=20
> How can I tell if a given system is running a 32bit krnel or a 64bit =
kernel. I a system capable of running either, but I cannot figure out =
which kernel is installed on it.
>=20
> David A. Kirkwood
>=20
>=20
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin=
" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: FW: 64 bit or 32 bit

am 20.08.2007 20:34:45 von Glynn Clements

Kirkwood, David A. wrote:

> How can I tell if a given system is running a 32bit krnel or a 64bit
> kernel. I=A0 a system capable of running either, but I cannot figure =
out
> which kernel is installed on it.

gzip -dc /proc/config.gz | fgrep CONFIG_X86_64

There may be similar information elsewhere in /proc; I don't know what
/proc/cpuinfo says for 64-bit architectures.

--=20
Glynn Clements
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: FW: 64 bit or 32 bit

am 20.08.2007 20:36:41 von Glynn Clements

Benoit Rouits wrote:

> > How can I tell if a given system is running a 32bit krnel or a 64bit
> > kernel. I a system capable of running either, but I cannot figure
> > out which kernel is installed on it.
>
> just make a C program like this:
>
> int main()
> {
> printf("address bus is %d bytes\n",sizeof(void*));
> }
> and compile it with cc then run it.
> If it prints 8, it is a 64 bit OS, if it prints 4, it is a 32 bit OS.

That tells you which architecture the program was compiled for, not
which architecture the kernel was compiled for. x86_64 can run both
32- and 64-bit code.

--
Glynn Clements
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: FW: 64 bit or 32 bit

am 21.08.2007 01:30:49 von brouits

Le lundi 20 août 2007 à 19:36 +0100, Glynn Clements a éc=
rit :
> Benoit Rouits wrote:
>=20
> > > How can I tell if a given system is running a 32bit krnel or a 64=
bit
> > > kernel. I a system capable of running either, but I cannot figure
> > > out which kernel is installed on it.
> >=20
> > just make a C program like this:
> >=20
> > int main()
> > {
> > printf("address bus is %d bytes\n",sizeof(void*));
> > }
> > and compile it with cc then run it.
> > If it prints 8, it is a 64 bit OS, if it prints 4, it is a 32 bit O=
S.
>=20
> That tells you which architecture the program was compiled for, not
> which architecture the kernel was compiled for. x86_64 can run both
> 32- and 64-bit code.
>=20
well, if we have a 64-bit kernel /and/ a compiler for 64 bits
architectures, i think that a long int must be 8 bytes, no ?
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: FW: 64 bit or 32 bit

am 21.08.2007 08:02:23 von Carsten Aulbert

Hi

Glynn Clements wrote:
> There may be similar information elsewhere in /proc; I don't know what
> /proc/cpuinfo says for 64-bit architectures.
>

Not much I fear:

This is a 32bit Centrino:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 13
model name : Intel(R) Pentium(R) M processor 2.26GHz
stepping : 8
cpu MHz : 798.000
cache size : 2048 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe nx up est tm2
bogomips : 1598.13
clflush size : 64


This a 64bit Athlon:
processor : 1
vendor_id : AuthenticAMD
cpu family : 15
model : 75
model name : AMD Athlon(tm) 64 X2 Dual Core Processor 4600+
stepping : 2
cpu MHz : 2411.413
cache size : 512 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext
fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacy
bogomips : 4828.44
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc


This a 64bit Opteron:
processor : 3
vendor_id : AuthenticAMD
cpu family : 15
model : 65
model name : Dual-Core AMD Opteron(tm) Processor 2218
stepping : 3
cpu MHz : 2613.435
cache size : 1024 KB
physical id : 1
siblings : 2
core id : 1
cpu cores : 2
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext
fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacy
bogomips : 5227.17
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc

If someone is interested I can give same results for 64bit Xeon system,
but that's powered off right now.

However, I just ran lshw and that gives me:

product: Dual-Core AMD Opteron(tm) Processor 2218
vendor: Advanced Micro Devices [AMD]
physical id: 4
bus info: cpu@0
version: Dual-Core AMD Opteron(tm) Processor 2218
serial: To Be Filled By O.E.M.
slot: CPU 1
size: 2600MHz
capacity: 2600MHz
width: 64 bits
clock: 200MHz
capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce
cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht
syscall nx mmxext fxsr
_opt rdtscp x86-64 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacy

Please have a look at capabilities, where x86-64 is mentioned. Thus
right now I would suggest using lshw|grep x86-64.

Sorry, that I don't know where it pulls this particular info from.

Carsten
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: FW: 64 bit or 32 bit

am 21.08.2007 10:13:37 von Glynn Clements

Benoit Rouits wrote:

> > > > How can I tell if a given system is running a 32bit krnel or a 64bit
> > > > kernel. I a system capable of running either, but I cannot figure
> > > > out which kernel is installed on it.
> > >
> > > just make a C program like this:
> > >
> > > int main()
> > > {
> > > printf("address bus is %d bytes\n",sizeof(void*));
> > > }
> > > and compile it with cc then run it.
> > > If it prints 8, it is a 64 bit OS, if it prints 4, it is a 32 bit OS.
> >
> > That tells you which architecture the program was compiled for, not
> > which architecture the kernel was compiled for. x86_64 can run both
> > 32- and 64-bit code.
>
> well, if we have a 64-bit kernel /and/ a compiler for 64 bits
> architectures, i think that a long int must be 8 bytes, no ?

If you compile the code into a 64-bit executable, it will either print
"address bus is 8 bytes" or refuse to run.

If you compile the code into a 32-bit executable, it will print
"address bus is 4 bytes" regardless of whether you run it on a 32- or
64-bit system.

--
Glynn Clements
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: FW: 64 bit or 32 bit

am 21.08.2007 10:27:44 von Glynn Clements

Carsten Aulbert wrote:

> > There may be similar information elsewhere in /proc; I don't know what
> > /proc/cpuinfo says for 64-bit architectures.
>
> Not much I fear:
>
> This is a 32bit Centrino:

> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe nx up est tm2

> This a 64bit Athlon:

> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext
> fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacy

> This a 64bit Opteron:

> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext
> fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacy

I think that "lm" might be relevant; this corresponds to the following
flag in :

#define X86_FEATURE_LM (1*32+29) /* Long Mode (x86-64) */

It's considered an AMD flag, so I don't know if it will be present on
an ia64 system.

--
Glynn Clements
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html