Subject: Re: [RFC] Running reverse-endian binaries
To: Michael Graff <explorer@flame.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 01/02/2003 10:31:41
On 26 Dec 2002, Michael Graff wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> This sounds like a Bad Idea.  Sorry.  :)
>
> Wouldn't you have to runtime choose which htonl() and so on to run?
> Remember that it's not just for kernel stuff, it's also for on-disk
> and in-packet data.

I don't think so. Code would be compiled for either big or little endian,
and you make the decision then. The kernel would come along later and just
make sure to run the code with the CPU set to the right mode.

> I don't see a straight-forward way of doing that which won't kill
> performance, cause major issues with nightmare-like hacks, or both.

Yes, the kernel/userland boundry would become even more expensive. But we
should be able to hide everything in the emulation layer.

Take care,

Bill