OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 8:19 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: How to test big-endian code?
PostPosted: Fri May 04, 2018 5:50 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7612
Location: Germany
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...

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: How to test big-endian code?
PostPosted: Fri May 04, 2018 6:40 am 
Offline
Member
Member
User avatar

Joined: Fri Feb 17, 2017 4:01 pm
Posts: 640
Location: Ukraine, Bachmut
I bought for myself iMac g5. openbsd and linux can run on it.
it's even 64 bit. theoretically. with 512MB of RAM. :mrgreen:

_________________
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).


Top
 Profile  
 
 Post subject: Re: How to test big-endian code?
PostPosted: Fri May 04, 2018 6:51 am 
Offline
Member
Member

Joined: Thu Jul 05, 2007 8:58 am
Posts: 223
You could also look into using some ARM based board, as arm still supports both endian conventions.


Top
 Profile  
 
 Post subject: Re: How to test big-endian code?
PostPosted: Fri May 04, 2018 7:06 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7612
Location: Germany
RaspberryPi draws a blank, as does Arduino...

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: How to test big-endian code?
PostPosted: Fri May 04, 2018 8:50 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
How about an old SPARC box from eBay? Buy-it-nows for about £50 in UK. You might strike lucky with an auctioned one.


Top
 Profile  
 
 Post subject: Re: How to test big-endian code?
PostPosted: Fri May 04, 2018 8:59 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
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').

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Top
 Profile  
 
 Post subject: Re: How to test big-endian code?
PostPosted: Fri May 04, 2018 9:18 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
Another possibility here: https://chiefio.wordpress.com/2015/10/1 ... d-endians/


Top
 Profile  
 
 Post subject: Re: How to test big-endian code?
PostPosted: Tue May 08, 2018 12:19 pm 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7612
Location: Germany
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...

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: How to test big-endian code?
PostPosted: Mon Jun 04, 2018 2:22 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7612
Location: Germany
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...)

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group