Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: Program in 32-bit, run on 64-bit OK?

Reply
Thread Tools

Re: Program in 32-bit, run on 64-bit OK?

 
 
Arne Vajh°j
Guest
Posts: n/a
 
      11-14-2012
On 11/14/2012 8:58 AM, sl@exabyte wrote:
> I am too sure on this.
>
> I am preparing to install OpenSuse v10 32-bit on my pc. This pc is for
> testing my C programs, which will eventually be transferred to my internet
> host which is running the 64-bit version.
>
> Can my programs run ?
>
> Off my head I think they should, but the reverse may not. Please correct me.
>
> Do I have to pick the correct compiler ?


Pure Java:

Run with 32 Run with 64
Build with 32 yes yes
Build with 64 yes yes


Pure C:

Run on 32 Run on 64
Build for 32 yes yes
Build for 64 no yes

Mix of Java and C via JNI:

Run on/with 32 Run on/with 64
Build for 32 yes no
Build for 64 no yes

Arne

 
Reply With Quote
 
 
 
 
Cholo Lennon
Guest
Posts: n/a
 
      11-14-2012
On 14/11/2012 11:12, Arne Vajh°j wrote:
> On 11/14/2012 8:58 AM, sl@exabyte wrote:
>> I am too sure on this.
>>
>> I am preparing to install OpenSuse v10 32-bit on my pc. This pc is for
>> testing my C programs, which will eventually be transferred to my
>> internet
>> host which is running the 64-bit version.
>>
>> Can my programs run ?
>>
>> Off my head I think they should, but the reverse may not. Please
>> correct me.
>>
>> Do I have to pick the correct compiler ?

>
> Pure Java:
>
> Run with 32 Run with 64
> Build with 32 yes yes
> Build with 64 yes yes
>
>
> Pure C:
>
> Run on 32 Run on 64
> Build for 32 yes yes
> Build for 64 no yes
>
> Mix of Java and C via JNI:
>
> Run on/with 32 Run on/with 64
> Build for 32 yes no


The OP can still run a 32-bit JNI java/C application on 64-bit: He/She
just needs to use a 32-bit JVM.


> Build for 64 no yes
>



Best Regards


--
Cholo Lennon
Bs.As.
ARG
 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      11-14-2012
On 11/14/2012 12:11 PM, Cholo Lennon wrote:
> On 14/11/2012 11:12, Arne Vajh°j wrote:
>> On 11/14/2012 8:58 AM, sl@exabyte wrote:
>>> I am too sure on this.
>>>
>>> I am preparing to install OpenSuse v10 32-bit on my pc. This pc is for
>>> testing my C programs, which will eventually be transferred to my
>>> internet
>>> host which is running the 64-bit version.
>>>
>>> Can my programs run ?
>>>
>>> Off my head I think they should, but the reverse may not. Please
>>> correct me.
>>>
>>> Do I have to pick the correct compiler ?

>>
>> Pure Java:
>>
>> Run with 32 Run with 64
>> Build with 32 yes yes
>> Build with 64 yes yes
>>
>>
>> Pure C:
>>
>> Run on 32 Run on 64
>> Build for 32 yes yes
>> Build for 64 no yes
>>
>> Mix of Java and C via JNI:
>>
>> Run on/with 32 Run on/with 64
>> Build for 32 yes no

>
> The OP can still run a 32-bit JNI java/C application on 64-bit: He/She
> just needs to use a 32-bit JVM.


Yes.

What do you think "with 64" meant?

>> Build for 64 no yes


Arne


 
Reply With Quote
 
Joerg Meier
Guest
Posts: n/a
 
      11-14-2012
On Wed, 14 Nov 2012 12:14:56 -0500, Arne Vajh°j wrote:

> On 11/14/2012 12:11 PM, Cholo Lennon wrote:
>> On 14/11/2012 11:12, Arne Vajh°j wrote:
>>> On 11/14/2012 8:58 AM, sl@exabyte wrote:
>>>> I am preparing to install OpenSuse v10 32-bit on my pc. This pc is for
>>>> testing my C programs, which will eventually be transferred to my
>>>> internet
>>>> host which is running the 64-bit version.


>>>> Can my programs run ?
>>> Mix of Java and C via JNI:


>>> Run on/with 32 Run on/with 64
>>> Build for 32 yes no

>>
>> The OP can still run a 32-bit JNI java/C application on 64-bit: He/She
>> just needs to use a 32-bit JVM.

> Yes.


> What do you think "with 64" meant?


The answer to the OPs question - can a program compiled on 32 bit SuSE run
on 64 bit SuSE. To which your answer would be wrong, because you addressed
whether or not it would run on the 64-bit-VM, but there is no reason to
assume his "internet host" would be incapable of also running a 32-bit-VM.

Unless I missunderstand how Java and JNI works - are you saying a 64-bit-OS
is incapable of running 32-bit-JNI programs, even with a 32-bit-VM ?

In other words, it seems like you answered a different question than the OP
wanted the answer for.

Liebe Gruesse,
Joerg

--
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.
 
Reply With Quote
 
Jan Burse
Guest
Posts: n/a
 
      11-14-2012
Arne Vajh°j schrieb:
> Pure Java:
>
> Run with 32 Run with 64
> Build with 32 yes yes
> Build with 64 yes yes


There are different shades of 64-bit I guess,
i.e. the -XX:+UseCompressedOops option. Not sure
how this influences C interaction.

Bye
 
Reply With Quote
 
sl@exabyte
Guest
Posts: n/a
 
      11-15-2012
Joerg Meier wrote:
>
> The answer to the OPs question - can a program compiled on 32 bit
> SuSE run on 64 bit SuSE. To which your answer would be wrong, because
> you addressed whether or not it would run on the 64-bit-VM, but there
> is no reason to assume his "internet host" would be incapable of also
> running a 32-bit-VM.
>
> Unless I missunderstand how Java and JNI works - are you saying a
> 64-bit-OS is incapable of running 32-bit-JNI programs, even with a
> 32-bit-VM ?
>
> In other words, it seems like you answered a different question than
> the OP wanted the answer for.
>


It seems there are more than I have asked.

I don't know what JVM is the host running, it just states OpenSuse v11
64-bit, and I just suppose it is JVM 64-bit.

And I suppose only hardware with 64-bit address bus can run 64-bit OS.




 
Reply With Quote
 
Stuart
Guest
Posts: n/a
 
      11-15-2012
On 11/15/12 sl@exabyte wrote:
[snip]
> And I suppose only hardware with 64-bit address bus can run 64-bit OS.


Wrong. Typical 64 bit processors have either a 36 bit or a 40 bit
physical address bus (40 bits are 1 TB, an almost incredible amount of
RAM, wikipedia mentions that some AMD chips even offer a 48 bit memory
bus). Note that bus width and register width do not have to have a
one-to-one relationship. The early 286 processor had a register width of
16 bits but an address bus with 24 bits (4MB), so they had to invent
this segmentation model in order to compute a 20bit address from two 16
bit registers. Twenty years later, the segmenation unit is still present
at the Intel architecture while the numbers have been reversed: now the
36 or 40 bit physical address is computed from a 16 bit value and a 64
bit value. Sounds like overkill, and yes, it is. That's just for
backwards compatibility for applications from 1985.

Regards,
Stuart
 
Reply With Quote
 
SL@maxis
Guest
Posts: n/a
 
      11-16-2012
On Fri, 16 Nov 2012 07:08:58 +0800, Stuart <(E-Mail Removed)> wrote:

>
> Wrong. Typical 64 bit processors have either a 36 bit or a 40 bit
> physical address bus (40 bits are 1 TB, an almost incredible amount of
> RAM, wikipedia mentions that some AMD chips even offer a 48 bit memory
> bus). Note that bus width and register width do not have to have a
> one-to-one relationship. The early 286 processor had a register width of
> 16 bits but an address bus with 24 bits (4MB), so they had to invent
> this segmentation model in order to compute a 20bit address from two 16
> bit registers. Twenty years later, the segmenation unit is still present
> at the Intel architecture while the numbers have been reversed: now the
> 36 or 40 bit physical address is computed from a 16 bit value and a 64
> bit value. Sounds like overkill, and yes, it is. That's just for
> backwards compatibility for applications from 1985.
>
> Regards,
> Stuart


Thanks. I am not too sure now

I have an old Intel Pentium 4 1500Mhz PC. Can it run 64-bit OS ?


--
Using Opera's revolutionary email client: http://www.opera.com/mail/
 
Reply With Quote
 
BGB
Guest
Posts: n/a
 
      11-16-2012
On 11/15/2012 5:08 PM, Stuart wrote:
> On 11/15/12 sl@exabyte wrote:
> [snip]
>> And I suppose only hardware with 64-bit address bus can run 64-bit OS.

>
> Wrong. Typical 64 bit processors have either a 36 bit or a 40 bit
> physical address bus (40 bits are 1 TB, an almost incredible amount of
> RAM, wikipedia mentions that some AMD chips even offer a 48 bit memory
> bus). Note that bus width and register width do not have to have a
> one-to-one relationship. The early 286 processor had a register width of
> 16 bits but an address bus with 24 bits (4MB), so they had to invent
> this segmentation model in order to compute a 20bit address from two 16
> bit registers. Twenty years later, the segmenation unit is still present
> at the Intel architecture while the numbers have been reversed: now the
> 36 or 40 bit physical address is computed from a 16 bit value and a 64
> bit value. Sounds like overkill, and yes, it is. That's just for
> backwards compatibility for applications from 1985.
>


corrections:
24 bits is 16MB (because 2^24 = 16777216), this bus size was used by
both the 286 and 386SX (the 386DX and 486 used full 32-bits);
the segmentsffset -> 20 bit address thing was there since the 8086,
which could only address 1MB of RAM (in contrast to 64kB on the 8080);
on current 64-bit chips, the segmentation is also non-functional in 64
bit mode with the partial exception of the FS and GS segments (used
mostly for implementing TLS and similar).

(so, while the segment registers are still present, they don't really do
all that much anymore).

in effect, the chip is using a 64-bit flat address model, but may remap
the addresses mostly through the use of page-based address translation
(which maps from the program's virtual address space to the physical/RAM
address space).

yes, the CPU has backwards compatibility, but it actually involves a
fair amount of mode-changing (as control is passed from one program to
another, the CPU mode changes), but there are limits to this.

however, real-mode software (IOW: most of the software from 1985) can't
actually run on the CPU if it is running in "long mode", so it actually
requires use of either hardware emulation or virtualization to make this
work (for example, DOSbox does emulation, and VMware does virtualization).

as-is, about the oldest software that can be run directly in modern
Windows is roughly mid-to-late 90s era software (IOW: from when the
world moved solidly over to 32 bits), although the hardware can
technically still support running 16-bit protected-mode software in
long-mode (theoretically, MS could have made Win3.x apps work without
emulation, had they wanted to do so...).


or such...

 
Reply With Quote
 
BGB
Guest
Posts: n/a
 
      11-16-2012
On 11/15/2012 7:23 PM, SL@maxis wrote:
> On Fri, 16 Nov 2012 07:08:58 +0800, Stuart <(E-Mail Removed)> wrote:
>
>>
>> Wrong. Typical 64 bit processors have either a 36 bit or a 40 bit
>> physical address bus (40 bits are 1 TB, an almost incredible amount of
>> RAM, wikipedia mentions that some AMD chips even offer a 48 bit memory
>> bus). Note that bus width and register width do not have to have a
>> one-to-one relationship. The early 286 processor had a register width
>> of 16 bits but an address bus with 24 bits (4MB), so they had to
>> invent this segmentation model in order to compute a 20bit address
>> from two 16 bit registers. Twenty years later, the segmenation unit is
>> still present at the Intel architecture while the numbers have been
>> reversed: now the 36 or 40 bit physical address is computed from a 16
>> bit value and a 64 bit value. Sounds like overkill, and yes, it is.
>> That's just for backwards compatibility for applications from 1985.
>>
>> Regards,
>> Stuart

>
> Thanks. I am not too sure now
>
> I have an old Intel Pentium 4 1500Mhz PC. Can it run 64-bit OS ?
>
>


it may or may not run 64-bits (depending on the specific core it has),
you would have to test and see if it does or not.

one way to test easily would be to get a Linux live-cd for x86-64. if it
boots up, the CPU does 64-bit, and if it refuses to boot up with an
error message about the type of CPU, then the CPU doesn't support it.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can parellelized program run slower than single process program? Yesterday Paid Python 1 06-21-2012 05:58 AM
Program will not run, used to run, have reinstalled numerous times,no luck Boppy NZ Computing 15 01-24-2011 10:30 AM
How to get inputs for a python program that run from another python program pradeep nair Python 2 06-12-2007 01:20 PM
Can Java program evoke and run a FORTRAN program directly? Shawn Java 2 12-06-2006 07:08 PM
can run javascript can't run vbscript - WHY duncan ASP .Net 2 10-27-2004 09:31 AM



Advertisments