* Kernel bits
@ 2000-11-22 8:25 64738
2000-11-27 13:36 ` Chad Schwartz
0 siblings, 1 reply; 10+ messages in thread
From: 64738 @ 2000-11-22 8:25 UTC (permalink / raw)
To: linux-kernel
Hi.
Is there a syscall or something that can tell me whether I'm working on a 32-
or a 64-bit kernel?
Greeting,
Alain
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Kernel bits
2000-11-22 8:25 Kernel bits 64738
@ 2000-11-27 13:36 ` Chad Schwartz
2000-11-27 13:31 ` Keith Owens
2000-11-27 13:53 ` Richard B. Johnson
0 siblings, 2 replies; 10+ messages in thread
From: Chad Schwartz @ 2000-11-27 13:36 UTC (permalink / raw)
To: 64738; +Cc: linux-kernel
int main(void) {
printf("Size of an unsigned long is %d bytes\n",sizeof(unsigned long));
return(0);
}
That simple program will tell you that an unsigned long is 4 bytes, or 8
bytes.
It is then a safe assumption - that if you get back '8', that you're
running a 64bit kernel, on a 64bit processor.
Chad
On Wed, 22 Nov 2000, 64738 wrote:
> Hi.
>
> Is there a syscall or something that can tell me whether I'm working on a 32-
> or a 64-bit kernel?
>
> Greeting,
> Alain
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> Please read the FAQ at http://www.tux.org/lkml/
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Kernel bits
2000-11-27 13:36 ` Chad Schwartz
@ 2000-11-27 13:31 ` Keith Owens
2000-11-27 14:22 ` Chad Schwartz
2000-11-27 13:53 ` Richard B. Johnson
1 sibling, 1 reply; 10+ messages in thread
From: Keith Owens @ 2000-11-27 13:31 UTC (permalink / raw)
To: Chad Schwartz; +Cc: 64738, linux-kernel
On Mon, 27 Nov 2000 07:36:22 -0600 (CST),
Chad Schwartz <cwslist@main.cornernet.com> wrote:
>int main(void) {
> printf("Size of an unsigned long is %d bytes\n",sizeof(unsigned long));
> return(0);
>}
>
>That simple program will tell you that an unsigned long is 4 bytes, or 8
>bytes.
>
>It is then a safe assumption - that if you get back '8', that you're
>running a 64bit kernel, on a 64bit processor.
No, that only tells you the size of a long under the compiler you used.
If you are on an Intel IA64 (64 bit kernel) but you compile with gcc
for ix86 (32 bit userspace) then sizeof(long) is 4. IA64 runs both
native and ix86 code, sizeof(any userspace field) tells you nothing
about the kernel.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Kernel bits
2000-11-27 13:31 ` Keith Owens
@ 2000-11-27 14:22 ` Chad Schwartz
0 siblings, 0 replies; 10+ messages in thread
From: Chad Schwartz @ 2000-11-27 14:22 UTC (permalink / raw)
To: Keith Owens; +Cc: 64738, linux-kernel
> No, that only tells you the size of a long under the compiler you used.
> If you are on an Intel IA64 (64 bit kernel) but you compile with gcc
> for ix86 (32 bit userspace) then sizeof(long) is 4. IA64 runs both
> native and ix86 code, sizeof(any userspace field) tells you nothing
> about the kernel.
Doh. Well, it *DOES* tell you if you're running 64bit - if you're running
the 64bit compiler. :)
It was a simple check. Obviously, its not perfect. (In the cases you
pointed out, for instance, we'd report the wrong thing.)
Chad
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Kernel bits
2000-11-27 13:36 ` Chad Schwartz
2000-11-27 13:31 ` Keith Owens
@ 2000-11-27 13:53 ` Richard B. Johnson
1 sibling, 0 replies; 10+ messages in thread
From: Richard B. Johnson @ 2000-11-27 13:53 UTC (permalink / raw)
To: Chad Schwartz; +Cc: 64738, linux-kernel
On Mon, 27 Nov 2000, Chad Schwartz wrote:
> int main(void) {
> printf("Size of an unsigned long is %d bytes\n",sizeof(unsigned long));
> return(0);
> }
>
> That simple program will tell you that an unsigned long is 4 bytes, or 8
> bytes.
>
> It is then a safe assumption - that if you get back '8', that you're
> running a 64bit kernel, on a 64bit processor.
>
> Chad
I think sizeof(size_t) is more correct!
Cheers,
Dick Johnson
Penguin : Linux version 2.4.0 on an i686 machine (799.54 BogoMips).
"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Kernel bits
@ 2000-11-22 8:25 64738
2000-11-22 9:29 ` Matti Aarnio
0 siblings, 1 reply; 10+ messages in thread
From: 64738 @ 2000-11-22 8:25 UTC (permalink / raw)
To: linux-kernel
Hi.
Is there a syscall or something that can tell me whether I'm working on a 32-
or a 64-bit kernel?
Greeting,
Alain
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Kernel bits
2000-11-22 8:25 64738
@ 2000-11-22 9:29 ` Matti Aarnio
2000-11-22 9:46 ` 64738
0 siblings, 1 reply; 10+ messages in thread
From: Matti Aarnio @ 2000-11-22 9:29 UTC (permalink / raw)
To: 64738; +Cc: linux-kernel
On Wed, Nov 22, 2000 at 09:25:46AM +0100, 64738 wrote:
> Hi.
>
> Is there a syscall or something that can tell me whether I'm working on a 32-
> or a 64-bit kernel?
uname(2)
It gives out various strings from which you must then deduce,
what kind of kernel is needed to run at what kind of machine.
And even though the machine is running with 64-bit kernel
(e.g. alpha/sparc64/mips64/ia64), your userspace code might
be running in 32-bit mode.
> Greeting,
> Alain
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Kernel bits
2000-11-22 9:29 ` Matti Aarnio
@ 2000-11-22 9:46 ` 64738
2000-11-22 10:09 ` Matti Aarnio
0 siblings, 1 reply; 10+ messages in thread
From: 64738 @ 2000-11-22 9:46 UTC (permalink / raw)
To: Matti Aarnio; +Cc: linux-kernel
uname -m tells me the hardware type of the machine. Is this determined while
booting or is this the architecture I choose during 'make config'?
Can't I run a i386 kernel on a ia64 machine? I know something like this from HP-
UX. You can choose between a 32 and a 64 bit kernel when installing, so knowing
that you have a 64 bit capable machine does not say that you have a 64 bit
kernel.
And I want to have the kernel bits, not the processor bits.
Matti Aarnio <matti.aarnio@zmailer.org> wrote:
> On Wed, Nov 22, 2000 at 09:25:46AM +0100, 64738 wrote:
> > Is there a syscall or something that can tell me whether I'm working
> on a 32-
> > or a 64-bit kernel?
>
> uname(2)
>
> It gives out various strings from which you must then deduce,
> what kind of kernel is needed to run at what kind of machine.
>
> And even though the machine is running with 64-bit kernel
> (e.g. alpha/sparc64/mips64/ia64), your userspace code might
> be running in 32-bit mode.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Kernel bits
2000-11-22 9:46 ` 64738
@ 2000-11-22 10:09 ` Matti Aarnio
2000-11-23 1:15 ` Pavel Machek
0 siblings, 1 reply; 10+ messages in thread
From: Matti Aarnio @ 2000-11-22 10:09 UTC (permalink / raw)
To: 64738; +Cc: linux-kernel
On Wed, Nov 22, 2000 at 10:46:35AM +0100, 64738 wrote:
> uname -m tells me the hardware type of the machine. Is this determined while
> booting or is this the architecture I choose during 'make config'?
Mainly chosen during "make config".
Processor info you see at /proc/cpuinfo
> Can't I run a i386 kernel on a ia64 machine? I know something like this
> from HP-UX. You can choose between a 32 and a 64 bit kernel when
> installing, so knowing that you have a 64 bit capable machine does not
> say that you have a 64 bit kernel.
> And I want to have the kernel bits, not the processor bits.
Solaris runs 32-bit kernels on 64-bit UltraSPARCs
(up to Solaris version 2.6)
So yes, something like that MAY be possible in case
of ia64, but somehow I doubt...
/Matti Aarnio
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Kernel bits
2000-11-22 10:09 ` Matti Aarnio
@ 2000-11-23 1:15 ` Pavel Machek
0 siblings, 0 replies; 10+ messages in thread
From: Pavel Machek @ 2000-11-23 1:15 UTC (permalink / raw)
To: Matti Aarnio; +Cc: 64738, linux-kernel
Hi!
> > Can't I run a i386 kernel on a ia64 machine? I know something like this
> > from HP-UX. You can choose between a 32 and a 64 bit kernel when
> > installing, so knowing that you have a 64 bit capable machine does not
> > say that you have a 64 bit kernel.
> > And I want to have the kernel bits, not the processor bits.
>
> Solaris runs 32-bit kernels on 64-bit UltraSPARCs
> (up to Solaris version 2.6)
>
> So yes, something like that MAY be possible in case
> of ia64, but somehow I doubt...
It definitely will be possible to run i386 linux on x86-64.
--
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2000-11-27 14:41 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-22 8:25 Kernel bits 64738
2000-11-27 13:36 ` Chad Schwartz
2000-11-27 13:31 ` Keith Owens
2000-11-27 14:22 ` Chad Schwartz
2000-11-27 13:53 ` Richard B. Johnson
-- strict thread matches above, loose matches on Subject: below --
2000-11-22 8:25 64738
2000-11-22 9:29 ` Matti Aarnio
2000-11-22 9:46 ` 64738
2000-11-22 10:09 ` Matti Aarnio
2000-11-23 1:15 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox