> From arj@cam-orl.co.uk Fri Jul 2 08:23:04 1993
> Return-Path: <arj@cam-orl.co.uk>
> Received: from gossip.pyramid.com by ubitrex.mb.ca (4.1/SMI-4.1)
> id AA23093; Fri, 2 Jul 93 08:22:54 CDT
> Received: from sword.eng.pyramid.com
> by gossip.pyramid.com (5.61/OSx5.1a Pyramid-Internet-Gateway)
> id AA20688; Fri, 2 Jul 93 06:22:11 -0700
> Received: from goss.pyramid.com
> by sword.eng.pyramid.com (5.61/Pyramid_Internal_Configuration)
> id AA17891; Fri, 2 Jul 93 06:21:51 -0700
> Received: from quince.cam-orl.co.uk
> by gossip.pyramid.com (5.61/OSx5.1a Pyramid-Internet-Gateway)
> id AA20677; Fri, 2 Jul 93 06:21:53 -0700
> Date: Fri, 2 Jul 93 14:20 BST
> Tommy Thorn writes:
> > I've just got access to a decstation, and I'm trying to find
> > out how much is missing before a crosscompilation enviroment is
> > a reality.
> I seem to recall that DEC changed the endian-ness of the MIPS on the
> decstations, so as to be more compatible with VAXes. If so, the tools
> will not be compatible with the 'real' MIPs tools.
>
> Andy..
>
The MIPS and SGI boxes configured the MIPs chips for big-endian. DEC
configured the MIPs chips in the DECstations as little-endian, to match
the VAX. Which also matches the PDP-11. It so happens that Intel made
the 8085/8088/80386 little-endian as well. So linux is little-endian,
and we may want to make linux/MIPs little-endian, to reduce portability
problems (file system structures, etc).
Making linux/MIPs little-endian makes cross-compiling from SGI an
interesting configuration problem, but presumably no more difficult
then generating linux/386 code from a SunOS/SPARC environment.
Try this:
/*
* end.c
*
* Test a target processor and compiler
* for size of integers and endian orientation.
*/
#include <stdio.h>
main()
{
long int test_long;
int test_int;
char test_8;
char *ptr_8;
test_long = 0x01020304;
test_int = 0x01020304;
printf("%d bit native integers.\n", sizeof(int) * 8);
if (sizeof(long) == 4) {
ptr_8 = &test_long;
}
if (sizeof(int) == 4) {
ptr_8 = &test_int;
}
test_8 = *ptr_8;
printf("This is a %s-endian machine.\n", test_8 == 1? "big" : "little");
}
________________________________________________________________
Tim Braun |
Ubitrex Corporation | Voice: 204-942-2992 ext 228
1900-155 Carlton St | FAX: 204-942-3001
Winnipeg, Manitoba, Canada R3C 3H8 | Email: tim@ubitrex.mb.ca
|