Subject: Re: [RFC] Running reverse-endian binaries
To: Emmanuel Dreyfus <manu@netbsd.org>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: tech-kern
Date: 12/26/2002 13:49:06
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).

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?)