qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Add MIPS ELF loader


From: Alexander Voropay
Subject: Re: [Qemu-devel] [PATCH] Add MIPS ELF loader
Date: Sun, 2 Apr 2006 16:54:34 +0400

"Dirk Behme" <address@hidden> wrote:
See a http://pastebin.com/628591
Sorry, does this link really work? I get a nearly empty page  for this.

Ah, pastebin keeps data only a day.

I'm working on something similiar, if you want to call an embedded bootloader like uboot a BIOS ;) Anyway, I need to execute mips assembly starting from 0xbfc00000 as well.

I'm trying to port a mmon:
http://www.brouhaha.com/~eric/software/mmon/
It's fairly simply MIPS monitor which requires only ~200 bytes
and a working 16c550 UART.

I think it should be possible to switch to 0xbfc00000 by adjusting the addresses in
hw/mips_r4k.c

Things are more complicated. There should be two mode for the MIPS
emulator : to run MIPS BIOS/Monitor after a "full hardwere reset" and
to run a Linux kernel with "pre-initialized hardware".
MIPS Monitor should run in the BEV mode (Boot Exception Vector)
to use vectors like 0xbfc00380 while Linux should use 0x80000380.
This state is controlled under the SR[BEV] CP0 register.
GXEmul has a special -Q swith to run MIPS emulation in the BEV mode.

There is another bug : for unknown reason, Qemu start BIOS execution
from the 0xbfc00004, not from the first address, see a hw/mips_r4k.c:221
I've just changet it to the 0xbfc00000

In the current Qemu-CVS it is possible fo pass a control to the BIOS region
0xbfc00000. Just omit a "-kernel" option and use a dummy MIPS ELF
file as a parameter. This file may contain just a series of zeros (NOPs).
Qemu will start execution of the binary 'mips_bios.bin' at the 0xbfc00000
(except 0xbfc00004 bug).

Try to change the following lines in hw/mips_r4k.c:
cpu_register_physical_memory(0x1fc00000, ram_size, IO_MEM_RAM);

This already done in the CVS hw/mips_r4k.c:215

Look at the my mmon-qemu port:
http://www.nwpi.ru/~alec/mips/mmon-quemu-0.5.tgz
It uses a dummy 'reset' ELF file to run a mips_bios.bin .

You could find my qemu.log there:
http://www.nwpi.ru/~alec/mips/qemu_log.txt
It goes into infinity exception loop. The command string was
$ qemu-system-mips -d out_asm,in_asm,op,int,exec,cpu -m 16 -nographic reset
The mips_bios.bin is a my port of 'mmon'.


P.S. JFYI: A good explanation of the MIPS reset:
http://www.amd.com/files/connectivitysolutions/aufamily/au1000/Au1000Reset_rev1.2.pdf

--
-=AV=-




reply via email to

[Prev in Thread] Current Thread [Next in Thread]