Forums

Testing little/big endian issues on an Intel PC

Started by Sachin Garg July 27, 2007
I need to test code for some compression algorithms for any possible
little/big endian issues that I might have left in there.

As development was done on an Intel desktop, what is the best way to
test it out without having to buy big-endian hardware. Can some
emulator etc be used for this?

The code is fairly portable (basic C++, mostly maths, and some file
reading/writing) and can be built on any decent compiler/platform.

Sachin Garg

Sachin Garg wrote:
> I need to test code for some compression algorithms for any possible > little/big endian issues that I might have left in there. > > As development was done on an Intel desktop, what is the best way to > test it out without having to buy big-endian hardware. Can some > emulator etc be used for this? > > The code is fairly portable (basic C++, mostly maths, and some file > reading/writing) and can be built on any decent compiler/platform. >
Compile/run/test the code on a simulator for a big-endian target like a powerpc. -- Michael N. Moran (h) 770 516 7918 5009 Old Field Ct. (c) 678 521 5460 Kennesaw, GA, USA 30144 http://mnmoran.org "So often times it happens, that we live our lives in chains and we never even know we have the key." "Already Gone" by Jack Tempchin (recorded by The Eagles) The Beatles were wrong: 1 & 1 & 1 is 1
On Jul 28, 6:42 am, "Michael N. Moran" <mnmo...@bellsouth.net> wrote:
> Sachin Garg wrote: > > I need to test code for some compression algorithms for any possible > > little/big endian issues that I might have left in there. > > > As development was done on an Intel desktop, what is the best way to > > test it out without having to buy big-endian hardware. Can some > > emulator etc be used for this? > > > The code is fairly portable (basic C++, mostly maths, and some file > > reading/writing) and can be built on any decent compiler/platform. > > Compile/run/test the code on a simulator for a big-endian > target like a powerpc.
Can you recommend a good (and cheap/free) simulator for this purpose? Sachin Garg
On Jul 28, 3:07 pm, Sachin Garg <schn...@gmail.com> wrote:
> On Jul 28, 6:42 am, "Michael N. Moran" <mnmo...@bellsouth.net> wrote: > > > Sachin Garg wrote: > > > I need to test code for some compression algorithms for any possible > > > little/big endian issues that I might have left in there. > > > > As development was done on an Intel desktop, what is the best way to > > > test it out without having to buy big-endian hardware. Can some > > > emulator etc be used for this? > > > > The code is fairly portable (basic C++, mostly maths, and some file > > > reading/writing) and can be built on any decent compiler/platform. > > > Compile/run/test the code on a simulator for a big-endian > > target like a powerpc. > > Can you recommend a good (and cheap/free) simulator for this purpose?
I did came across 'psim' and it seems to be able to do what I need, I will be trying it out. Will it be a good choice for this purpose or are there other better options? Sachin Garg
Sachin Garg wrote:

> I did came across 'psim' and it seems to be able to do what I need, I > will be trying it out. Will it be a good choice for this purpose or > are there other better options?
Whilst totally over the top, I've run Mac OS X (PPC version) within the PearPC emulator, which was surprisingly quick. You could install the 'xcode' (GCC etc) toolchain and compile and run it with ease. Jonny
Sachin Garg <schngrg@gmail.com> wrote:
> > On Jul 28, 6:42 am, "Michael N. Moran" <mnmo...@bellsouth.net> wrote: >> Sachin Garg wrote: >> > I need to test code for some compression algorithms for any possible >> > little/big endian issues that I might have left in there. >> >> > As development was done on an Intel desktop, what is the best way to >> > test it out without having to buy big-endian hardware. Can some >> > emulator etc be used for this? >> >> > The code is fairly portable (basic C++, mostly maths, and some file >> > reading/writing) and can be built on any decent compiler/platform. >> >> Compile/run/test the code on a simulator for a big-endian >> target like a powerpc. > > Can you recommend a good (and cheap/free) simulator for this purpose?
You might want to take a look at qemu. This is a free (GPL) simulator that does full machine emulation for some platforms, but can also run ELF binaries compiled for various platforms directly from the commandline. It has a builtin debugger stub to connect to with gdb. -- :wq ^X^Cy^K^X^C^C^C^C
On Jul 29, 2:42 am, Jonny Barker <jo...@DELTHISmagicstring.co.uk>
wrote:
> Sachin Garg wrote: > > I did came across 'psim' and it seems to be able to do what I need, I > > will be trying it out. Will it be a good choice for this purpose or > > are there other better options? > > Whilst totally over the top, I've run Mac OS X (PPC version) within the > PearPC emulator, which was surprisingly quick. You could install > the 'xcode' (GCC etc) toolchain and compile and run it with ease.
Thanks, this sounds interesting.
On Jul 29, 3:06 pm, Ico <use...@zeev.nl> wrote:
> Sachin Garg <schn...@gmail.com> wrote: > > > On Jul 28, 6:42 am, "Michael N. Moran" <mnmo...@bellsouth.net> wrote: > >> Sachin Garg wrote: > >> > I need to test code for some compression algorithms for any possible > >> > little/big endian issues that I might have left in there. > > >> > As development was done on an Intel desktop, what is the best way to > >> > test it out without having to buy big-endian hardware. Can some > >> > emulator etc be used for this? > > >> > The code is fairly portable (basic C++, mostly maths, and some file > >> > reading/writing) and can be built on any decent compiler/platform. > > >> Compile/run/test the code on a simulator for a big-endian > >> target like a powerpc. > > > Can you recommend a good (and cheap/free) simulator for this purpose? > > You might want to take a look at qemu. This is a free (GPL) simulator > that does full machine emulation for some platforms, but can also run > ELF binaries compiled for various platforms directly from the > commandline. It has a builtin debugger stub to connect to with gdb.
>From description, it seems to be doing same thing as psim, but this is
more actively maintained. Thanks.