Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #10506

Re: 64-bit gotcha

From Joshua Cranmer <Pidgeot18@verizon.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: 64-bit gotcha
Date 2011-12-04 18:33 -0600
Organization A noiseless patient Spider
Message-ID <jbh3gd$4th$1@dont-email.me> (permalink)
References <vvujd71j7k73s1m61bu10eol0ebtn4iem0@4ax.com> <4eda8488$0$287$14726298@news.sunsite.dk> <xbKdnW4-I_26AUfTnZ2dnUVZ_qqdnZ2d@posted.palinacquisition>

Show all headers | View raw


On 12/3/2011 4:01 PM, Peter Duniho wrote:
> True, Windows does not support that. But it's technically feasible, and
> in fact 32-bit Windows supported 32-bit processes calling 16-bit DLLs
> (e.g. http://support.microsoft.com/kb/155763).
>
> It's a fair question to ask why Microsoft didn't do the same for 32-bit
> DLLs executing in 64-bit processes.

I believe the short answer is that x86-64 is surprisingly different from 
x86-32; note that, given some experience with so-called "16-bit" x86 
code, it was much closer to the same ISA.

My very limited experience with some Win16 code indicates that the 
primary difference is that 16-bit code relies on segmentation a lot more 
(CS/DS/ES/SS concerns), but it's still in the same processor mode: if 
not directly the same, the code would still act identically in the two 
modes. By contrast, x86-64 moves 32-bit and 64-bit code into different 
processor modes, and the same byte sequence would do different things. 
For example, e9 is the opcode for a JMP <rel16> in 32-bit code but a JMP 
<rel32> in 64-bit code--it can't act as both at the same time.

It still wouldn't be impossible to make 32-from-64 to work, but it would 
certainly require IPC between a 64-bit real process and a 32-bit shadow 
process; given undecidability of pointer aliasing (plus loads of pointer 
punning), it would probably require nontrivial tailoring the 32-bit 
process to get this to work--which raises the question of why not 
translate it to 64-bit code in the first place.

Now, it is possible to engineer a 64-bit codebase to spin off the 32-bit 
process itself and manage all of this itself.

-- 
Beware of bugs in the above code; I have only proved it correct, not 
tried it. -- Donald E. Knuth

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

64-bit gotcha Roedy Green <see_website@mindprod.com.invalid> - 2011-12-03 02:47 -0800
  Re: 64-bit gotcha Arne Vajhøj <arne@vajhoej.dk> - 2011-12-03 15:20 -0500
    Re: 64-bit gotcha Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-12-03 14:01 -0800
      Re: 64-bit gotcha Roedy Green <see_website@mindprod.com.invalid> - 2011-12-03 18:17 -0800
        Re: 64-bit gotcha Martin Gregorie <martin@address-in-sig.invalid> - 2011-12-04 12:06 +0000
          Re: 64-bit gotcha Jeff Higgins <jeff@invalid.invalid> - 2011-12-04 08:57 -0500
            Re: 64-bit gotcha Jeff Higgins <jeff@invalid.invalid> - 2012-02-25 19:15 -0500
              Re: 64-bit gotcha Martin Gregorie <martin@address-in-sig.invalid> - 2012-02-26 00:53 +0000
                Re: 64-bit gotcha Jeff Higgins <jeff@invalid.invalid> - 2012-02-25 20:26 -0500
          Re: 64-bit gotcha Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-12-04 10:04 -0400
        Re: 64-bit gotcha Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 19:50 -0400
      Re: 64-bit gotcha Travers Naran <tnaran@gmail.com> - 2011-12-04 09:17 -0800
      Re: 64-bit gotcha Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-12-04 18:33 -0600
        Re: 64-bit gotcha Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-12-04 16:56 -0800
        Re: 64-bit gotcha Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 19:53 -0400
      Re: 64-bit gotcha Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 19:49 -0400

csiph-web