linux-mips-fnet
[Top] [All Lists]

Re: BE/LE (Was Re: m700-10 success)

To: linux-mips@fnet.fr
Subject: Re: BE/LE (Was Re: m700-10 success)
From: Dominic Sweetman <dom@algor.co.uk>
Date: Fri, 10 May 96 12:05:04 +0100
In-reply-to: <199605091901.VAA31481@pallas.spacetec.no>
References: <dom@algor.co.uk> <199605091901.VAA31481@pallas.spacetec.no>
> On May 9, 21:34, Dom Sweetman wrote:
> >o Workstations/computers from SGI and their "friends" Pyramid and
> >  Siemens-Nixdorf.  All big-endian, probably not adaptable.  SGI's
> >  success means that this is much the largest group of machines.
> 
> I believe Larry McVoy mentioned in passing (on the sparc list) that SGI 
> *could* do LE (or 'that other byte order' as he said :-) if necessary,
> although he certainly didn't mean bi-endian I think.

Yes, Andreas pointed that out too - and now I remember that SGI were
going to provide Windows/NT as an alternative OS, or on really
hallucinated days as a *replacement OS*.

> I have lots of software that I have carefully written (or made sure
> others have written) in a way portable enough to let me compile it
> without problems under Linux.  I nfs-mount the whole disk with
> hundreds of megs of code and start the build, and it works fine.
> The problem comes when I execute the code: I want to share the data
> too, and I can't do that today without writing code to painfully
> byteswap field by field inside all the structs.. and I know this is
> a real pain to do, because I have already written the code for it
> for the (relatively small) part of the data which is sent out of the
> system (must be VAX-readable).

The C standard doesn't allow you to assume that the memory image of
data structures is portable between compilers, let alone between
architectures.  Endianness is one problem - but so are different
numeric representations, size of data types and alignment rules.

For most purposes it's better to export/import data in 'printable
text' forms; but if this is really too slow then there are tools like
Sun's XDR.  [Do you remember XDR, invented somewhere in the early-mid
80's?  it had tools which would auto-generate modules to dump/load
arbitrary C data structures to a file-like stream of bytes.  And it
went with a remote-call thing too.]  

But if the $10M-per-year project which upgrades Word for Windows can't
afford to do anything other than brain-dump binary data, it seems a
bit unkind to expect unpaid volunteers to do so...

Regards,

Dominic Sweetman                phone: +44 171 700 3301
Algorithmics Ltd                home:  +44 171 226 0032
3 Drayton Park                  fax:   +44 171 700 3400
London N5 1NU                   email: dom@algor.co.uk
ENGLAND.                        www:   http://www.algor.co.uk
                                ftp:   ftp.algor.co.uk

<Prev in Thread] Current Thread [Next in Thread>