OSDev.org
https://forum.osdev.org/

How to test big-endian code?
https://forum.osdev.org/viewtopic.php?f=13&t=32915
Page 1 of 1

Author:  Solar [ Fri May 04, 2018 5:50 am ]
Post subject:  How to test big-endian code?

I have a piece of code that does some bit-fiddling, which should work on Little Endian and Big Endian alike.

Unfortunately the company has shut down the last of the AIX boxes (that I had access to), which were my go-to point to test BE code.

So... how do you test big-endian code? Online compilers like ideone.com are all LE. Emulation? Some small board / box that runs a BE Linux? I'd probably even be willing to shell out a couple of bucks if it gave me a big-endian testbed. One I could use to test heavily C++17-ish code...

Author:  zaval [ Fri May 04, 2018 6:40 am ]
Post subject:  Re: How to test big-endian code?

I bought for myself iMac g5. openbsd and linux can run on it.
it's even 64 bit. theoretically. with 512MB of RAM. :mrgreen:

Author:  davidv1992 [ Fri May 04, 2018 6:51 am ]
Post subject:  Re: How to test big-endian code?

You could also look into using some ARM based board, as arm still supports both endian conventions.

Author:  Solar [ Fri May 04, 2018 7:06 am ]
Post subject:  Re: How to test big-endian code?

RaspberryPi draws a blank, as does Arduino...

Author:  iansjack [ Fri May 04, 2018 8:50 am ]
Post subject:  Re: How to test big-endian code?

How about an old SPARC box from eBay? Buy-it-nows for about £50 in UK. You might strike lucky with an auctioned one.

Author:  Schol-R-LEA [ Fri May 04, 2018 8:59 am ]
Post subject:  Re: How to test big-endian code?

I would start by trying it in QEMU emulating MIPS BE (which is actually the default for MIPS on QEMU; the MIPS little-endian emulation is given as 'mipsel' rather than 'mips').

Author:  iansjack [ Fri May 04, 2018 9:18 am ]
Post subject:  Re: How to test big-endian code?

Another possibility here: https://chiefio.wordpress.com/2015/10/1 ... d-endians/

Author:  Solar [ Tue May 08, 2018 12:19 pm ]
Post subject:  Re: How to test big-endian code?

I think I have completed the circle, coming back home.

I installed WinUAE (which, being the owner of a licensed copy of AmigaForever, I have the ROM and OS files for), downloaded the DICE C compiler, and by putting the bit-fiddling stuff into out-of-context C files, am now able to put the Endian-dependent logic to the actual test.

Not quite what I would have preferred, but a workable solution.

And it feels like it was just yesterday, seeing the Amiga Workbench again...

Author:  Solar [ Mon Jun 04, 2018 2:22 am ]
Post subject:  Re: How to test big-endian code?

Actually a good friend of mine happened to have an A3000 in his garage, complete with a SCSI hard drive. (The A3000 being the only Amiga that ever came with a MMU out-of-the-box -- you need the MMU to run a Unix on it.) The beauty is now sitting in my room, pending a test run after almost two decades of inactivity.

If it doesn't work out, the UAE / C solution is good enough for me.

(Auctioned Amigas are anything but cheap. The nostalgics associated with the platform, combined with the scarcity of late-era hardware, made prices go up instead of down over time...)

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/