47 |
|
|
48 |
@item Self-modifying code support. |
@item Self-modifying code support. |
49 |
|
|
50 |
@item Precise exception support. |
@item Precise exceptions support. |
51 |
|
|
52 |
@item The virtual CPU is a library (@code{libqemu}) which can be used |
@item The virtual CPU is a library (@code{libqemu}) which can be used |
53 |
in other projects. |
in other projects. |
128 |
|
|
129 |
@end itemize |
@end itemize |
130 |
|
|
131 |
@chapter QEMU User space emulation invocation |
@chapter QEMU User space emulator invocation |
132 |
|
|
133 |
@section Quick Start |
@section Quick Start |
134 |
|
|
315 |
Then you can play with the kernel inside the virtual serial console. You |
Then you can play with the kernel inside the virtual serial console. You |
316 |
can launch @code{ls} for example. Type @key{Ctrl-a h} to have an help |
can launch @code{ls} for example. Type @key{Ctrl-a h} to have an help |
317 |
about the keys you can type inside the virtual serial console. In |
about the keys you can type inside the virtual serial console. In |
318 |
particular @key{Ctrl-a b} is the Magic SysRq key. |
particular, use @key{Ctrl-a x} to exit QEMU and use @key{Ctrl-a b} as |
319 |
|
the Magic SysRq key. |
320 |
|
|
321 |
@item |
@item |
322 |
If the network is enabled, launch the script @file{/etc/linuxrc} in the |
If the network is enabled, launch the script @file{/etc/linuxrc} in the |
335 |
|
|
336 |
@end enumerate |
@end enumerate |
337 |
|
|
338 |
NOTE: the example initrd is a modified version of the one made by Kevin |
NOTES: |
339 |
|
@enumerate |
340 |
|
@item |
341 |
|
A 2.5.66 kernel is also included in the vl-test archive. Just |
342 |
|
replace the bzImage in vl.sh to try it. |
343 |
|
|
344 |
|
@item |
345 |
|
vl creates a temporary file in @var{$VLTMPDIR} (@file{/tmp} is the |
346 |
|
default) containing all the simulated PC memory. If possible, try to use |
347 |
|
a temporary directory using the tmpfs filesystem to avoid too many |
348 |
|
unnecessary disk accesses. |
349 |
|
|
350 |
|
@item |
351 |
|
The example initrd is a modified version of the one made by Kevin |
352 |
Lawton for the plex86 Project (@url{www.plex86.org}). |
Lawton for the plex86 Project (@url{www.plex86.org}). |
353 |
|
|
354 |
|
@end enumerate |
355 |
|
|
356 |
@section Kernel Compilation |
@section Kernel Compilation |
357 |
|
|
358 |
You can use any Linux kernel within QEMU provided it is mapped at |
You can use any Linux kernel within QEMU provided it is mapped at |
388 |
exactly the same kernel as you would boot on your PC (in |
exactly the same kernel as you would boot on your PC (in |
389 |
@file{arch/i386/boot/bzImage}). |
@file{arch/i386/boot/bzImage}). |
390 |
|
|
391 |
|
If you are not using a 2.5 kernel as host kernel but if you use a target |
392 |
|
2.5 kernel, you must also ensure that the 'HZ' define is set to 100 |
393 |
|
(1000 is the default) as QEMU cannot currently emulate timers at |
394 |
|
frequencies greater than 100 Hz on host Linux systems < 2.5. In |
395 |
|
asm/param.h, replace: |
396 |
|
|
397 |
|
@example |
398 |
|
# define HZ 1000 /* Internal kernel timer frequency */ |
399 |
|
@end example |
400 |
|
by |
401 |
|
@example |
402 |
|
# define HZ 100 /* Internal kernel timer frequency */ |
403 |
|
@end example |
404 |
|
|
405 |
@section PC Emulation |
@section PC Emulation |
406 |
|
|
407 |
QEMU emulates the following PC peripherials: |
QEMU emulates the following PC peripherials: |
418 |
@item |
@item |
419 |
NE2000 network adapter (port=0x300, irq=9) |
NE2000 network adapter (port=0x300, irq=9) |
420 |
@item |
@item |
421 |
Dumb VGA (to print the @code{uncompressing Linux kernel} message) |
Dumb VGA (to print the @code{Uncompressing Linux} message) |
422 |
@end itemize |
@end itemize |
423 |
|
|
424 |
@chapter QEMU Internals |
@chapter QEMU Internals |
435 |
translation. Valgrind is mainly a memory debugger while QEMU has no |
translation. Valgrind is mainly a memory debugger while QEMU has no |
436 |
support for it (QEMU could be used to detect out of bound memory |
support for it (QEMU could be used to detect out of bound memory |
437 |
accesses as Valgrind, but it has no support to track uninitialised data |
accesses as Valgrind, but it has no support to track uninitialised data |
438 |
as Valgrind does). Valgrind dynamic translator generates better code |
as Valgrind does). The Valgrind dynamic translator generates better code |
439 |
than QEMU (in particular it does register allocation) but it is closely |
than QEMU (in particular it does register allocation) but it is closely |
440 |
tied to an x86 host and target and has no support for precise exception |
tied to an x86 host and target and has no support for precise exceptions |
441 |
and system emulation. |
and system emulation. |
442 |
|
|
443 |
EM86 [4] is the closest project to user space QEMU (and QEMU still uses |
EM86 [4] is the closest project to user space QEMU (and QEMU still uses |
463 |
launch the same kernel on your PC), but the patches are really small. As |
launch the same kernel on your PC), but the patches are really small. As |
464 |
it is a PC virtualizer (no emulation is done except for some priveledged |
it is a PC virtualizer (no emulation is done except for some priveledged |
465 |
instructions), it has the potential of being faster than QEMU. The |
instructions), it has the potential of being faster than QEMU. The |
466 |
downside is that a complicated (and potentially unsafe) kernel patch is |
downside is that a complicated (and potentially unsafe) host kernel |
467 |
needed. |
patch is needed. |
468 |
|
|
469 |
@section Portable dynamic translation |
@section Portable dynamic translation |
470 |
|
|