Subject: Re: [RFC] Running reverse-endian binaries
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Andrew Cagney <cagney@mac.com>
List: tech-kern
Date: 01/06/2003 20:59:19
> In message <1fnthzw.w6rvve1atcfdbM@[10.0.12.137]>Emmanuel Dreyfus writes
> 
>>Hi all
>>
>>A nice feature for NetBSD/mips would be the ability to run reverse
>>endian binaries, it would make possible to run IRIX binaries on
>>NetBSD/cobalt, for instance. Moreover, I recently had some questions
> 
>>from someone that would want to run big endian binaries on NetBSD/hpcarm
> 
>>(which is little endian for now), so I'd like to get a more precise idea
>>of what needs to be done.
> 
> 
> I talked over this at some length once, with the guys who did
> SimOS/DISCO/VMware.  For every multi-byte chunk which passes the user/kernel
> boundary, you have to decide whether its a bytestream (in which case you
> leave it alone) or an integer/address (in which case you byteswap it).

The last time I looked, the MIPS was `XOR Endian' so you would need to 
worry about everything, including bytestreams (i.e., file i/o).

Andrew

> ioctls get hairy.Datafiles with other-endian binary data (structs,
> floats, have to tagged with endian-ness bits (xdr, X11 font data, ...)
> or be partitioned (more or less).
> 
> ``More trouble than its worth'' was the general conclusion.
> 
> For mips, note that you want an r4k or better; even then,
> IIRC, the per-process other-endian bit got dropped in mips32/mips64.
> (cgd? anyone else know for sure?)