QEMU: Difference between revisions

119 bytes added ,  26 days ago
m
Highlighting errors
[unchecked revision][unchecked revision]
m (Fix broken link to qemu documentation)
m (Highlighting errors)
 
(2 intermediate revisions by the same user not shown)
Line 118:
QEMU does not require the use of a configuration script like Bochs. An example usage of QEMU can be seen below:
 
<sourcesyntaxhighlight lang="bash">
qemu-system-i386 \
-accel tcg,thread=single \
Line 129:
-usb \
-vga std
</syntaxhighlight>
</source>
 
When running QEMU on a non-UNIX system, it may be necessary to use the <tt>-L</tt> command-line option to instruct QEMU where to find a BIOS image.
Line 157:
 
It is possible to redirect QEMU's monitor output to stdio using the following command-line option when invoking QEMU:
<sourcesyntaxhighlight lang="bash">
-monitor stdio
</syntaxhighlight>
</source>
 
 
Line 204:
For convenience, it is also possible to create a file containing commands for GDB to automatically execute. GDB will read and execute the contents of a file with the name <tt>.gdbinit</tt> in the current working directory. Alternatively, a different file may be specified by the use the <tt>-command=file</tt> command-line argument. An example file can be seen below:
 
<source!-- lang="gdb" Avoid highlighting errors -->
<syntaxhighlight lang="text">
file <my-kernel-binary>
target remote localhost:1234
Line 210 ⟶ 211:
# Inspect page tables
x /8wg &page_tables_start
</syntaxhighlight>
</source>
 
This will automatically load the kernel binary's symbol file into the debugger and then open the remote connection to QEMU.<br/>
Line 222 ⟶ 223:
 
Some files within the QEMU source code have commented lines of the form:
<sourcesyntaxhighlight lang="c">
// #define DEBUG_*
</syntaxhighlight>
</source>
 
Recompiling QEMU from source with this preprocessor variable defined will cause additional debugging information from the applicable file to be printed to stdout.