Difference between revisions of "QEMU"

From LinuxMIPS
Jump to: navigation, search
(See also)
m (Memory map: grammar check)
Line 8: Line 8:
  
 
=== Memory map ===
 
=== Memory map ===
Qemu is emulating a simply machine with [[Wikipedia:Industry_Standard_Architecture|ISA]]-like bus. ISA IO space mapped to the 0x14000000 (PHYS) and ISA memory at the 0x10000000 (PHYS, 16Mb in size). All peripherial devices are attached to this "bus" with the standard PC ISA addresses.
+
Qemu emulates a simple machine with [[Wikipedia:Industry_Standard_Architecture|ISA]]-like bus. ISA IO space mapped to the 0x14000000 (PHYS) and ISA memory at the 0x10000000 (PHYS, 16Mb in size). All peripherial devices are attached to this "bus" with the standard PC ISA addresses.
  
 
=== Processor ===
 
=== Processor ===

Revision as of 15:14, 14 June 2006

Qemu is a generic open source processor and system emulator. It achieves good performance from using a Just-in-time compilation.

System architecture

This paragraph describes the architecture of the MIPS system that currently is being emulated by Qemu. As Qemu is still very much work in progress this is expected to change.

Firmware

There currently is no firmware for Qemu. This is only a minor problem as unlike on a real system Qemu's virtual hardware is mostly initialized after a reset.

Memory map

Qemu emulates a simple machine with ISA-like bus. ISA IO space mapped to the 0x14000000 (PHYS) and ISA memory at the 0x10000000 (PHYS, 16Mb in size). All peripherial devices are attached to this "bus" with the standard PC ISA addresses.

Processor

Qemu is simulating a 4Kc MIPS32 processor with a 16 entry TLB. Both I-cache and D-cache are 4kB each, 2-way set-associative with 16 bytes per cacheline however the cache effects are not simulated and cacheops are treated as noops. This is a design decission to improve performance over accuracy. No benchmarking has been done however it is expected that the performance of the virtual MIPS system will be comparable to emulation of the other processors.

Qemu's source code can also be configured to be built with support for a 4Km processor. However being TLB-less this processor is not of interest for Linux, so does not currently receive any sort of attention.

Interrupt controller

Qemu is emulating the standard builtin interrrupt controller including soft interrupts and the count/compare interrupt of R4000-class processors. Cascaded externally to that is a i8259 PIC interrupt controller that is cascaded to the CPU's INT0.

Timer

In addition to the CPU builtin timer Linux support the i8254 PIT (Programmable Interval Timer) which is cascaded to the PIC's interrupt 0 input.

Graphics card

Qemu is emulating a standard VGA graphics card however underlined, bold and blinking attributes are not supported.

Serial interface

Qemu is emulating a PC-style 8250-based serial interface.

Network interface

Qemu is emulating a single ISA NE2000 network card.

Other peripherals

Qemu supports other peripherals however support for them has not been integrated or tested into the MIPS port.

Status

At this time the MIPS support still is in alpha stage. There is no firmware for Qemu yet, you will need Qemu 0.8.1 to run a userland on top of a MIPS kernel. Qemu currently doesn't emulate any existing MIPS system. The Linux kernel has a special configuration to support the Qemu platform, no additional patches are needed.

Common Problems

MIPS BIOS not found on startup

[ralf@box qemu]$ qemu-system-mips -kernel /tftboot/192.168.0.1/vmlinux.bin -m 16 -nographic
(qemu) mips_r4k_init: start
mips_r4k_init: load BIOS '/usr/local/share/qemu/mips_bios.bin' size 131072
qemu: could not load MIPS bios '/usr/local/share/qemu/mips_bios.bin'
[ralf@box qemu]$

There currently is no MIPS BIOS file for Qemu. However if passed a -kernel argument qemu will not call the firmware at all, so this does no harm at all. Therefore, a command such as

dd if=/dev/zero of=/usr/local/share/qemu/mips_bios.bin bs=1024 count=128

will generate a firmware file that will do the job for now.

Since Qemu 0.8.1 this workaround is obsolete, a missing BIOS file triggers only a warning message.

MIPS HOST SUPPORT

In 2004, I successfully compiled QEMU on a SGI machine, using a patch found here:

http://libvncserver.sourceforge.net/qemu/

http://libvncserver.sourceforge.net/qemu/qemu-irix.patch.gz

I hope this patch could merge into the new qemu release. Thanks! -- Tinybit <tinybit at tom dot com>

See also

Credits

Originally authored by French wizzard Fabrice Bellard, Jocelyn Mayer did add support for MIPS as a target, others are now trying to complete the project.