Hi Ali, I finally made things work :-)
I tried ELDK-5 but I was not able to compile to little endian (maybe there is somehow, but I got upset trying). So I tried ELDK version 4.1, since it has specific archs for big endian or little endian (mips_4KCle for little), and it all worked fine, I could successfully run a simple hello program on gem5. Please check instructions for 4.1 version at: http://ftp.denx.de/pub/eldk/4.1/mips-linux-x86/distribution/#Section_1.5. I need to tell you that I have tried all kinds of toolchains, and none have worked. I guess it has something to do with kernel version being >= 2.6, not with mips1 or mips32 arch. Please see below what I got from different toolchains. The main difference between working and not working toolchain seems to be kernel version 2.4 versus 2.6.... Using crosstool-ng (didn't work): hello: ELF 32-bit LSB executable, MIPS, MIPS-I version 1 (SYSV), statically linked, for GNU/Linux 2.6.31, with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x3040000, not stripped toolchain from mips.org (didn't work): hello: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, statically linked, for GNU/Linux 2.6.32, with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x1040000, not stripped Hello precompiled from gem5 (work): /home/fernanda/opt/gem5/tests/test-progs/hello/bin/mips/linux/hello: ELF 32-bit LSB executable, MIPS, MIPS-I version 1 (SYSV), statically linked, for GNU/Linux 2.4.3, not stripped Using ELDK version 4.1 (work): hello: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), statically linked, for GNU/Linux 2.4.3, not stripped If someone has some explanation about it, I would appreciate. I use CodeSourcery to compile code for ARM and run at GEM5 with no problem. Ali, thank you very much for your advice, it saved me a lot of time. Thanks, Fernanda. > Message: 2 > Date: Sat, 9 Feb 2013 18:33:23 -0700 > From: ali bagherian <[email protected]> > To: gem5 users mailing list <[email protected]> > Subject: Re: [gem5-users] Compiling codes for MIPS > Message-ID: > <CA+nBaCE=JiiG968pEcDDtiM_qnzivA4fDNeU0vdH-mrc=59...@mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi, > > You can use 'file hello' command and you will see that the original hello > program is elf file MIPS1 but when you are recompiling it by CodeSourcery > it willbe MIPS32. actually Gem5 is not supporting MIPS32. You can use some > flags for CodeSourcery to set for compiling in MIPS1 but actually the flags > are not working. You have to look for others cross compiler. I had this > problem with PowerPC and MIPS. I found a cross compiler for POWERPC that > work perfectly with GEMS. This site has cross compiler for MIPS too. Maybe > it work with MIPS. PLease check this site ( > http://www.denx.de/wiki/ELDK-5/WebHome). Let me know you could solve the > problem for MIPS or not. definitely I need to solve the problem for MIPS > too. > > Thanks, > Ali > > On Sat, Feb 9, 2013 at 3:55 PM, Fernanda <[email protected]> wrote: > > > > > ali bagherian <alibghrn <at> gmail.com> writes: > > > > > > > > > > > Hi, > > > > > > I used MIPS cross compilers from CodeSourcery to recompile the Hello.c > > sample > > for MIPS. it could compile it without any error but when I tried to run > > it, It > > does not run properly. I could run it properly before I compile it . > > > > > > I used following command to compile it : > > > > > > mips-linux-gnu-gcc -EL -g hello.c -o hello -static > > > > > > > > > I used following command to run it: > > > > > > build/MIPS/gem5.opt configs/example/se.py -c tests/test- > > progs/hello/bin/mips/linux/hello > > > > > > > > > This is the output after runing compiled program > > > > > > > > > > > > Global frequency set at 1000000000000 ticks per second > > > warn: CoherentBus system.membus has no snooping ports attached! > > > 0: system.remote_gdb.listener: listening for remote gdb #0 on port 7000 > > > **** REAL SIMULATION **** > > > info: Entering event queue <at> 0. Starting simulation... > > > info: Increasing stack size by one page. > > > warn: 478500: Halting thread 0 in system.cpu <at> PC 40f2c0, setting > > restart > > PC to 40f2c4 > > > Exiting <at> tick 9223372036854775807 because simulate() limit reached > > > > > > > > > > > > There is no 'Hello world' in output. > > > > > > Thanks, > > > Ali > > > > > > > > > _______________________________________________ > > > gem5-users mailing list > > > gem5-users <at> gem5.org > > > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users > > > > Hi Ali, > > > > The same happened to me when simulating mips. Did you find any solution? I > > am > > stuck to this problem: > > > > Global frequency set at 1000000000000 ticks per second > > warn: CoherentBus system.membus has no snooping ports attached! > > 0: system.remote_gdb.listener: listening for remote gdb #0 on port 7000 > > **** REAL SIMULATION **** > > info: Entering event queue @ 0. Starting simulation... > > info: Increasing stack size by one page. > > warn: 584000: Halting thread 0 in system.cpu @ PC 40e144, setting restart > > PC to > > 40e148 > > Exiting @ tick 9223372036854775807 because simulate() limit reached > > > > Thanks. > > Fernanda > > > > > > _______________________________________________ > > gem5-users mailing list > > [email protected] > > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > <http://m5sim.org/cgi-bin/mailman/private/gem5-users/attachments/20130209/e4d2839d/attachment-0001.html> _______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
