Re: [GXemul-users] [GXemul] - Small question
Status: Alpha
Brought to you by:
gavare
From: Anders G. <ga...@gm...> - 2008-04-22 16:57:04
|
Hi Bemipefe, On Tue, 2008-04-22 at 12:00 +0200, Bemipefe wrote: > Hi anders! > > I send this email directly to you becouse i can't find the "gxemul" > mailing list address. The mailing lists are located at SourceForge: http://sourceforge.net/mail/?group_id=191414 I'm copying this to the gxemul-users list; I hope this is ok with you. > I'm play with your emulator (i would compliment for this good program) > for testing mipsel programs that are compiled with > ELDK tool kit by DENK (it's compiled and easy to install ) > > http://www.denx.de/wiki/DULG/ELDK I am not familiar with ELDK, but I'll try to answer in general terms. > When i compile the simple hello word: > > ---------------------------------------------------------------- > int main() > { > printf("hello world\n"); > return 0; > } > > ---------------------------------------------------------------- > > with this command: > > mips_4KCle-gcc -EL -static -mbranch-likely -march=mips32 -msoft-float > -msingle-float -mno-mad -mno-abicalls -Xlinker -T -Xlinker > $(pwd)/ldscript/elf32custom.xbn hello.c -o test.run You are linking the Hello World program into a static executable, for some operating system and/or target host environment... > and play it with: > > gxemul -V -T -e 3max test.run ... and this starts the DECstation emulation mode of GXemul, and launches test.run as if it was a DECstation operating system kernel. It most likely is not. (Typically, when using the -e 3max option, you would launch a NetBSD or Linux kernel.) > the program start and run but when i receive this message: > > GXemul> > 80037dfc: 0000000c syscall > [ exception SYS v0=4122 a0=0xa0007d30 a1=0xa0007f0c a2=0xa0007f04 > a3=0x800307d0 pc=0x80037dfc <uname+0x10> ] > > > the program break. This is because your hello world program tried to issue a system call, and no syscall handler was installed. If test.run had been an operating system kernel, one of the first things it had set up would have been trap handlers. You probably want to do one of the following three things. Number 1 and 2 are mostly to get a feel of how GXemul works, and number 3 has more to do with your specific question... 1) Compile and run the Hello World program included in GXemul: http://gavare.se/gxemul/gxemul-stable/doc/experiments.html#hello 2) Run a plain Hello World. In this case, you need to run it inside an OS. You can't use printf() on bare hardware. For example, install NetBSD/pmax: http://gavare.se/gxemul/gxemul-stable/doc/guestoses.html#netbsdpmaxinstall and then inside NetBSD/pmax compile your hello world using a simple cc hello.c -o hello and run it. 3) To run the test.run binary you produced above, you need to find out what kind of binary this is (is it a kernel? or a firmware image? or a userland binary?) and for which host platform (DECstations are different from SGI machines, which are different from Playstation2, etc). Hope this helps. Anders |