Statistics
| Branch: | Revision:

root / qemu-doc.texi @ f8bfb1dc

History | View | Annotate | Download (66.2 kB)

1 386405f7 bellard
\input texinfo @c -*- texinfo -*-
2 debc7065 bellard
@c %**start of header
3 debc7065 bellard
@setfilename qemu-doc.info
4 8f40c388 bellard
@settitle QEMU Emulator User Documentation
5 debc7065 bellard
@exampleindent 0
6 debc7065 bellard
@paragraphindent 0
7 debc7065 bellard
@c %**end of header
8 386405f7 bellard
9 0806e3f6 bellard
@iftex
10 386405f7 bellard
@titlepage
11 386405f7 bellard
@sp 7
12 8f40c388 bellard
@center @titlefont{QEMU Emulator}
13 debc7065 bellard
@sp 1
14 debc7065 bellard
@center @titlefont{User Documentation}
15 386405f7 bellard
@sp 3
16 386405f7 bellard
@end titlepage
17 0806e3f6 bellard
@end iftex
18 386405f7 bellard
19 debc7065 bellard
@ifnottex
20 debc7065 bellard
@node Top
21 debc7065 bellard
@top
22 debc7065 bellard
23 debc7065 bellard
@menu
24 debc7065 bellard
* Introduction::
25 debc7065 bellard
* Installation::
26 debc7065 bellard
* QEMU PC System emulator::
27 debc7065 bellard
* QEMU System emulator for non PC targets::
28 83195237 bellard
* QEMU User space emulator::
29 debc7065 bellard
* compilation:: Compilation from the sources
30 debc7065 bellard
* Index::
31 debc7065 bellard
@end menu
32 debc7065 bellard
@end ifnottex
33 debc7065 bellard
34 debc7065 bellard
@contents
35 debc7065 bellard
36 debc7065 bellard
@node Introduction
37 386405f7 bellard
@chapter Introduction
38 386405f7 bellard
39 debc7065 bellard
@menu
40 debc7065 bellard
* intro_features:: Features
41 debc7065 bellard
@end menu
42 debc7065 bellard
43 debc7065 bellard
@node intro_features
44 322d0c66 bellard
@section Features
45 386405f7 bellard
46 1f673135 bellard
QEMU is a FAST! processor emulator using dynamic translation to
47 1f673135 bellard
achieve good emulation speed.
48 1eb20527 bellard
49 1eb20527 bellard
QEMU has two operating modes:
50 0806e3f6 bellard
51 0806e3f6 bellard
@itemize @minus
52 0806e3f6 bellard
53 5fafdf24 ths
@item
54 1f673135 bellard
Full system emulation. In this mode, QEMU emulates a full system (for
55 3f9f3aa1 bellard
example a PC), including one or several processors and various
56 3f9f3aa1 bellard
peripherals. It can be used to launch different Operating Systems
57 3f9f3aa1 bellard
without rebooting the PC or to debug system code.
58 1eb20527 bellard
59 5fafdf24 ths
@item
60 83195237 bellard
User mode emulation. In this mode, QEMU can launch
61 83195237 bellard
processes compiled for one CPU on another CPU. It can be used to
62 1f673135 bellard
launch the Wine Windows API emulator (@url{http://www.winehq.org}) or
63 1f673135 bellard
to ease cross-compilation and cross-debugging.
64 1eb20527 bellard
65 1eb20527 bellard
@end itemize
66 1eb20527 bellard
67 7c3fc84d bellard
QEMU can run without an host kernel driver and yet gives acceptable
68 5fafdf24 ths
performance.
69 322d0c66 bellard
70 52c00a5f bellard
For system emulation, the following hardware targets are supported:
71 52c00a5f bellard
@itemize
72 9d0a8e6f bellard
@item PC (x86 or x86_64 processor)
73 3f9f3aa1 bellard
@item ISA PC (old style PC without PCI bus)
74 52c00a5f bellard
@item PREP (PowerPC processor)
75 d45952a0 aurel32
@item G3 Beige PowerMac (PowerPC processor)
76 9d0a8e6f bellard
@item Mac99 PowerMac (PowerPC processor, in progress)
77 ee76f82e blueswir1
@item Sun4m/Sun4c/Sun4d (32-bit Sparc processor)
78 c7ba218d blueswir1
@item Sun4u/Sun4v (64-bit Sparc processor, in progress)
79 d9aedc32 ths
@item Malta board (32-bit and 64-bit MIPS processors)
80 88cb0a02 aurel32
@item MIPS Magnum (64-bit MIPS processor)
81 9ee6e8bb pbrook
@item ARM Integrator/CP (ARM)
82 9ee6e8bb pbrook
@item ARM Versatile baseboard (ARM)
83 9ee6e8bb pbrook
@item ARM RealView Emulation baseboard (ARM)
84 ef4c3856 balrog
@item Spitz, Akita, Borzoi, Terrier and Tosa PDAs (PXA270 processor)
85 9ee6e8bb pbrook
@item Luminary Micro LM3S811EVB (ARM Cortex-M3)
86 9ee6e8bb pbrook
@item Luminary Micro LM3S6965EVB (ARM Cortex-M3)
87 707e011b pbrook
@item Freescale MCF5208EVB (ColdFire V2).
88 209a4e69 pbrook
@item Arnewsh MCF5206 evaluation board (ColdFire V2).
89 02645926 balrog
@item Palm Tungsten|E PDA (OMAP310 processor)
90 c30bb264 balrog
@item N800 and N810 tablets (OMAP2420 processor)
91 57cd6e97 balrog
@item MusicPal (MV88W8618 ARM processor)
92 ef4c3856 balrog
@item Gumstix "Connex" and "Verdex" motherboards (PXA255/270).
93 ef4c3856 balrog
@item Siemens SX1 smartphone (OMAP310 processor)
94 4af39611 Paul Brook
@item Syborg SVP base model (ARM Cortex-A8).
95 48c50a62 Edgar E. Iglesias
@item AXIS-Devboard88 (CRISv32 ETRAX-FS).
96 48c50a62 Edgar E. Iglesias
@item Petalogix Spartan 3aDSP1800 MMU ref design (MicroBlaze).
97 52c00a5f bellard
@end itemize
98 386405f7 bellard
99 48c50a62 Edgar E. Iglesias
For user emulation, x86, PowerPC, ARM, 32-bit MIPS, Sparc32/64, ColdFire(m68k), CRISv32 and MicroBlaze CPUs are supported.
100 0806e3f6 bellard
101 debc7065 bellard
@node Installation
102 5b9f457a bellard
@chapter Installation
103 5b9f457a bellard
104 15a34c63 bellard
If you want to compile QEMU yourself, see @ref{compilation}.
105 15a34c63 bellard
106 debc7065 bellard
@menu
107 debc7065 bellard
* install_linux::   Linux
108 debc7065 bellard
* install_windows:: Windows
109 debc7065 bellard
* install_mac::     Macintosh
110 debc7065 bellard
@end menu
111 debc7065 bellard
112 debc7065 bellard
@node install_linux
113 1f673135 bellard
@section Linux
114 1f673135 bellard
115 7c3fc84d bellard
If a precompiled package is available for your distribution - you just
116 7c3fc84d bellard
have to install it. Otherwise, see @ref{compilation}.
117 5b9f457a bellard
118 debc7065 bellard
@node install_windows
119 1f673135 bellard
@section Windows
120 8cd0ac2f bellard
121 15a34c63 bellard
Download the experimental binary installer at
122 debc7065 bellard
@url{http://www.free.oszoo.org/@/download.html}.
123 d691f669 bellard
124 debc7065 bellard
@node install_mac
125 1f673135 bellard
@section Mac OS X
126 d691f669 bellard
127 15a34c63 bellard
Download the experimental binary installer at
128 debc7065 bellard
@url{http://www.free.oszoo.org/@/download.html}.
129 df0f11a0 bellard
130 debc7065 bellard
@node QEMU PC System emulator
131 3f9f3aa1 bellard
@chapter QEMU PC System emulator
132 1eb20527 bellard
133 debc7065 bellard
@menu
134 debc7065 bellard
* pcsys_introduction:: Introduction
135 debc7065 bellard
* pcsys_quickstart::   Quick Start
136 debc7065 bellard
* sec_invocation::     Invocation
137 debc7065 bellard
* pcsys_keys::         Keys
138 debc7065 bellard
* pcsys_monitor::      QEMU Monitor
139 debc7065 bellard
* disk_images::        Disk Images
140 debc7065 bellard
* pcsys_network::      Network emulation
141 debc7065 bellard
* direct_linux_boot::  Direct Linux Boot
142 debc7065 bellard
* pcsys_usb::          USB emulation
143 f858dcae ths
* vnc_security::       VNC security
144 debc7065 bellard
* gdb_usage::          GDB usage
145 debc7065 bellard
* pcsys_os_specific::  Target OS specific information
146 debc7065 bellard
@end menu
147 debc7065 bellard
148 debc7065 bellard
@node pcsys_introduction
149 0806e3f6 bellard
@section Introduction
150 0806e3f6 bellard
151 0806e3f6 bellard
@c man begin DESCRIPTION
152 0806e3f6 bellard
153 3f9f3aa1 bellard
The QEMU PC System emulator simulates the
154 3f9f3aa1 bellard
following peripherals:
155 0806e3f6 bellard
156 0806e3f6 bellard
@itemize @minus
157 5fafdf24 ths
@item
158 15a34c63 bellard
i440FX host PCI bridge and PIIX3 PCI to ISA bridge
159 0806e3f6 bellard
@item
160 15a34c63 bellard
Cirrus CLGD 5446 PCI VGA card or dummy VGA card with Bochs VESA
161 15a34c63 bellard
extensions (hardware level, including all non standard modes).
162 0806e3f6 bellard
@item
163 0806e3f6 bellard
PS/2 mouse and keyboard
164 5fafdf24 ths
@item
165 15a34c63 bellard
2 PCI IDE interfaces with hard disk and CD-ROM support
166 1f673135 bellard
@item
167 1f673135 bellard
Floppy disk
168 5fafdf24 ths
@item
169 3a2eeac0 Stefan Weil
PCI and ISA network adapters
170 0806e3f6 bellard
@item
171 05d5818c bellard
Serial ports
172 05d5818c bellard
@item
173 c0fe3827 bellard
Creative SoundBlaster 16 sound card
174 c0fe3827 bellard
@item
175 c0fe3827 bellard
ENSONIQ AudioPCI ES1370 sound card
176 c0fe3827 bellard
@item
177 e5c9a13e balrog
Intel 82801AA AC97 Audio compatible sound card
178 e5c9a13e balrog
@item
179 c0fe3827 bellard
Adlib(OPL2) - Yamaha YM3812 compatible chip
180 b389dbfb bellard
@item
181 26463dbc balrog
Gravis Ultrasound GF1 sound card
182 26463dbc balrog
@item
183 cc53d26d malc
CS4231A compatible sound card
184 cc53d26d malc
@item
185 b389dbfb bellard
PCI UHCI USB controller and a virtual USB hub.
186 0806e3f6 bellard
@end itemize
187 0806e3f6 bellard
188 3f9f3aa1 bellard
SMP is supported with up to 255 CPUs.
189 3f9f3aa1 bellard
190 1d1f8c33 malc
Note that adlib, gus and cs4231a are only available when QEMU was
191 1d1f8c33 malc
configured with --audio-card-list option containing the name(s) of
192 e5178e8d malc
required card(s).
193 c0fe3827 bellard
194 15a34c63 bellard
QEMU uses the PC BIOS from the Bochs project and the Plex86/Bochs LGPL
195 15a34c63 bellard
VGA BIOS.
196 15a34c63 bellard
197 c0fe3827 bellard
QEMU uses YM3812 emulation by Tatsuyuki Satoh.
198 c0fe3827 bellard
199 26463dbc balrog
QEMU uses GUS emulation(GUSEMU32 @url{http://www.deinmeister.de/gusemu/})
200 26463dbc balrog
by Tibor "TS" Sch?tz.
201 423d65f4 balrog
202 cc53d26d malc
CS4231A is the chip used in Windows Sound System and GUSMAX products
203 cc53d26d malc
204 0806e3f6 bellard
@c man end
205 0806e3f6 bellard
206 debc7065 bellard
@node pcsys_quickstart
207 1eb20527 bellard
@section Quick Start
208 1eb20527 bellard
209 285dc330 bellard
Download and uncompress the linux image (@file{linux.img}) and type:
210 0806e3f6 bellard
211 0806e3f6 bellard
@example
212 285dc330 bellard
qemu linux.img
213 0806e3f6 bellard
@end example
214 0806e3f6 bellard
215 0806e3f6 bellard
Linux should boot and give you a prompt.
216 0806e3f6 bellard
217 6cc721cf bellard
@node sec_invocation
218 ec410fc9 bellard
@section Invocation
219 ec410fc9 bellard
220 ec410fc9 bellard
@example
221 0806e3f6 bellard
@c man begin SYNOPSIS
222 89dfe898 ths
usage: qemu [options] [@var{disk_image}]
223 0806e3f6 bellard
@c man end
224 ec410fc9 bellard
@end example
225 ec410fc9 bellard
226 0806e3f6 bellard
@c man begin OPTIONS
227 d2c639d6 blueswir1
@var{disk_image} is a raw hard disk image for IDE hard disk 0. Some
228 d2c639d6 blueswir1
targets do not need a disk image.
229 ec410fc9 bellard
230 5824d651 blueswir1
@include qemu-options.texi
231 ec410fc9 bellard
232 3e11db9a bellard
@c man end
233 3e11db9a bellard
234 debc7065 bellard
@node pcsys_keys
235 3e11db9a bellard
@section Keys
236 3e11db9a bellard
237 3e11db9a bellard
@c man begin OPTIONS
238 3e11db9a bellard
239 a1b74fe8 bellard
During the graphical emulation, you can use the following keys:
240 a1b74fe8 bellard
@table @key
241 f9859310 bellard
@item Ctrl-Alt-f
242 a1b74fe8 bellard
Toggle full screen
243 a0a821a4 bellard
244 f9859310 bellard
@item Ctrl-Alt-n
245 a0a821a4 bellard
Switch to virtual console 'n'. Standard console mappings are:
246 a0a821a4 bellard
@table @emph
247 a0a821a4 bellard
@item 1
248 a0a821a4 bellard
Target system display
249 a0a821a4 bellard
@item 2
250 a0a821a4 bellard
Monitor
251 a0a821a4 bellard
@item 3
252 a0a821a4 bellard
Serial port
253 a1b74fe8 bellard
@end table
254 a1b74fe8 bellard
255 f9859310 bellard
@item Ctrl-Alt
256 a0a821a4 bellard
Toggle mouse and keyboard grab.
257 a0a821a4 bellard
@end table
258 a0a821a4 bellard
259 3e11db9a bellard
In the virtual consoles, you can use @key{Ctrl-Up}, @key{Ctrl-Down},
260 3e11db9a bellard
@key{Ctrl-PageUp} and @key{Ctrl-PageDown} to move in the back log.
261 3e11db9a bellard
262 a0a821a4 bellard
During emulation, if you are using the @option{-nographic} option, use
263 a0a821a4 bellard
@key{Ctrl-a h} to get terminal commands:
264 ec410fc9 bellard
265 ec410fc9 bellard
@table @key
266 a1b74fe8 bellard
@item Ctrl-a h
267 d2c639d6 blueswir1
@item Ctrl-a ?
268 ec410fc9 bellard
Print this help
269 3b46e624 ths
@item Ctrl-a x
270 366dfc52 ths
Exit emulator
271 3b46e624 ths
@item Ctrl-a s
272 1f47a922 bellard
Save disk data back to file (if -snapshot)
273 20d8a3ed ths
@item Ctrl-a t
274 d2c639d6 blueswir1
Toggle console timestamps
275 a1b74fe8 bellard
@item Ctrl-a b
276 1f673135 bellard
Send break (magic sysrq in Linux)
277 a1b74fe8 bellard
@item Ctrl-a c
278 1f673135 bellard
Switch between console and monitor
279 a1b74fe8 bellard
@item Ctrl-a Ctrl-a
280 a1b74fe8 bellard
Send Ctrl-a
281 ec410fc9 bellard
@end table
282 0806e3f6 bellard
@c man end
283 0806e3f6 bellard
284 0806e3f6 bellard
@ignore
285 0806e3f6 bellard
286 1f673135 bellard
@c man begin SEEALSO
287 1f673135 bellard
The HTML documentation of QEMU for more precise information and Linux
288 1f673135 bellard
user mode emulator invocation.
289 1f673135 bellard
@c man end
290 1f673135 bellard
291 1f673135 bellard
@c man begin AUTHOR
292 1f673135 bellard
Fabrice Bellard
293 1f673135 bellard
@c man end
294 1f673135 bellard
295 1f673135 bellard
@end ignore
296 1f673135 bellard
297 debc7065 bellard
@node pcsys_monitor
298 1f673135 bellard
@section QEMU Monitor
299 1f673135 bellard
300 1f673135 bellard
The QEMU monitor is used to give complex commands to the QEMU
301 1f673135 bellard
emulator. You can use it to:
302 1f673135 bellard
303 1f673135 bellard
@itemize @minus
304 1f673135 bellard
305 1f673135 bellard
@item
306 e598752a ths
Remove or insert removable media images
307 89dfe898 ths
(such as CD-ROM or floppies).
308 1f673135 bellard
309 5fafdf24 ths
@item
310 1f673135 bellard
Freeze/unfreeze the Virtual Machine (VM) and save or restore its state
311 1f673135 bellard
from a disk file.
312 1f673135 bellard
313 1f673135 bellard
@item Inspect the VM state without an external debugger.
314 1f673135 bellard
315 1f673135 bellard
@end itemize
316 1f673135 bellard
317 1f673135 bellard
@subsection Commands
318 1f673135 bellard
319 1f673135 bellard
The following commands are available:
320 1f673135 bellard
321 2313086a Blue Swirl
@include qemu-monitor.texi
322 0806e3f6 bellard
323 1f673135 bellard
@subsection Integer expressions
324 1f673135 bellard
325 1f673135 bellard
The monitor understands integers expressions for every integer
326 1f673135 bellard
argument. You can use register names to get the value of specifics
327 1f673135 bellard
CPU registers by prefixing them with @emph{$}.
328 ec410fc9 bellard
329 1f47a922 bellard
@node disk_images
330 1f47a922 bellard
@section Disk Images
331 1f47a922 bellard
332 acd935ef bellard
Since version 0.6.1, QEMU supports many disk image formats, including
333 acd935ef bellard
growable disk images (their size increase as non empty sectors are
334 13a2e80f bellard
written), compressed and encrypted disk images. Version 0.8.3 added
335 13a2e80f bellard
the new qcow2 disk image format which is essential to support VM
336 13a2e80f bellard
snapshots.
337 1f47a922 bellard
338 debc7065 bellard
@menu
339 debc7065 bellard
* disk_images_quickstart::    Quick start for disk image creation
340 debc7065 bellard
* disk_images_snapshot_mode:: Snapshot mode
341 13a2e80f bellard
* vm_snapshots::              VM snapshots
342 debc7065 bellard
* qemu_img_invocation::       qemu-img Invocation
343 975b092b ths
* qemu_nbd_invocation::       qemu-nbd Invocation
344 19cb3738 bellard
* host_drives::               Using host drives
345 debc7065 bellard
* disk_images_fat_images::    Virtual FAT disk images
346 75818250 ths
* disk_images_nbd::           NBD access
347 debc7065 bellard
@end menu
348 debc7065 bellard
349 debc7065 bellard
@node disk_images_quickstart
350 acd935ef bellard
@subsection Quick start for disk image creation
351 acd935ef bellard
352 acd935ef bellard
You can create a disk image with the command:
353 1f47a922 bellard
@example
354 acd935ef bellard
qemu-img create myimage.img mysize
355 1f47a922 bellard
@end example
356 acd935ef bellard
where @var{myimage.img} is the disk image filename and @var{mysize} is its
357 acd935ef bellard
size in kilobytes. You can add an @code{M} suffix to give the size in
358 acd935ef bellard
megabytes and a @code{G} suffix for gigabytes.
359 acd935ef bellard
360 debc7065 bellard
See @ref{qemu_img_invocation} for more information.
361 1f47a922 bellard
362 debc7065 bellard
@node disk_images_snapshot_mode
363 1f47a922 bellard
@subsection Snapshot mode
364 1f47a922 bellard
365 1f47a922 bellard
If you use the option @option{-snapshot}, all disk images are
366 1f47a922 bellard
considered as read only. When sectors in written, they are written in
367 1f47a922 bellard
a temporary file created in @file{/tmp}. You can however force the
368 acd935ef bellard
write back to the raw disk images by using the @code{commit} monitor
369 acd935ef bellard
command (or @key{C-a s} in the serial console).
370 1f47a922 bellard
371 13a2e80f bellard
@node vm_snapshots
372 13a2e80f bellard
@subsection VM snapshots
373 13a2e80f bellard
374 13a2e80f bellard
VM snapshots are snapshots of the complete virtual machine including
375 13a2e80f bellard
CPU state, RAM, device state and the content of all the writable
376 13a2e80f bellard
disks. In order to use VM snapshots, you must have at least one non
377 13a2e80f bellard
removable and writable block device using the @code{qcow2} disk image
378 13a2e80f bellard
format. Normally this device is the first virtual hard drive.
379 13a2e80f bellard
380 13a2e80f bellard
Use the monitor command @code{savevm} to create a new VM snapshot or
381 13a2e80f bellard
replace an existing one. A human readable name can be assigned to each
382 19d36792 bellard
snapshot in addition to its numerical ID.
383 13a2e80f bellard
384 13a2e80f bellard
Use @code{loadvm} to restore a VM snapshot and @code{delvm} to remove
385 13a2e80f bellard
a VM snapshot. @code{info snapshots} lists the available snapshots
386 13a2e80f bellard
with their associated information:
387 13a2e80f bellard
388 13a2e80f bellard
@example
389 13a2e80f bellard
(qemu) info snapshots
390 13a2e80f bellard
Snapshot devices: hda
391 13a2e80f bellard
Snapshot list (from hda):
392 13a2e80f bellard
ID        TAG                 VM SIZE                DATE       VM CLOCK
393 13a2e80f bellard
1         start                   41M 2006-08-06 12:38:02   00:00:14.954
394 13a2e80f bellard
2                                 40M 2006-08-06 12:43:29   00:00:18.633
395 13a2e80f bellard
3         msys                    40M 2006-08-06 12:44:04   00:00:23.514
396 13a2e80f bellard
@end example
397 13a2e80f bellard
398 13a2e80f bellard
A VM snapshot is made of a VM state info (its size is shown in
399 13a2e80f bellard
@code{info snapshots}) and a snapshot of every writable disk image.
400 13a2e80f bellard
The VM state info is stored in the first @code{qcow2} non removable
401 13a2e80f bellard
and writable block device. The disk image snapshots are stored in
402 13a2e80f bellard
every disk image. The size of a snapshot in a disk image is difficult
403 13a2e80f bellard
to evaluate and is not shown by @code{info snapshots} because the
404 13a2e80f bellard
associated disk sectors are shared among all the snapshots to save
405 19d36792 bellard
disk space (otherwise each snapshot would need a full copy of all the
406 19d36792 bellard
disk images).
407 13a2e80f bellard
408 13a2e80f bellard
When using the (unrelated) @code{-snapshot} option
409 13a2e80f bellard
(@ref{disk_images_snapshot_mode}), you can always make VM snapshots,
410 13a2e80f bellard
but they are deleted as soon as you exit QEMU.
411 13a2e80f bellard
412 13a2e80f bellard
VM snapshots currently have the following known limitations:
413 13a2e80f bellard
@itemize
414 5fafdf24 ths
@item
415 13a2e80f bellard
They cannot cope with removable devices if they are removed or
416 13a2e80f bellard
inserted after a snapshot is done.
417 5fafdf24 ths
@item
418 13a2e80f bellard
A few device drivers still have incomplete snapshot support so their
419 13a2e80f bellard
state is not saved or restored properly (in particular USB).
420 13a2e80f bellard
@end itemize
421 13a2e80f bellard
422 acd935ef bellard
@node qemu_img_invocation
423 acd935ef bellard
@subsection @code{qemu-img} Invocation
424 1f47a922 bellard
425 acd935ef bellard
@include qemu-img.texi
426 05efe46e bellard
427 975b092b ths
@node qemu_nbd_invocation
428 975b092b ths
@subsection @code{qemu-nbd} Invocation
429 975b092b ths
430 975b092b ths
@include qemu-nbd.texi
431 975b092b ths
432 19cb3738 bellard
@node host_drives
433 19cb3738 bellard
@subsection Using host drives
434 19cb3738 bellard
435 19cb3738 bellard
In addition to disk image files, QEMU can directly access host
436 19cb3738 bellard
devices. We describe here the usage for QEMU version >= 0.8.3.
437 19cb3738 bellard
438 19cb3738 bellard
@subsubsection Linux
439 19cb3738 bellard
440 19cb3738 bellard
On Linux, you can directly use the host device filename instead of a
441 4be456f1 ths
disk image filename provided you have enough privileges to access
442 19cb3738 bellard
it. For example, use @file{/dev/cdrom} to access to the CDROM or
443 19cb3738 bellard
@file{/dev/fd0} for the floppy.
444 19cb3738 bellard
445 f542086d bellard
@table @code
446 19cb3738 bellard
@item CD
447 19cb3738 bellard
You can specify a CDROM device even if no CDROM is loaded. QEMU has
448 19cb3738 bellard
specific code to detect CDROM insertion or removal. CDROM ejection by
449 19cb3738 bellard
the guest OS is supported. Currently only data CDs are supported.
450 19cb3738 bellard
@item Floppy
451 19cb3738 bellard
You can specify a floppy device even if no floppy is loaded. Floppy
452 19cb3738 bellard
removal is currently not detected accurately (if you change floppy
453 19cb3738 bellard
without doing floppy access while the floppy is not loaded, the guest
454 19cb3738 bellard
OS will think that the same floppy is loaded).
455 19cb3738 bellard
@item Hard disks
456 19cb3738 bellard
Hard disks can be used. Normally you must specify the whole disk
457 19cb3738 bellard
(@file{/dev/hdb} instead of @file{/dev/hdb1}) so that the guest OS can
458 19cb3738 bellard
see it as a partitioned disk. WARNING: unless you know what you do, it
459 19cb3738 bellard
is better to only make READ-ONLY accesses to the hard disk otherwise
460 19cb3738 bellard
you may corrupt your host data (use the @option{-snapshot} command
461 19cb3738 bellard
line option or modify the device permissions accordingly).
462 19cb3738 bellard
@end table
463 19cb3738 bellard
464 19cb3738 bellard
@subsubsection Windows
465 19cb3738 bellard
466 01781963 bellard
@table @code
467 01781963 bellard
@item CD
468 4be456f1 ths
The preferred syntax is the drive letter (e.g. @file{d:}). The
469 01781963 bellard
alternate syntax @file{\\.\d:} is supported. @file{/dev/cdrom} is
470 01781963 bellard
supported as an alias to the first CDROM drive.
471 19cb3738 bellard
472 e598752a ths
Currently there is no specific code to handle removable media, so it
473 19cb3738 bellard
is better to use the @code{change} or @code{eject} monitor commands to
474 19cb3738 bellard
change or eject media.
475 01781963 bellard
@item Hard disks
476 89dfe898 ths
Hard disks can be used with the syntax: @file{\\.\PhysicalDrive@var{N}}
477 01781963 bellard
where @var{N} is the drive number (0 is the first hard disk).
478 01781963 bellard
479 01781963 bellard
WARNING: unless you know what you do, it is better to only make
480 01781963 bellard
READ-ONLY accesses to the hard disk otherwise you may corrupt your
481 01781963 bellard
host data (use the @option{-snapshot} command line so that the
482 01781963 bellard
modifications are written in a temporary file).
483 01781963 bellard
@end table
484 01781963 bellard
485 19cb3738 bellard
486 19cb3738 bellard
@subsubsection Mac OS X
487 19cb3738 bellard
488 5fafdf24 ths
@file{/dev/cdrom} is an alias to the first CDROM.
489 19cb3738 bellard
490 e598752a ths
Currently there is no specific code to handle removable media, so it
491 19cb3738 bellard
is better to use the @code{change} or @code{eject} monitor commands to
492 19cb3738 bellard
change or eject media.
493 19cb3738 bellard
494 debc7065 bellard
@node disk_images_fat_images
495 2c6cadd4 bellard
@subsection Virtual FAT disk images
496 2c6cadd4 bellard
497 2c6cadd4 bellard
QEMU can automatically create a virtual FAT disk image from a
498 2c6cadd4 bellard
directory tree. In order to use it, just type:
499 2c6cadd4 bellard
500 5fafdf24 ths
@example
501 2c6cadd4 bellard
qemu linux.img -hdb fat:/my_directory
502 2c6cadd4 bellard
@end example
503 2c6cadd4 bellard
504 2c6cadd4 bellard
Then you access access to all the files in the @file{/my_directory}
505 2c6cadd4 bellard
directory without having to copy them in a disk image or to export
506 2c6cadd4 bellard
them via SAMBA or NFS. The default access is @emph{read-only}.
507 2c6cadd4 bellard
508 2c6cadd4 bellard
Floppies can be emulated with the @code{:floppy:} option:
509 2c6cadd4 bellard
510 5fafdf24 ths
@example
511 2c6cadd4 bellard
qemu linux.img -fda fat:floppy:/my_directory
512 2c6cadd4 bellard
@end example
513 2c6cadd4 bellard
514 2c6cadd4 bellard
A read/write support is available for testing (beta stage) with the
515 2c6cadd4 bellard
@code{:rw:} option:
516 2c6cadd4 bellard
517 5fafdf24 ths
@example
518 2c6cadd4 bellard
qemu linux.img -fda fat:floppy:rw:/my_directory
519 2c6cadd4 bellard
@end example
520 2c6cadd4 bellard
521 2c6cadd4 bellard
What you should @emph{never} do:
522 2c6cadd4 bellard
@itemize
523 2c6cadd4 bellard
@item use non-ASCII filenames ;
524 2c6cadd4 bellard
@item use "-snapshot" together with ":rw:" ;
525 85b2c688 bellard
@item expect it to work when loadvm'ing ;
526 85b2c688 bellard
@item write to the FAT directory on the host system while accessing it with the guest system.
527 2c6cadd4 bellard
@end itemize
528 2c6cadd4 bellard
529 75818250 ths
@node disk_images_nbd
530 75818250 ths
@subsection NBD access
531 75818250 ths
532 75818250 ths
QEMU can access directly to block device exported using the Network Block Device
533 75818250 ths
protocol.
534 75818250 ths
535 75818250 ths
@example
536 75818250 ths
qemu linux.img -hdb nbd:my_nbd_server.mydomain.org:1024
537 75818250 ths
@end example
538 75818250 ths
539 75818250 ths
If the NBD server is located on the same host, you can use an unix socket instead
540 75818250 ths
of an inet socket:
541 75818250 ths
542 75818250 ths
@example
543 75818250 ths
qemu linux.img -hdb nbd:unix:/tmp/my_socket
544 75818250 ths
@end example
545 75818250 ths
546 75818250 ths
In this case, the block device must be exported using qemu-nbd:
547 75818250 ths
548 75818250 ths
@example
549 75818250 ths
qemu-nbd --socket=/tmp/my_socket my_disk.qcow2
550 75818250 ths
@end example
551 75818250 ths
552 75818250 ths
The use of qemu-nbd allows to share a disk between several guests:
553 75818250 ths
@example
554 75818250 ths
qemu-nbd --socket=/tmp/my_socket --share=2 my_disk.qcow2
555 75818250 ths
@end example
556 75818250 ths
557 75818250 ths
and then you can use it with two guests:
558 75818250 ths
@example
559 75818250 ths
qemu linux1.img -hdb nbd:unix:/tmp/my_socket
560 75818250 ths
qemu linux2.img -hdb nbd:unix:/tmp/my_socket
561 75818250 ths
@end example
562 75818250 ths
563 debc7065 bellard
@node pcsys_network
564 9d4fb82e bellard
@section Network emulation
565 9d4fb82e bellard
566 4be456f1 ths
QEMU can simulate several network cards (PCI or ISA cards on the PC
567 41d03949 bellard
target) and can connect them to an arbitrary number of Virtual Local
568 41d03949 bellard
Area Networks (VLANs). Host TAP devices can be connected to any QEMU
569 41d03949 bellard
VLAN. VLAN can be connected between separate instances of QEMU to
570 4be456f1 ths
simulate large networks. For simpler usage, a non privileged user mode
571 41d03949 bellard
network stack can replace the TAP device to have a basic network
572 41d03949 bellard
connection.
573 41d03949 bellard
574 41d03949 bellard
@subsection VLANs
575 9d4fb82e bellard
576 41d03949 bellard
QEMU simulates several VLANs. A VLAN can be symbolised as a virtual
577 41d03949 bellard
connection between several network devices. These devices can be for
578 41d03949 bellard
example QEMU virtual Ethernet cards or virtual Host ethernet devices
579 41d03949 bellard
(TAP devices).
580 9d4fb82e bellard
581 41d03949 bellard
@subsection Using TAP network interfaces
582 41d03949 bellard
583 41d03949 bellard
This is the standard way to connect QEMU to a real network. QEMU adds
584 41d03949 bellard
a virtual network device on your host (called @code{tapN}), and you
585 41d03949 bellard
can then configure it as if it was a real ethernet card.
586 9d4fb82e bellard
587 8f40c388 bellard
@subsubsection Linux host
588 8f40c388 bellard
589 9d4fb82e bellard
As an example, you can download the @file{linux-test-xxx.tar.gz}
590 9d4fb82e bellard
archive and copy the script @file{qemu-ifup} in @file{/etc} and
591 9d4fb82e bellard
configure properly @code{sudo} so that the command @code{ifconfig}
592 9d4fb82e bellard
contained in @file{qemu-ifup} can be executed as root. You must verify
593 41d03949 bellard
that your host kernel supports the TAP network interfaces: the
594 9d4fb82e bellard
device @file{/dev/net/tun} must be present.
595 9d4fb82e bellard
596 ee0f4751 bellard
See @ref{sec_invocation} to have examples of command lines using the
597 ee0f4751 bellard
TAP network interfaces.
598 9d4fb82e bellard
599 8f40c388 bellard
@subsubsection Windows host
600 8f40c388 bellard
601 8f40c388 bellard
There is a virtual ethernet driver for Windows 2000/XP systems, called
602 8f40c388 bellard
TAP-Win32. But it is not included in standard QEMU for Windows,
603 8f40c388 bellard
so you will need to get it separately. It is part of OpenVPN package,
604 8f40c388 bellard
so download OpenVPN from : @url{http://openvpn.net/}.
605 8f40c388 bellard
606 9d4fb82e bellard
@subsection Using the user mode network stack
607 9d4fb82e bellard
608 41d03949 bellard
By using the option @option{-net user} (default configuration if no
609 41d03949 bellard
@option{-net} option is specified), QEMU uses a completely user mode
610 4be456f1 ths
network stack (you don't need root privilege to use the virtual
611 41d03949 bellard
network). The virtual network configuration is the following:
612 9d4fb82e bellard
613 9d4fb82e bellard
@example
614 9d4fb82e bellard
615 41d03949 bellard
         QEMU VLAN      <------>  Firewall/DHCP server <-----> Internet
616 41d03949 bellard
                           |          (10.0.2.2)
617 9d4fb82e bellard
                           |
618 2518bd0d bellard
                           ---->  DNS server (10.0.2.3)
619 3b46e624 ths
                           |
620 2518bd0d bellard
                           ---->  SMB server (10.0.2.4)
621 9d4fb82e bellard
@end example
622 9d4fb82e bellard
623 9d4fb82e bellard
The QEMU VM behaves as if it was behind a firewall which blocks all
624 9d4fb82e bellard
incoming connections. You can use a DHCP client to automatically
625 41d03949 bellard
configure the network in the QEMU VM. The DHCP server assign addresses
626 41d03949 bellard
to the hosts starting from 10.0.2.15.
627 9d4fb82e bellard
628 9d4fb82e bellard
In order to check that the user mode network is working, you can ping
629 9d4fb82e bellard
the address 10.0.2.2 and verify that you got an address in the range
630 9d4fb82e bellard
10.0.2.x from the QEMU virtual DHCP server.
631 9d4fb82e bellard
632 b415a407 bellard
Note that @code{ping} is not supported reliably to the internet as it
633 4be456f1 ths
would require root privileges. It means you can only ping the local
634 b415a407 bellard
router (10.0.2.2).
635 b415a407 bellard
636 9bf05444 bellard
When using the built-in TFTP server, the router is also the TFTP
637 9bf05444 bellard
server.
638 9bf05444 bellard
639 9bf05444 bellard
When using the @option{-redir} option, TCP or UDP connections can be
640 9bf05444 bellard
redirected from the host to the guest. It allows for example to
641 9bf05444 bellard
redirect X11, telnet or SSH connections.
642 443f1376 bellard
643 41d03949 bellard
@subsection Connecting VLANs between QEMU instances
644 41d03949 bellard
645 41d03949 bellard
Using the @option{-net socket} option, it is possible to make VLANs
646 41d03949 bellard
that span several QEMU instances. See @ref{sec_invocation} to have a
647 41d03949 bellard
basic example.
648 41d03949 bellard
649 9d4fb82e bellard
@node direct_linux_boot
650 9d4fb82e bellard
@section Direct Linux Boot
651 1f673135 bellard
652 1f673135 bellard
This section explains how to launch a Linux kernel inside QEMU without
653 1f673135 bellard
having to make a full bootable image. It is very useful for fast Linux
654 ee0f4751 bellard
kernel testing.
655 1f673135 bellard
656 ee0f4751 bellard
The syntax is:
657 1f673135 bellard
@example
658 ee0f4751 bellard
qemu -kernel arch/i386/boot/bzImage -hda root-2.4.20.img -append "root=/dev/hda"
659 1f673135 bellard
@end example
660 1f673135 bellard
661 ee0f4751 bellard
Use @option{-kernel} to provide the Linux kernel image and
662 ee0f4751 bellard
@option{-append} to give the kernel command line arguments. The
663 ee0f4751 bellard
@option{-initrd} option can be used to provide an INITRD image.
664 1f673135 bellard
665 ee0f4751 bellard
When using the direct Linux boot, a disk image for the first hard disk
666 ee0f4751 bellard
@file{hda} is required because its boot sector is used to launch the
667 ee0f4751 bellard
Linux kernel.
668 1f673135 bellard
669 ee0f4751 bellard
If you do not need graphical output, you can disable it and redirect
670 ee0f4751 bellard
the virtual serial port and the QEMU monitor to the console with the
671 ee0f4751 bellard
@option{-nographic} option. The typical command line is:
672 1f673135 bellard
@example
673 ee0f4751 bellard
qemu -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \
674 ee0f4751 bellard
     -append "root=/dev/hda console=ttyS0" -nographic
675 1f673135 bellard
@end example
676 1f673135 bellard
677 ee0f4751 bellard
Use @key{Ctrl-a c} to switch between the serial console and the
678 ee0f4751 bellard
monitor (@pxref{pcsys_keys}).
679 1f673135 bellard
680 debc7065 bellard
@node pcsys_usb
681 b389dbfb bellard
@section USB emulation
682 b389dbfb bellard
683 0aff66b5 pbrook
QEMU emulates a PCI UHCI USB controller. You can virtually plug
684 0aff66b5 pbrook
virtual USB devices or real host USB devices (experimental, works only
685 0aff66b5 pbrook
on Linux hosts).  Qemu will automatically create and connect virtual USB hubs
686 f542086d bellard
as necessary to connect multiple USB devices.
687 b389dbfb bellard
688 0aff66b5 pbrook
@menu
689 0aff66b5 pbrook
* usb_devices::
690 0aff66b5 pbrook
* host_usb_devices::
691 0aff66b5 pbrook
@end menu
692 0aff66b5 pbrook
@node usb_devices
693 0aff66b5 pbrook
@subsection Connecting USB devices
694 b389dbfb bellard
695 0aff66b5 pbrook
USB devices can be connected with the @option{-usbdevice} commandline option
696 0aff66b5 pbrook
or the @code{usb_add} monitor command.  Available devices are:
697 b389dbfb bellard
698 db380c06 balrog
@table @code
699 db380c06 balrog
@item mouse
700 0aff66b5 pbrook
Virtual Mouse.  This will override the PS/2 mouse emulation when activated.
701 db380c06 balrog
@item tablet
702 c6d46c20 bellard
Pointer device that uses absolute coordinates (like a touchscreen).
703 0aff66b5 pbrook
This means qemu is able to report the mouse position without having
704 0aff66b5 pbrook
to grab the mouse.  Also overrides the PS/2 mouse emulation when activated.
705 db380c06 balrog
@item disk:@var{file}
706 0aff66b5 pbrook
Mass storage device based on @var{file} (@pxref{disk_images})
707 db380c06 balrog
@item host:@var{bus.addr}
708 0aff66b5 pbrook
Pass through the host device identified by @var{bus.addr}
709 0aff66b5 pbrook
(Linux only)
710 db380c06 balrog
@item host:@var{vendor_id:product_id}
711 0aff66b5 pbrook
Pass through the host device identified by @var{vendor_id:product_id}
712 0aff66b5 pbrook
(Linux only)
713 db380c06 balrog
@item wacom-tablet
714 f6d2a316 balrog
Virtual Wacom PenPartner tablet.  This device is similar to the @code{tablet}
715 f6d2a316 balrog
above but it can be used with the tslib library because in addition to touch
716 f6d2a316 balrog
coordinates it reports touch pressure.
717 db380c06 balrog
@item keyboard
718 47b2d338 balrog
Standard USB keyboard.  Will override the PS/2 keyboard (if present).
719 db380c06 balrog
@item serial:[vendorid=@var{vendor_id}][,product_id=@var{product_id}]:@var{dev}
720 db380c06 balrog
Serial converter. This emulates an FTDI FT232BM chip connected to host character
721 db380c06 balrog
device @var{dev}. The available character devices are the same as for the
722 db380c06 balrog
@code{-serial} option. The @code{vendorid} and @code{productid} options can be
723 a11d070e balrog
used to override the default 0403:6001. For instance, 
724 db380c06 balrog
@example
725 db380c06 balrog
usb_add serial:productid=FA00:tcp:192.168.0.2:4444
726 db380c06 balrog
@end example
727 db380c06 balrog
will connect to tcp port 4444 of ip 192.168.0.2, and plug that to the virtual
728 db380c06 balrog
serial converter, faking a Matrix Orbital LCD Display (USB ID 0403:FA00).
729 2e4d9fb1 aurel32
@item braille
730 2e4d9fb1 aurel32
Braille device.  This will use BrlAPI to display the braille output on a real
731 2e4d9fb1 aurel32
or fake device.
732 9ad97e65 balrog
@item net:@var{options}
733 9ad97e65 balrog
Network adapter that supports CDC ethernet and RNDIS protocols.  @var{options}
734 9ad97e65 balrog
specifies NIC options as with @code{-net nic,}@var{options} (see description).
735 9ad97e65 balrog
For instance, user-mode networking can be used with
736 6c9f886c balrog
@example
737 9ad97e65 balrog
qemu [...OPTIONS...] -net user,vlan=0 -usbdevice net:vlan=0
738 6c9f886c balrog
@end example
739 6c9f886c balrog
Currently this cannot be used in machines that support PCI NICs.
740 2d564691 balrog
@item bt[:@var{hci-type}]
741 2d564691 balrog
Bluetooth dongle whose type is specified in the same format as with
742 2d564691 balrog
the @option{-bt hci} option, @pxref{bt-hcis,,allowed HCI types}.  If
743 2d564691 balrog
no type is given, the HCI logic corresponds to @code{-bt hci,vlan=0}.
744 2d564691 balrog
This USB device implements the USB Transport Layer of HCI.  Example
745 2d564691 balrog
usage:
746 2d564691 balrog
@example
747 2d564691 balrog
qemu [...OPTIONS...] -usbdevice bt:hci,vlan=3 -bt device:keyboard,vlan=3
748 2d564691 balrog
@end example
749 0aff66b5 pbrook
@end table
750 b389dbfb bellard
751 0aff66b5 pbrook
@node host_usb_devices
752 b389dbfb bellard
@subsection Using host USB devices on a Linux host
753 b389dbfb bellard
754 b389dbfb bellard
WARNING: this is an experimental feature. QEMU will slow down when
755 b389dbfb bellard
using it. USB devices requiring real time streaming (i.e. USB Video
756 b389dbfb bellard
Cameras) are not supported yet.
757 b389dbfb bellard
758 b389dbfb bellard
@enumerate
759 5fafdf24 ths
@item If you use an early Linux 2.4 kernel, verify that no Linux driver
760 b389dbfb bellard
is actually using the USB device. A simple way to do that is simply to
761 b389dbfb bellard
disable the corresponding kernel module by renaming it from @file{mydriver.o}
762 b389dbfb bellard
to @file{mydriver.o.disabled}.
763 b389dbfb bellard
764 b389dbfb bellard
@item Verify that @file{/proc/bus/usb} is working (most Linux distributions should enable it by default). You should see something like that:
765 b389dbfb bellard
@example
766 b389dbfb bellard
ls /proc/bus/usb
767 b389dbfb bellard
001  devices  drivers
768 b389dbfb bellard
@end example
769 b389dbfb bellard
770 b389dbfb bellard
@item Since only root can access to the USB devices directly, you can either launch QEMU as root or change the permissions of the USB devices you want to use. For testing, the following suffices:
771 b389dbfb bellard
@example
772 b389dbfb bellard
chown -R myuid /proc/bus/usb
773 b389dbfb bellard
@end example
774 b389dbfb bellard
775 b389dbfb bellard
@item Launch QEMU and do in the monitor:
776 5fafdf24 ths
@example
777 b389dbfb bellard
info usbhost
778 b389dbfb bellard
  Device 1.2, speed 480 Mb/s
779 b389dbfb bellard
    Class 00: USB device 1234:5678, USB DISK
780 b389dbfb bellard
@end example
781 b389dbfb bellard
You should see the list of the devices you can use (Never try to use
782 b389dbfb bellard
hubs, it won't work).
783 b389dbfb bellard
784 b389dbfb bellard
@item Add the device in QEMU by using:
785 5fafdf24 ths
@example
786 b389dbfb bellard
usb_add host:1234:5678
787 b389dbfb bellard
@end example
788 b389dbfb bellard
789 b389dbfb bellard
Normally the guest OS should report that a new USB device is
790 b389dbfb bellard
plugged. You can use the option @option{-usbdevice} to do the same.
791 b389dbfb bellard
792 b389dbfb bellard
@item Now you can try to use the host USB device in QEMU.
793 b389dbfb bellard
794 b389dbfb bellard
@end enumerate
795 b389dbfb bellard
796 b389dbfb bellard
When relaunching QEMU, you may have to unplug and plug again the USB
797 b389dbfb bellard
device to make it work again (this is a bug).
798 b389dbfb bellard
799 f858dcae ths
@node vnc_security
800 f858dcae ths
@section VNC security
801 f858dcae ths
802 f858dcae ths
The VNC server capability provides access to the graphical console
803 f858dcae ths
of the guest VM across the network. This has a number of security
804 f858dcae ths
considerations depending on the deployment scenarios.
805 f858dcae ths
806 f858dcae ths
@menu
807 f858dcae ths
* vnc_sec_none::
808 f858dcae ths
* vnc_sec_password::
809 f858dcae ths
* vnc_sec_certificate::
810 f858dcae ths
* vnc_sec_certificate_verify::
811 f858dcae ths
* vnc_sec_certificate_pw::
812 2f9606b3 aliguori
* vnc_sec_sasl::
813 2f9606b3 aliguori
* vnc_sec_certificate_sasl::
814 f858dcae ths
* vnc_generate_cert::
815 2f9606b3 aliguori
* vnc_setup_sasl::
816 f858dcae ths
@end menu
817 f858dcae ths
@node vnc_sec_none
818 f858dcae ths
@subsection Without passwords
819 f858dcae ths
820 f858dcae ths
The simplest VNC server setup does not include any form of authentication.
821 f858dcae ths
For this setup it is recommended to restrict it to listen on a UNIX domain
822 f858dcae ths
socket only. For example
823 f858dcae ths
824 f858dcae ths
@example
825 f858dcae ths
qemu [...OPTIONS...] -vnc unix:/home/joebloggs/.qemu-myvm-vnc
826 f858dcae ths
@end example
827 f858dcae ths
828 f858dcae ths
This ensures that only users on local box with read/write access to that
829 f858dcae ths
path can access the VNC server. To securely access the VNC server from a
830 f858dcae ths
remote machine, a combination of netcat+ssh can be used to provide a secure
831 f858dcae ths
tunnel.
832 f858dcae ths
833 f858dcae ths
@node vnc_sec_password
834 f858dcae ths
@subsection With passwords
835 f858dcae ths
836 f858dcae ths
The VNC protocol has limited support for password based authentication. Since
837 f858dcae ths
the protocol limits passwords to 8 characters it should not be considered
838 f858dcae ths
to provide high security. The password can be fairly easily brute-forced by
839 f858dcae ths
a client making repeat connections. For this reason, a VNC server using password
840 f858dcae ths
authentication should be restricted to only listen on the loopback interface
841 34a3d239 blueswir1
or UNIX domain sockets. Password authentication is requested with the @code{password}
842 f858dcae ths
option, and then once QEMU is running the password is set with the monitor. Until
843 f858dcae ths
the monitor is used to set the password all clients will be rejected.
844 f858dcae ths
845 f858dcae ths
@example
846 f858dcae ths
qemu [...OPTIONS...] -vnc :1,password -monitor stdio
847 f858dcae ths
(qemu) change vnc password
848 f858dcae ths
Password: ********
849 f858dcae ths
(qemu)
850 f858dcae ths
@end example
851 f858dcae ths
852 f858dcae ths
@node vnc_sec_certificate
853 f858dcae ths
@subsection With x509 certificates
854 f858dcae ths
855 f858dcae ths
The QEMU VNC server also implements the VeNCrypt extension allowing use of
856 f858dcae ths
TLS for encryption of the session, and x509 certificates for authentication.
857 f858dcae ths
The use of x509 certificates is strongly recommended, because TLS on its
858 f858dcae ths
own is susceptible to man-in-the-middle attacks. Basic x509 certificate
859 f858dcae ths
support provides a secure session, but no authentication. This allows any
860 f858dcae ths
client to connect, and provides an encrypted session.
861 f858dcae ths
862 f858dcae ths
@example
863 f858dcae ths
qemu [...OPTIONS...] -vnc :1,tls,x509=/etc/pki/qemu -monitor stdio
864 f858dcae ths
@end example
865 f858dcae ths
866 f858dcae ths
In the above example @code{/etc/pki/qemu} should contain at least three files,
867 f858dcae ths
@code{ca-cert.pem}, @code{server-cert.pem} and @code{server-key.pem}. Unprivileged
868 f858dcae ths
users will want to use a private directory, for example @code{$HOME/.pki/qemu}.
869 f858dcae ths
NB the @code{server-key.pem} file should be protected with file mode 0600 to
870 f858dcae ths
only be readable by the user owning it.
871 f858dcae ths
872 f858dcae ths
@node vnc_sec_certificate_verify
873 f858dcae ths
@subsection With x509 certificates and client verification
874 f858dcae ths
875 f858dcae ths
Certificates can also provide a means to authenticate the client connecting.
876 f858dcae ths
The server will request that the client provide a certificate, which it will
877 f858dcae ths
then validate against the CA certificate. This is a good choice if deploying
878 f858dcae ths
in an environment with a private internal certificate authority.
879 f858dcae ths
880 f858dcae ths
@example
881 f858dcae ths
qemu [...OPTIONS...] -vnc :1,tls,x509verify=/etc/pki/qemu -monitor stdio
882 f858dcae ths
@end example
883 f858dcae ths
884 f858dcae ths
885 f858dcae ths
@node vnc_sec_certificate_pw
886 f858dcae ths
@subsection With x509 certificates, client verification and passwords
887 f858dcae ths
888 f858dcae ths
Finally, the previous method can be combined with VNC password authentication
889 f858dcae ths
to provide two layers of authentication for clients.
890 f858dcae ths
891 f858dcae ths
@example
892 f858dcae ths
qemu [...OPTIONS...] -vnc :1,password,tls,x509verify=/etc/pki/qemu -monitor stdio
893 f858dcae ths
(qemu) change vnc password
894 f858dcae ths
Password: ********
895 f858dcae ths
(qemu)
896 f858dcae ths
@end example
897 f858dcae ths
898 2f9606b3 aliguori
899 2f9606b3 aliguori
@node vnc_sec_sasl
900 2f9606b3 aliguori
@subsection With SASL authentication
901 2f9606b3 aliguori
902 2f9606b3 aliguori
The SASL authentication method is a VNC extension, that provides an
903 2f9606b3 aliguori
easily extendable, pluggable authentication method. This allows for
904 2f9606b3 aliguori
integration with a wide range of authentication mechanisms, such as
905 2f9606b3 aliguori
PAM, GSSAPI/Kerberos, LDAP, SQL databases, one-time keys and more.
906 2f9606b3 aliguori
The strength of the authentication depends on the exact mechanism
907 2f9606b3 aliguori
configured. If the chosen mechanism also provides a SSF layer, then
908 2f9606b3 aliguori
it will encrypt the datastream as well.
909 2f9606b3 aliguori
910 2f9606b3 aliguori
Refer to the later docs on how to choose the exact SASL mechanism
911 2f9606b3 aliguori
used for authentication, but assuming use of one supporting SSF,
912 2f9606b3 aliguori
then QEMU can be launched with:
913 2f9606b3 aliguori
914 2f9606b3 aliguori
@example
915 2f9606b3 aliguori
qemu [...OPTIONS...] -vnc :1,sasl -monitor stdio
916 2f9606b3 aliguori
@end example
917 2f9606b3 aliguori
918 2f9606b3 aliguori
@node vnc_sec_certificate_sasl
919 2f9606b3 aliguori
@subsection With x509 certificates and SASL authentication
920 2f9606b3 aliguori
921 2f9606b3 aliguori
If the desired SASL authentication mechanism does not supported
922 2f9606b3 aliguori
SSF layers, then it is strongly advised to run it in combination
923 2f9606b3 aliguori
with TLS and x509 certificates. This provides securely encrypted
924 2f9606b3 aliguori
data stream, avoiding risk of compromising of the security
925 2f9606b3 aliguori
credentials. This can be enabled, by combining the 'sasl' option
926 2f9606b3 aliguori
with the aforementioned TLS + x509 options:
927 2f9606b3 aliguori
928 2f9606b3 aliguori
@example
929 2f9606b3 aliguori
qemu [...OPTIONS...] -vnc :1,tls,x509,sasl -monitor stdio
930 2f9606b3 aliguori
@end example
931 2f9606b3 aliguori
932 2f9606b3 aliguori
933 f858dcae ths
@node vnc_generate_cert
934 f858dcae ths
@subsection Generating certificates for VNC
935 f858dcae ths
936 f858dcae ths
The GNU TLS packages provides a command called @code{certtool} which can
937 f858dcae ths
be used to generate certificates and keys in PEM format. At a minimum it
938 f858dcae ths
is neccessary to setup a certificate authority, and issue certificates to
939 f858dcae ths
each server. If using certificates for authentication, then each client
940 f858dcae ths
will also need to be issued a certificate. The recommendation is for the
941 f858dcae ths
server to keep its certificates in either @code{/etc/pki/qemu} or for
942 f858dcae ths
unprivileged users in @code{$HOME/.pki/qemu}.
943 f858dcae ths
944 f858dcae ths
@menu
945 f858dcae ths
* vnc_generate_ca::
946 f858dcae ths
* vnc_generate_server::
947 f858dcae ths
* vnc_generate_client::
948 f858dcae ths
@end menu
949 f858dcae ths
@node vnc_generate_ca
950 f858dcae ths
@subsubsection Setup the Certificate Authority
951 f858dcae ths
952 f858dcae ths
This step only needs to be performed once per organization / organizational
953 f858dcae ths
unit. First the CA needs a private key. This key must be kept VERY secret
954 f858dcae ths
and secure. If this key is compromised the entire trust chain of the certificates
955 f858dcae ths
issued with it is lost.
956 f858dcae ths
957 f858dcae ths
@example
958 f858dcae ths
# certtool --generate-privkey > ca-key.pem
959 f858dcae ths
@end example
960 f858dcae ths
961 f858dcae ths
A CA needs to have a public certificate. For simplicity it can be a self-signed
962 f858dcae ths
certificate, or one issue by a commercial certificate issuing authority. To
963 f858dcae ths
generate a self-signed certificate requires one core piece of information, the
964 f858dcae ths
name of the organization.
965 f858dcae ths
966 f858dcae ths
@example
967 f858dcae ths
# cat > ca.info <<EOF
968 f858dcae ths
cn = Name of your organization
969 f858dcae ths
ca
970 f858dcae ths
cert_signing_key
971 f858dcae ths
EOF
972 f858dcae ths
# certtool --generate-self-signed \
973 f858dcae ths
           --load-privkey ca-key.pem
974 f858dcae ths
           --template ca.info \
975 f858dcae ths
           --outfile ca-cert.pem
976 f858dcae ths
@end example
977 f858dcae ths
978 f858dcae ths
The @code{ca-cert.pem} file should be copied to all servers and clients wishing to utilize
979 f858dcae ths
TLS support in the VNC server. The @code{ca-key.pem} must not be disclosed/copied at all.
980 f858dcae ths
981 f858dcae ths
@node vnc_generate_server
982 f858dcae ths
@subsubsection Issuing server certificates
983 f858dcae ths
984 f858dcae ths
Each server (or host) needs to be issued with a key and certificate. When connecting
985 f858dcae ths
the certificate is sent to the client which validates it against the CA certificate.
986 f858dcae ths
The core piece of information for a server certificate is the hostname. This should
987 f858dcae ths
be the fully qualified hostname that the client will connect with, since the client
988 f858dcae ths
will typically also verify the hostname in the certificate. On the host holding the
989 f858dcae ths
secure CA private key:
990 f858dcae ths
991 f858dcae ths
@example
992 f858dcae ths
# cat > server.info <<EOF
993 f858dcae ths
organization = Name  of your organization
994 f858dcae ths
cn = server.foo.example.com
995 f858dcae ths
tls_www_server
996 f858dcae ths
encryption_key
997 f858dcae ths
signing_key
998 f858dcae ths
EOF
999 f858dcae ths
# certtool --generate-privkey > server-key.pem
1000 f858dcae ths
# certtool --generate-certificate \
1001 f858dcae ths
           --load-ca-certificate ca-cert.pem \
1002 f858dcae ths
           --load-ca-privkey ca-key.pem \
1003 f858dcae ths
           --load-privkey server server-key.pem \
1004 f858dcae ths
           --template server.info \
1005 f858dcae ths
           --outfile server-cert.pem
1006 f858dcae ths
@end example
1007 f858dcae ths
1008 f858dcae ths
The @code{server-key.pem} and @code{server-cert.pem} files should now be securely copied
1009 f858dcae ths
to the server for which they were generated. The @code{server-key.pem} is security
1010 f858dcae ths
sensitive and should be kept protected with file mode 0600 to prevent disclosure.
1011 f858dcae ths
1012 f858dcae ths
@node vnc_generate_client
1013 f858dcae ths
@subsubsection Issuing client certificates
1014 f858dcae ths
1015 f858dcae ths
If the QEMU VNC server is to use the @code{x509verify} option to validate client
1016 f858dcae ths
certificates as its authentication mechanism, each client also needs to be issued
1017 f858dcae ths
a certificate. The client certificate contains enough metadata to uniquely identify
1018 f858dcae ths
the client, typically organization, state, city, building, etc. On the host holding
1019 f858dcae ths
the secure CA private key:
1020 f858dcae ths
1021 f858dcae ths
@example
1022 f858dcae ths
# cat > client.info <<EOF
1023 f858dcae ths
country = GB
1024 f858dcae ths
state = London
1025 f858dcae ths
locality = London
1026 f858dcae ths
organiazation = Name of your organization
1027 f858dcae ths
cn = client.foo.example.com
1028 f858dcae ths
tls_www_client
1029 f858dcae ths
encryption_key
1030 f858dcae ths
signing_key
1031 f858dcae ths
EOF
1032 f858dcae ths
# certtool --generate-privkey > client-key.pem
1033 f858dcae ths
# certtool --generate-certificate \
1034 f858dcae ths
           --load-ca-certificate ca-cert.pem \
1035 f858dcae ths
           --load-ca-privkey ca-key.pem \
1036 f858dcae ths
           --load-privkey client-key.pem \
1037 f858dcae ths
           --template client.info \
1038 f858dcae ths
           --outfile client-cert.pem
1039 f858dcae ths
@end example
1040 f858dcae ths
1041 f858dcae ths
The @code{client-key.pem} and @code{client-cert.pem} files should now be securely
1042 f858dcae ths
copied to the client for which they were generated.
1043 f858dcae ths
1044 2f9606b3 aliguori
1045 2f9606b3 aliguori
@node vnc_setup_sasl
1046 2f9606b3 aliguori
1047 2f9606b3 aliguori
@subsection Configuring SASL mechanisms
1048 2f9606b3 aliguori
1049 2f9606b3 aliguori
The following documentation assumes use of the Cyrus SASL implementation on a
1050 2f9606b3 aliguori
Linux host, but the principals should apply to any other SASL impl. When SASL
1051 2f9606b3 aliguori
is enabled, the mechanism configuration will be loaded from system default
1052 2f9606b3 aliguori
SASL service config /etc/sasl2/qemu.conf. If running QEMU as an
1053 2f9606b3 aliguori
unprivileged user, an environment variable SASL_CONF_PATH can be used
1054 2f9606b3 aliguori
to make it search alternate locations for the service config.
1055 2f9606b3 aliguori
1056 2f9606b3 aliguori
The default configuration might contain
1057 2f9606b3 aliguori
1058 2f9606b3 aliguori
@example
1059 2f9606b3 aliguori
mech_list: digest-md5
1060 2f9606b3 aliguori
sasldb_path: /etc/qemu/passwd.db
1061 2f9606b3 aliguori
@end example
1062 2f9606b3 aliguori
1063 2f9606b3 aliguori
This says to use the 'Digest MD5' mechanism, which is similar to the HTTP
1064 2f9606b3 aliguori
Digest-MD5 mechanism. The list of valid usernames & passwords is maintained
1065 2f9606b3 aliguori
in the /etc/qemu/passwd.db file, and can be updated using the saslpasswd2
1066 2f9606b3 aliguori
command. While this mechanism is easy to configure and use, it is not
1067 2f9606b3 aliguori
considered secure by modern standards, so only suitable for developers /
1068 2f9606b3 aliguori
ad-hoc testing.
1069 2f9606b3 aliguori
1070 2f9606b3 aliguori
A more serious deployment might use Kerberos, which is done with the 'gssapi'
1071 2f9606b3 aliguori
mechanism
1072 2f9606b3 aliguori
1073 2f9606b3 aliguori
@example
1074 2f9606b3 aliguori
mech_list: gssapi
1075 2f9606b3 aliguori
keytab: /etc/qemu/krb5.tab
1076 2f9606b3 aliguori
@end example
1077 2f9606b3 aliguori
1078 2f9606b3 aliguori
For this to work the administrator of your KDC must generate a Kerberos
1079 2f9606b3 aliguori
principal for the server, with a name of  'qemu/somehost.example.com@@EXAMPLE.COM'
1080 2f9606b3 aliguori
replacing 'somehost.example.com' with the fully qualified host name of the
1081 2f9606b3 aliguori
machine running QEMU, and 'EXAMPLE.COM' with the Keberos Realm.
1082 2f9606b3 aliguori
1083 2f9606b3 aliguori
Other configurations will be left as an exercise for the reader. It should
1084 2f9606b3 aliguori
be noted that only Digest-MD5 and GSSAPI provides a SSF layer for data
1085 2f9606b3 aliguori
encryption. For all other mechanisms, VNC should always be configured to
1086 2f9606b3 aliguori
use TLS and x509 certificates to protect security credentials from snooping.
1087 2f9606b3 aliguori
1088 0806e3f6 bellard
@node gdb_usage
1089 da415d54 bellard
@section GDB usage
1090 da415d54 bellard
1091 da415d54 bellard
QEMU has a primitive support to work with gdb, so that you can do
1092 0806e3f6 bellard
'Ctrl-C' while the virtual machine is running and inspect its state.
1093 da415d54 bellard
1094 9d4520d0 bellard
In order to use gdb, launch qemu with the '-s' option. It will wait for a
1095 da415d54 bellard
gdb connection:
1096 da415d54 bellard
@example
1097 debc7065 bellard
> qemu -s -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \
1098 debc7065 bellard
       -append "root=/dev/hda"
1099 da415d54 bellard
Connected to host network interface: tun0
1100 da415d54 bellard
Waiting gdb connection on port 1234
1101 da415d54 bellard
@end example
1102 da415d54 bellard
1103 da415d54 bellard
Then launch gdb on the 'vmlinux' executable:
1104 da415d54 bellard
@example
1105 da415d54 bellard
> gdb vmlinux
1106 da415d54 bellard
@end example
1107 da415d54 bellard
1108 da415d54 bellard
In gdb, connect to QEMU:
1109 da415d54 bellard
@example
1110 6c9bf893 bellard
(gdb) target remote localhost:1234
1111 da415d54 bellard
@end example
1112 da415d54 bellard
1113 da415d54 bellard
Then you can use gdb normally. For example, type 'c' to launch the kernel:
1114 da415d54 bellard
@example
1115 da415d54 bellard
(gdb) c
1116 da415d54 bellard
@end example
1117 da415d54 bellard
1118 0806e3f6 bellard
Here are some useful tips in order to use gdb on system code:
1119 0806e3f6 bellard
1120 0806e3f6 bellard
@enumerate
1121 0806e3f6 bellard
@item
1122 0806e3f6 bellard
Use @code{info reg} to display all the CPU registers.
1123 0806e3f6 bellard
@item
1124 0806e3f6 bellard
Use @code{x/10i $eip} to display the code at the PC position.
1125 0806e3f6 bellard
@item
1126 0806e3f6 bellard
Use @code{set architecture i8086} to dump 16 bit code. Then use
1127 294e8637 bellard
@code{x/10i $cs*16+$eip} to dump the code at the PC position.
1128 0806e3f6 bellard
@end enumerate
1129 0806e3f6 bellard
1130 60897d36 edgar_igl
Advanced debugging options:
1131 60897d36 edgar_igl
1132 60897d36 edgar_igl
The default single stepping behavior is step with the IRQs and timer service routines off.  It is set this way because when gdb executes a single step it expects to advance beyond the current instruction.  With the IRQs and and timer service routines on, a single step might jump into the one of the interrupt or exception vectors instead of executing the current instruction. This means you may hit the same breakpoint a number of times before executing the instruction gdb wants to have executed.  Because there are rare circumstances where you want to single step into an interrupt vector the behavior can be controlled from GDB.  There are three commands you can query and set the single step behavior:
1133 94d45e44 edgar_igl
@table @code
1134 60897d36 edgar_igl
@item maintenance packet qqemu.sstepbits
1135 60897d36 edgar_igl
1136 60897d36 edgar_igl
This will display the MASK bits used to control the single stepping IE:
1137 60897d36 edgar_igl
@example
1138 60897d36 edgar_igl
(gdb) maintenance packet qqemu.sstepbits
1139 60897d36 edgar_igl
sending: "qqemu.sstepbits"
1140 60897d36 edgar_igl
received: "ENABLE=1,NOIRQ=2,NOTIMER=4"
1141 60897d36 edgar_igl
@end example
1142 60897d36 edgar_igl
@item maintenance packet qqemu.sstep
1143 60897d36 edgar_igl
1144 60897d36 edgar_igl
This will display the current value of the mask used when single stepping IE:
1145 60897d36 edgar_igl
@example
1146 60897d36 edgar_igl
(gdb) maintenance packet qqemu.sstep
1147 60897d36 edgar_igl
sending: "qqemu.sstep"
1148 60897d36 edgar_igl
received: "0x7"
1149 60897d36 edgar_igl
@end example
1150 60897d36 edgar_igl
@item maintenance packet Qqemu.sstep=HEX_VALUE
1151 60897d36 edgar_igl
1152 60897d36 edgar_igl
This will change the single step mask, so if wanted to enable IRQs on the single step, but not timers, you would use:
1153 60897d36 edgar_igl
@example
1154 60897d36 edgar_igl
(gdb) maintenance packet Qqemu.sstep=0x5
1155 60897d36 edgar_igl
sending: "qemu.sstep=0x5"
1156 60897d36 edgar_igl
received: "OK"
1157 60897d36 edgar_igl
@end example
1158 94d45e44 edgar_igl
@end table
1159 60897d36 edgar_igl
1160 debc7065 bellard
@node pcsys_os_specific
1161 1a084f3d bellard
@section Target OS specific information
1162 1a084f3d bellard
1163 1a084f3d bellard
@subsection Linux
1164 1a084f3d bellard
1165 15a34c63 bellard
To have access to SVGA graphic modes under X11, use the @code{vesa} or
1166 15a34c63 bellard
the @code{cirrus} X11 driver. For optimal performances, use 16 bit
1167 15a34c63 bellard
color depth in the guest and the host OS.
1168 1a084f3d bellard
1169 e3371e62 bellard
When using a 2.6 guest Linux kernel, you should add the option
1170 e3371e62 bellard
@code{clock=pit} on the kernel command line because the 2.6 Linux
1171 e3371e62 bellard
kernels make very strict real time clock checks by default that QEMU
1172 e3371e62 bellard
cannot simulate exactly.
1173 e3371e62 bellard
1174 7c3fc84d bellard
When using a 2.6 guest Linux kernel, verify that the 4G/4G patch is
1175 7c3fc84d bellard
not activated because QEMU is slower with this patch. The QEMU
1176 7c3fc84d bellard
Accelerator Module is also much slower in this case. Earlier Fedora
1177 4be456f1 ths
Core 3 Linux kernel (< 2.6.9-1.724_FC3) were known to incorporate this
1178 7c3fc84d bellard
patch by default. Newer kernels don't have it.
1179 7c3fc84d bellard
1180 1a084f3d bellard
@subsection Windows
1181 1a084f3d bellard
1182 1a084f3d bellard
If you have a slow host, using Windows 95 is better as it gives the
1183 1a084f3d bellard
best speed. Windows 2000 is also a good choice.
1184 1a084f3d bellard
1185 e3371e62 bellard
@subsubsection SVGA graphic modes support
1186 e3371e62 bellard
1187 e3371e62 bellard
QEMU emulates a Cirrus Logic GD5446 Video
1188 15a34c63 bellard
card. All Windows versions starting from Windows 95 should recognize
1189 15a34c63 bellard
and use this graphic card. For optimal performances, use 16 bit color
1190 15a34c63 bellard
depth in the guest and the host OS.
1191 1a084f3d bellard
1192 3cb0853a bellard
If you are using Windows XP as guest OS and if you want to use high
1193 3cb0853a bellard
resolution modes which the Cirrus Logic BIOS does not support (i.e. >=
1194 3cb0853a bellard
1280x1024x16), then you should use the VESA VBE virtual graphic card
1195 3cb0853a bellard
(option @option{-std-vga}).
1196 3cb0853a bellard
1197 e3371e62 bellard
@subsubsection CPU usage reduction
1198 e3371e62 bellard
1199 e3371e62 bellard
Windows 9x does not correctly use the CPU HLT
1200 15a34c63 bellard
instruction. The result is that it takes host CPU cycles even when
1201 15a34c63 bellard
idle. You can install the utility from
1202 15a34c63 bellard
@url{http://www.user.cityline.ru/~maxamn/amnhltm.zip} to solve this
1203 15a34c63 bellard
problem. Note that no such tool is needed for NT, 2000 or XP.
1204 1a084f3d bellard
1205 9d0a8e6f bellard
@subsubsection Windows 2000 disk full problem
1206 e3371e62 bellard
1207 9d0a8e6f bellard
Windows 2000 has a bug which gives a disk full problem during its
1208 9d0a8e6f bellard
installation. When installing it, use the @option{-win2k-hack} QEMU
1209 9d0a8e6f bellard
option to enable a specific workaround. After Windows 2000 is
1210 9d0a8e6f bellard
installed, you no longer need this option (this option slows down the
1211 9d0a8e6f bellard
IDE transfers).
1212 e3371e62 bellard
1213 6cc721cf bellard
@subsubsection Windows 2000 shutdown
1214 6cc721cf bellard
1215 6cc721cf bellard
Windows 2000 cannot automatically shutdown in QEMU although Windows 98
1216 6cc721cf bellard
can. It comes from the fact that Windows 2000 does not automatically
1217 6cc721cf bellard
use the APM driver provided by the BIOS.
1218 6cc721cf bellard
1219 6cc721cf bellard
In order to correct that, do the following (thanks to Struan
1220 6cc721cf bellard
Bartlett): go to the Control Panel => Add/Remove Hardware & Next =>
1221 6cc721cf bellard
Add/Troubleshoot a device => Add a new device & Next => No, select the
1222 6cc721cf bellard
hardware from a list & Next => NT Apm/Legacy Support & Next => Next
1223 6cc721cf bellard
(again) a few times. Now the driver is installed and Windows 2000 now
1224 5fafdf24 ths
correctly instructs QEMU to shutdown at the appropriate moment.
1225 6cc721cf bellard
1226 6cc721cf bellard
@subsubsection Share a directory between Unix and Windows
1227 6cc721cf bellard
1228 6cc721cf bellard
See @ref{sec_invocation} about the help of the option @option{-smb}.
1229 6cc721cf bellard
1230 2192c332 bellard
@subsubsection Windows XP security problem
1231 e3371e62 bellard
1232 e3371e62 bellard
Some releases of Windows XP install correctly but give a security
1233 e3371e62 bellard
error when booting:
1234 e3371e62 bellard
@example
1235 e3371e62 bellard
A problem is preventing Windows from accurately checking the
1236 e3371e62 bellard
license for this computer. Error code: 0x800703e6.
1237 e3371e62 bellard
@end example
1238 e3371e62 bellard
1239 2192c332 bellard
The workaround is to install a service pack for XP after a boot in safe
1240 2192c332 bellard
mode. Then reboot, and the problem should go away. Since there is no
1241 2192c332 bellard
network while in safe mode, its recommended to download the full
1242 2192c332 bellard
installation of SP1 or SP2 and transfer that via an ISO or using the
1243 2192c332 bellard
vvfat block device ("-hdb fat:directory_which_holds_the_SP").
1244 e3371e62 bellard
1245 a0a821a4 bellard
@subsection MS-DOS and FreeDOS
1246 a0a821a4 bellard
1247 a0a821a4 bellard
@subsubsection CPU usage reduction
1248 a0a821a4 bellard
1249 a0a821a4 bellard
DOS does not correctly use the CPU HLT instruction. The result is that
1250 a0a821a4 bellard
it takes host CPU cycles even when idle. You can install the utility
1251 a0a821a4 bellard
from @url{http://www.vmware.com/software/dosidle210.zip} to solve this
1252 a0a821a4 bellard
problem.
1253 a0a821a4 bellard
1254 debc7065 bellard
@node QEMU System emulator for non PC targets
1255 3f9f3aa1 bellard
@chapter QEMU System emulator for non PC targets
1256 3f9f3aa1 bellard
1257 3f9f3aa1 bellard
QEMU is a generic emulator and it emulates many non PC
1258 3f9f3aa1 bellard
machines. Most of the options are similar to the PC emulator. The
1259 4be456f1 ths
differences are mentioned in the following sections.
1260 3f9f3aa1 bellard
1261 debc7065 bellard
@menu
1262 debc7065 bellard
* QEMU PowerPC System emulator::
1263 24d4de45 ths
* Sparc32 System emulator::
1264 24d4de45 ths
* Sparc64 System emulator::
1265 24d4de45 ths
* MIPS System emulator::
1266 24d4de45 ths
* ARM System emulator::
1267 24d4de45 ths
* ColdFire System emulator::
1268 debc7065 bellard
@end menu
1269 debc7065 bellard
1270 debc7065 bellard
@node QEMU PowerPC System emulator
1271 3f9f3aa1 bellard
@section QEMU PowerPC System emulator
1272 1a084f3d bellard
1273 15a34c63 bellard
Use the executable @file{qemu-system-ppc} to simulate a complete PREP
1274 15a34c63 bellard
or PowerMac PowerPC system.
1275 1a084f3d bellard
1276 b671f9ed bellard
QEMU emulates the following PowerMac peripherals:
1277 1a084f3d bellard
1278 15a34c63 bellard
@itemize @minus
1279 5fafdf24 ths
@item
1280 006f3a48 blueswir1
UniNorth or Grackle PCI Bridge
1281 15a34c63 bellard
@item
1282 15a34c63 bellard
PCI VGA compatible card with VESA Bochs Extensions
1283 5fafdf24 ths
@item
1284 15a34c63 bellard
2 PMAC IDE interfaces with hard disk and CD-ROM support
1285 5fafdf24 ths
@item
1286 15a34c63 bellard
NE2000 PCI adapters
1287 15a34c63 bellard
@item
1288 15a34c63 bellard
Non Volatile RAM
1289 15a34c63 bellard
@item
1290 15a34c63 bellard
VIA-CUDA with ADB keyboard and mouse.
1291 1a084f3d bellard
@end itemize
1292 1a084f3d bellard
1293 b671f9ed bellard
QEMU emulates the following PREP peripherals:
1294 52c00a5f bellard
1295 52c00a5f bellard
@itemize @minus
1296 5fafdf24 ths
@item
1297 15a34c63 bellard
PCI Bridge
1298 15a34c63 bellard
@item
1299 15a34c63 bellard
PCI VGA compatible card with VESA Bochs Extensions
1300 5fafdf24 ths
@item
1301 52c00a5f bellard
2 IDE interfaces with hard disk and CD-ROM support
1302 52c00a5f bellard
@item
1303 52c00a5f bellard
Floppy disk
1304 5fafdf24 ths
@item
1305 15a34c63 bellard
NE2000 network adapters
1306 52c00a5f bellard
@item
1307 52c00a5f bellard
Serial port
1308 52c00a5f bellard
@item
1309 52c00a5f bellard
PREP Non Volatile RAM
1310 15a34c63 bellard
@item
1311 15a34c63 bellard
PC compatible keyboard and mouse.
1312 52c00a5f bellard
@end itemize
1313 52c00a5f bellard
1314 15a34c63 bellard
QEMU uses the Open Hack'Ware Open Firmware Compatible BIOS available at
1315 3f9f3aa1 bellard
@url{http://perso.magic.fr/l_indien/OpenHackWare/index.htm}.
1316 52c00a5f bellard
1317 992e5acd blueswir1
Since version 0.9.1, QEMU uses OpenBIOS @url{http://www.openbios.org/}
1318 006f3a48 blueswir1
for the g3beige and mac99 PowerMac machines. OpenBIOS is a free (GPL
1319 006f3a48 blueswir1
v2) portable firmware implementation. The goal is to implement a 100%
1320 006f3a48 blueswir1
IEEE 1275-1994 (referred to as Open Firmware) compliant firmware.
1321 992e5acd blueswir1
1322 15a34c63 bellard
@c man begin OPTIONS
1323 15a34c63 bellard
1324 15a34c63 bellard
The following options are specific to the PowerPC emulation:
1325 15a34c63 bellard
1326 15a34c63 bellard
@table @option
1327 15a34c63 bellard
1328 3b46e624 ths
@item -g WxH[xDEPTH]
1329 15a34c63 bellard
1330 15a34c63 bellard
Set the initial VGA graphic mode. The default is 800x600x15.
1331 15a34c63 bellard
1332 95efd11c blueswir1
@item -prom-env string
1333 95efd11c blueswir1
1334 95efd11c blueswir1
Set OpenBIOS variables in NVRAM, for example:
1335 95efd11c blueswir1
1336 95efd11c blueswir1
@example
1337 95efd11c blueswir1
qemu-system-ppc -prom-env 'auto-boot?=false' \
1338 95efd11c blueswir1
 -prom-env 'boot-device=hd:2,\yaboot' \
1339 95efd11c blueswir1
 -prom-env 'boot-args=conf=hd:2,\yaboot.conf'
1340 95efd11c blueswir1
@end example
1341 95efd11c blueswir1
1342 95efd11c blueswir1
These variables are not used by Open Hack'Ware.
1343 95efd11c blueswir1
1344 15a34c63 bellard
@end table
1345 15a34c63 bellard
1346 5fafdf24 ths
@c man end
1347 15a34c63 bellard
1348 15a34c63 bellard
1349 52c00a5f bellard
More information is available at
1350 3f9f3aa1 bellard
@url{http://perso.magic.fr/l_indien/qemu-ppc/}.
1351 52c00a5f bellard
1352 24d4de45 ths
@node Sparc32 System emulator
1353 24d4de45 ths
@section Sparc32 System emulator
1354 e80cfcfc bellard
1355 34a3d239 blueswir1
Use the executable @file{qemu-system-sparc} to simulate the following
1356 34a3d239 blueswir1
Sun4m architecture machines:
1357 34a3d239 blueswir1
@itemize @minus
1358 34a3d239 blueswir1
@item
1359 34a3d239 blueswir1
SPARCstation 4
1360 34a3d239 blueswir1
@item
1361 34a3d239 blueswir1
SPARCstation 5
1362 34a3d239 blueswir1
@item
1363 34a3d239 blueswir1
SPARCstation 10
1364 34a3d239 blueswir1
@item
1365 34a3d239 blueswir1
SPARCstation 20
1366 34a3d239 blueswir1
@item
1367 34a3d239 blueswir1
SPARCserver 600MP
1368 34a3d239 blueswir1
@item
1369 34a3d239 blueswir1
SPARCstation LX
1370 34a3d239 blueswir1
@item
1371 34a3d239 blueswir1
SPARCstation Voyager
1372 34a3d239 blueswir1
@item
1373 34a3d239 blueswir1
SPARCclassic
1374 34a3d239 blueswir1
@item
1375 34a3d239 blueswir1
SPARCbook
1376 34a3d239 blueswir1
@end itemize
1377 34a3d239 blueswir1
1378 34a3d239 blueswir1
The emulation is somewhat complete. SMP up to 16 CPUs is supported,
1379 34a3d239 blueswir1
but Linux limits the number of usable CPUs to 4.
1380 e80cfcfc bellard
1381 34a3d239 blueswir1
It's also possible to simulate a SPARCstation 2 (sun4c architecture),
1382 34a3d239 blueswir1
SPARCserver 1000, or SPARCcenter 2000 (sun4d architecture), but these
1383 34a3d239 blueswir1
emulators are not usable yet.
1384 34a3d239 blueswir1
1385 34a3d239 blueswir1
QEMU emulates the following sun4m/sun4c/sun4d peripherals:
1386 e80cfcfc bellard
1387 e80cfcfc bellard
@itemize @minus
1388 3475187d bellard
@item
1389 7d85892b blueswir1
IOMMU or IO-UNITs
1390 e80cfcfc bellard
@item
1391 e80cfcfc bellard
TCX Frame buffer
1392 5fafdf24 ths
@item
1393 e80cfcfc bellard
Lance (Am7990) Ethernet
1394 e80cfcfc bellard
@item
1395 34a3d239 blueswir1
Non Volatile RAM M48T02/M48T08
1396 e80cfcfc bellard
@item
1397 3475187d bellard
Slave I/O: timers, interrupt controllers, Zilog serial ports, keyboard
1398 3475187d bellard
and power/reset logic
1399 3475187d bellard
@item
1400 3475187d bellard
ESP SCSI controller with hard disk and CD-ROM support
1401 3475187d bellard
@item
1402 6a3b9cc9 blueswir1
Floppy drive (not on SS-600MP)
1403 a2502b58 blueswir1
@item
1404 a2502b58 blueswir1
CS4231 sound device (only on SS-5, not working yet)
1405 e80cfcfc bellard
@end itemize
1406 e80cfcfc bellard
1407 6a3b9cc9 blueswir1
The number of peripherals is fixed in the architecture.  Maximum
1408 6a3b9cc9 blueswir1
memory size depends on the machine type, for SS-5 it is 256MB and for
1409 7d85892b blueswir1
others 2047MB.
1410 3475187d bellard
1411 30a604f3 bellard
Since version 0.8.2, QEMU uses OpenBIOS
1412 0986ac3b bellard
@url{http://www.openbios.org/}. OpenBIOS is a free (GPL v2) portable
1413 0986ac3b bellard
firmware implementation. The goal is to implement a 100% IEEE
1414 0986ac3b bellard
1275-1994 (referred to as Open Firmware) compliant firmware.
1415 3475187d bellard
1416 3475187d bellard
A sample Linux 2.6 series kernel and ram disk image are available on
1417 34a3d239 blueswir1
the QEMU web site. There are still issues with NetBSD and OpenBSD, but
1418 34a3d239 blueswir1
some kernel versions work. Please note that currently Solaris kernels
1419 34a3d239 blueswir1
don't work probably due to interface issues between OpenBIOS and
1420 34a3d239 blueswir1
Solaris.
1421 3475187d bellard
1422 3475187d bellard
@c man begin OPTIONS
1423 3475187d bellard
1424 a2502b58 blueswir1
The following options are specific to the Sparc32 emulation:
1425 3475187d bellard
1426 3475187d bellard
@table @option
1427 3475187d bellard
1428 a2502b58 blueswir1
@item -g WxHx[xDEPTH]
1429 3475187d bellard
1430 a2502b58 blueswir1
Set the initial TCX graphic mode. The default is 1024x768x8, currently
1431 a2502b58 blueswir1
the only other possible mode is 1024x768x24.
1432 3475187d bellard
1433 66508601 blueswir1
@item -prom-env string
1434 66508601 blueswir1
1435 66508601 blueswir1
Set OpenBIOS variables in NVRAM, for example:
1436 66508601 blueswir1
1437 66508601 blueswir1
@example
1438 66508601 blueswir1
qemu-system-sparc -prom-env 'auto-boot?=false' \
1439 66508601 blueswir1
 -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single'
1440 66508601 blueswir1
@end example
1441 66508601 blueswir1
1442 34a3d239 blueswir1
@item -M [SS-4|SS-5|SS-10|SS-20|SS-600MP|LX|Voyager|SPARCClassic|SPARCbook|SS-2|SS-1000|SS-2000]
1443 a2502b58 blueswir1
1444 a2502b58 blueswir1
Set the emulated machine type. Default is SS-5.
1445 a2502b58 blueswir1
1446 3475187d bellard
@end table
1447 3475187d bellard
1448 5fafdf24 ths
@c man end
1449 3475187d bellard
1450 24d4de45 ths
@node Sparc64 System emulator
1451 24d4de45 ths
@section Sparc64 System emulator
1452 e80cfcfc bellard
1453 34a3d239 blueswir1
Use the executable @file{qemu-system-sparc64} to simulate a Sun4u
1454 34a3d239 blueswir1
(UltraSPARC PC-like machine), Sun4v (T1 PC-like machine), or generic
1455 34a3d239 blueswir1
Niagara (T1) machine. The emulator is not usable for anything yet, but
1456 34a3d239 blueswir1
it can launch some kernels.
1457 b756921a bellard
1458 c7ba218d blueswir1
QEMU emulates the following peripherals:
1459 83469015 bellard
1460 83469015 bellard
@itemize @minus
1461 83469015 bellard
@item
1462 5fafdf24 ths
UltraSparc IIi APB PCI Bridge
1463 83469015 bellard
@item
1464 83469015 bellard
PCI VGA compatible card with VESA Bochs Extensions
1465 83469015 bellard
@item
1466 34a3d239 blueswir1
PS/2 mouse and keyboard
1467 34a3d239 blueswir1
@item
1468 83469015 bellard
Non Volatile RAM M48T59
1469 83469015 bellard
@item
1470 83469015 bellard
PC-compatible serial ports
1471 c7ba218d blueswir1
@item
1472 c7ba218d blueswir1
2 PCI IDE interfaces with hard disk and CD-ROM support
1473 34a3d239 blueswir1
@item
1474 34a3d239 blueswir1
Floppy disk
1475 83469015 bellard
@end itemize
1476 83469015 bellard
1477 c7ba218d blueswir1
@c man begin OPTIONS
1478 c7ba218d blueswir1
1479 c7ba218d blueswir1
The following options are specific to the Sparc64 emulation:
1480 c7ba218d blueswir1
1481 c7ba218d blueswir1
@table @option
1482 c7ba218d blueswir1
1483 34a3d239 blueswir1
@item -prom-env string
1484 34a3d239 blueswir1
1485 34a3d239 blueswir1
Set OpenBIOS variables in NVRAM, for example:
1486 34a3d239 blueswir1
1487 34a3d239 blueswir1
@example
1488 34a3d239 blueswir1
qemu-system-sparc64 -prom-env 'auto-boot?=false'
1489 34a3d239 blueswir1
@end example
1490 34a3d239 blueswir1
1491 34a3d239 blueswir1
@item -M [sun4u|sun4v|Niagara]
1492 c7ba218d blueswir1
1493 c7ba218d blueswir1
Set the emulated machine type. The default is sun4u.
1494 c7ba218d blueswir1
1495 c7ba218d blueswir1
@end table
1496 c7ba218d blueswir1
1497 c7ba218d blueswir1
@c man end
1498 c7ba218d blueswir1
1499 24d4de45 ths
@node MIPS System emulator
1500 24d4de45 ths
@section MIPS System emulator
1501 9d0a8e6f bellard
1502 d9aedc32 ths
Four executables cover simulation of 32 and 64-bit MIPS systems in
1503 d9aedc32 ths
both endian options, @file{qemu-system-mips}, @file{qemu-system-mipsel}
1504 d9aedc32 ths
@file{qemu-system-mips64} and @file{qemu-system-mips64el}.
1505 88cb0a02 aurel32
Five different machine types are emulated:
1506 24d4de45 ths
1507 24d4de45 ths
@itemize @minus
1508 24d4de45 ths
@item
1509 24d4de45 ths
A generic ISA PC-like machine "mips"
1510 24d4de45 ths
@item
1511 24d4de45 ths
The MIPS Malta prototype board "malta"
1512 24d4de45 ths
@item
1513 d9aedc32 ths
An ACER Pica "pica61". This machine needs the 64-bit emulator.
1514 6bf5b4e8 ths
@item
1515 f0fc6f8f ths
MIPS emulator pseudo board "mipssim"
1516 88cb0a02 aurel32
@item
1517 88cb0a02 aurel32
A MIPS Magnum R4000 machine "magnum". This machine needs the 64-bit emulator.
1518 24d4de45 ths
@end itemize
1519 24d4de45 ths
1520 24d4de45 ths
The generic emulation is supported by Debian 'Etch' and is able to
1521 24d4de45 ths
install Debian into a virtual disk image. The following devices are
1522 24d4de45 ths
emulated:
1523 3f9f3aa1 bellard
1524 3f9f3aa1 bellard
@itemize @minus
1525 5fafdf24 ths
@item
1526 6bf5b4e8 ths
A range of MIPS CPUs, default is the 24Kf
1527 3f9f3aa1 bellard
@item
1528 3f9f3aa1 bellard
PC style serial port
1529 3f9f3aa1 bellard
@item
1530 24d4de45 ths
PC style IDE disk
1531 24d4de45 ths
@item
1532 3f9f3aa1 bellard
NE2000 network card
1533 3f9f3aa1 bellard
@end itemize
1534 3f9f3aa1 bellard
1535 24d4de45 ths
The Malta emulation supports the following devices:
1536 24d4de45 ths
1537 24d4de45 ths
@itemize @minus
1538 24d4de45 ths
@item
1539 0b64d008 ths
Core board with MIPS 24Kf CPU and Galileo system controller
1540 24d4de45 ths
@item
1541 24d4de45 ths
PIIX4 PCI/USB/SMbus controller
1542 24d4de45 ths
@item
1543 24d4de45 ths
The Multi-I/O chip's serial device
1544 24d4de45 ths
@item
1545 3a2eeac0 Stefan Weil
PCI network cards (PCnet32 and others)
1546 24d4de45 ths
@item
1547 24d4de45 ths
Malta FPGA serial device
1548 24d4de45 ths
@item
1549 1f605a76 aurel32
Cirrus (default) or any other PCI VGA graphics card
1550 24d4de45 ths
@end itemize
1551 24d4de45 ths
1552 24d4de45 ths
The ACER Pica emulation supports:
1553 24d4de45 ths
1554 24d4de45 ths
@itemize @minus
1555 24d4de45 ths
@item
1556 24d4de45 ths
MIPS R4000 CPU
1557 24d4de45 ths
@item
1558 24d4de45 ths
PC-style IRQ and DMA controllers
1559 24d4de45 ths
@item
1560 24d4de45 ths
PC Keyboard
1561 24d4de45 ths
@item
1562 24d4de45 ths
IDE controller
1563 24d4de45 ths
@end itemize
1564 3f9f3aa1 bellard
1565 f0fc6f8f ths
The mipssim pseudo board emulation provides an environment similiar
1566 f0fc6f8f ths
to what the proprietary MIPS emulator uses for running Linux.
1567 f0fc6f8f ths
It supports:
1568 6bf5b4e8 ths
1569 6bf5b4e8 ths
@itemize @minus
1570 6bf5b4e8 ths
@item
1571 6bf5b4e8 ths
A range of MIPS CPUs, default is the 24Kf
1572 6bf5b4e8 ths
@item
1573 6bf5b4e8 ths
PC style serial port
1574 6bf5b4e8 ths
@item
1575 6bf5b4e8 ths
MIPSnet network emulation
1576 6bf5b4e8 ths
@end itemize
1577 6bf5b4e8 ths
1578 88cb0a02 aurel32
The MIPS Magnum R4000 emulation supports:
1579 88cb0a02 aurel32
1580 88cb0a02 aurel32
@itemize @minus
1581 88cb0a02 aurel32
@item
1582 88cb0a02 aurel32
MIPS R4000 CPU
1583 88cb0a02 aurel32
@item
1584 88cb0a02 aurel32
PC-style IRQ controller
1585 88cb0a02 aurel32
@item
1586 88cb0a02 aurel32
PC Keyboard
1587 88cb0a02 aurel32
@item
1588 88cb0a02 aurel32
SCSI controller
1589 88cb0a02 aurel32
@item
1590 88cb0a02 aurel32
G364 framebuffer
1591 88cb0a02 aurel32
@end itemize
1592 88cb0a02 aurel32
1593 88cb0a02 aurel32
1594 24d4de45 ths
@node ARM System emulator
1595 24d4de45 ths
@section ARM System emulator
1596 3f9f3aa1 bellard
1597 3f9f3aa1 bellard
Use the executable @file{qemu-system-arm} to simulate a ARM
1598 3f9f3aa1 bellard
machine. The ARM Integrator/CP board is emulated with the following
1599 3f9f3aa1 bellard
devices:
1600 3f9f3aa1 bellard
1601 3f9f3aa1 bellard
@itemize @minus
1602 3f9f3aa1 bellard
@item
1603 9ee6e8bb pbrook
ARM926E, ARM1026E, ARM946E, ARM1136 or Cortex-A8 CPU
1604 3f9f3aa1 bellard
@item
1605 3f9f3aa1 bellard
Two PL011 UARTs
1606 5fafdf24 ths
@item
1607 3f9f3aa1 bellard
SMC 91c111 Ethernet adapter
1608 00a9bf19 pbrook
@item
1609 00a9bf19 pbrook
PL110 LCD controller
1610 00a9bf19 pbrook
@item
1611 00a9bf19 pbrook
PL050 KMI with PS/2 keyboard and mouse.
1612 a1bb27b1 pbrook
@item
1613 a1bb27b1 pbrook
PL181 MultiMedia Card Interface with SD card.
1614 00a9bf19 pbrook
@end itemize
1615 00a9bf19 pbrook
1616 00a9bf19 pbrook
The ARM Versatile baseboard is emulated with the following devices:
1617 00a9bf19 pbrook
1618 00a9bf19 pbrook
@itemize @minus
1619 00a9bf19 pbrook
@item
1620 9ee6e8bb pbrook
ARM926E, ARM1136 or Cortex-A8 CPU
1621 00a9bf19 pbrook
@item
1622 00a9bf19 pbrook
PL190 Vectored Interrupt Controller
1623 00a9bf19 pbrook
@item
1624 00a9bf19 pbrook
Four PL011 UARTs
1625 5fafdf24 ths
@item
1626 00a9bf19 pbrook
SMC 91c111 Ethernet adapter
1627 00a9bf19 pbrook
@item
1628 00a9bf19 pbrook
PL110 LCD controller
1629 00a9bf19 pbrook
@item
1630 00a9bf19 pbrook
PL050 KMI with PS/2 keyboard and mouse.
1631 00a9bf19 pbrook
@item
1632 00a9bf19 pbrook
PCI host bridge.  Note the emulated PCI bridge only provides access to
1633 00a9bf19 pbrook
PCI memory space.  It does not provide access to PCI IO space.
1634 4be456f1 ths
This means some devices (eg. ne2k_pci NIC) are not usable, and others
1635 4be456f1 ths
(eg. rtl8139 NIC) are only usable when the guest drivers use the memory
1636 00a9bf19 pbrook
mapped control registers.
1637 e6de1bad pbrook
@item
1638 e6de1bad pbrook
PCI OHCI USB controller.
1639 e6de1bad pbrook
@item
1640 e6de1bad pbrook
LSI53C895A PCI SCSI Host Bus Adapter with hard disk and CD-ROM devices.
1641 a1bb27b1 pbrook
@item
1642 a1bb27b1 pbrook
PL181 MultiMedia Card Interface with SD card.
1643 3f9f3aa1 bellard
@end itemize
1644 3f9f3aa1 bellard
1645 d7739d75 pbrook
The ARM RealView Emulation baseboard is emulated with the following devices:
1646 d7739d75 pbrook
1647 d7739d75 pbrook
@itemize @minus
1648 d7739d75 pbrook
@item
1649 9ee6e8bb pbrook
ARM926E, ARM1136, ARM11MPCORE(x4) or Cortex-A8 CPU
1650 d7739d75 pbrook
@item
1651 d7739d75 pbrook
ARM AMBA Generic/Distributed Interrupt Controller
1652 d7739d75 pbrook
@item
1653 d7739d75 pbrook
Four PL011 UARTs
1654 5fafdf24 ths
@item
1655 d7739d75 pbrook
SMC 91c111 Ethernet adapter
1656 d7739d75 pbrook
@item
1657 d7739d75 pbrook
PL110 LCD controller
1658 d7739d75 pbrook
@item
1659 d7739d75 pbrook
PL050 KMI with PS/2 keyboard and mouse
1660 d7739d75 pbrook
@item
1661 d7739d75 pbrook
PCI host bridge
1662 d7739d75 pbrook
@item
1663 d7739d75 pbrook
PCI OHCI USB controller
1664 d7739d75 pbrook
@item
1665 d7739d75 pbrook
LSI53C895A PCI SCSI Host Bus Adapter with hard disk and CD-ROM devices
1666 a1bb27b1 pbrook
@item
1667 a1bb27b1 pbrook
PL181 MultiMedia Card Interface with SD card.
1668 d7739d75 pbrook
@end itemize
1669 d7739d75 pbrook
1670 b00052e4 balrog
The XScale-based clamshell PDA models ("Spitz", "Akita", "Borzoi"
1671 b00052e4 balrog
and "Terrier") emulation includes the following peripherals:
1672 b00052e4 balrog
1673 b00052e4 balrog
@itemize @minus
1674 b00052e4 balrog
@item
1675 b00052e4 balrog
Intel PXA270 System-on-chip (ARM V5TE core)
1676 b00052e4 balrog
@item
1677 b00052e4 balrog
NAND Flash memory
1678 b00052e4 balrog
@item
1679 b00052e4 balrog
IBM/Hitachi DSCM microdrive in a PXA PCMCIA slot - not in "Akita"
1680 b00052e4 balrog
@item
1681 b00052e4 balrog
On-chip OHCI USB controller
1682 b00052e4 balrog
@item
1683 b00052e4 balrog
On-chip LCD controller
1684 b00052e4 balrog
@item
1685 b00052e4 balrog
On-chip Real Time Clock
1686 b00052e4 balrog
@item
1687 b00052e4 balrog
TI ADS7846 touchscreen controller on SSP bus
1688 b00052e4 balrog
@item
1689 b00052e4 balrog
Maxim MAX1111 analog-digital converter on I@math{^2}C bus
1690 b00052e4 balrog
@item
1691 b00052e4 balrog
GPIO-connected keyboard controller and LEDs
1692 b00052e4 balrog
@item
1693 549444e1 balrog
Secure Digital card connected to PXA MMC/SD host
1694 b00052e4 balrog
@item
1695 b00052e4 balrog
Three on-chip UARTs
1696 b00052e4 balrog
@item
1697 b00052e4 balrog
WM8750 audio CODEC on I@math{^2}C and I@math{^2}S busses
1698 b00052e4 balrog
@end itemize
1699 b00052e4 balrog
1700 02645926 balrog
The Palm Tungsten|E PDA (codename "Cheetah") emulation includes the
1701 02645926 balrog
following elements:
1702 02645926 balrog
1703 02645926 balrog
@itemize @minus
1704 02645926 balrog
@item
1705 02645926 balrog
Texas Instruments OMAP310 System-on-chip (ARM 925T core)
1706 02645926 balrog
@item
1707 02645926 balrog
ROM and RAM memories (ROM firmware image can be loaded with -option-rom)
1708 02645926 balrog
@item
1709 02645926 balrog
On-chip LCD controller
1710 02645926 balrog
@item
1711 02645926 balrog
On-chip Real Time Clock
1712 02645926 balrog
@item
1713 02645926 balrog
TI TSC2102i touchscreen controller / analog-digital converter / Audio
1714 02645926 balrog
CODEC, connected through MicroWire and I@math{^2}S busses
1715 02645926 balrog
@item
1716 02645926 balrog
GPIO-connected matrix keypad
1717 02645926 balrog
@item
1718 02645926 balrog
Secure Digital card connected to OMAP MMC/SD host
1719 02645926 balrog
@item
1720 02645926 balrog
Three on-chip UARTs
1721 02645926 balrog
@end itemize
1722 02645926 balrog
1723 c30bb264 balrog
Nokia N800 and N810 internet tablets (known also as RX-34 and RX-44 / 48)
1724 c30bb264 balrog
emulation supports the following elements:
1725 c30bb264 balrog
1726 c30bb264 balrog
@itemize @minus
1727 c30bb264 balrog
@item
1728 c30bb264 balrog
Texas Instruments OMAP2420 System-on-chip (ARM 1136 core)
1729 c30bb264 balrog
@item
1730 c30bb264 balrog
RAM and non-volatile OneNAND Flash memories
1731 c30bb264 balrog
@item
1732 c30bb264 balrog
Display connected to EPSON remote framebuffer chip and OMAP on-chip
1733 c30bb264 balrog
display controller and a LS041y3 MIPI DBI-C controller
1734 c30bb264 balrog
@item
1735 c30bb264 balrog
TI TSC2301 (in N800) and TI TSC2005 (in N810) touchscreen controllers
1736 c30bb264 balrog
driven through SPI bus
1737 c30bb264 balrog
@item
1738 c30bb264 balrog
National Semiconductor LM8323-controlled qwerty keyboard driven
1739 c30bb264 balrog
through I@math{^2}C bus
1740 c30bb264 balrog
@item
1741 c30bb264 balrog
Secure Digital card connected to OMAP MMC/SD host
1742 c30bb264 balrog
@item
1743 c30bb264 balrog
Three OMAP on-chip UARTs and on-chip STI debugging console
1744 c30bb264 balrog
@item
1745 2d564691 balrog
A Bluetooth(R) transciever and HCI connected to an UART
1746 2d564691 balrog
@item
1747 c30bb264 balrog
Mentor Graphics "Inventra" dual-role USB controller embedded in a TI
1748 c30bb264 balrog
TUSB6010 chip - only USB host mode is supported
1749 c30bb264 balrog
@item
1750 c30bb264 balrog
TI TMP105 temperature sensor driven through I@math{^2}C bus
1751 c30bb264 balrog
@item
1752 c30bb264 balrog
TI TWL92230C power management companion with an RTC on I@math{^2}C bus
1753 c30bb264 balrog
@item
1754 c30bb264 balrog
Nokia RETU and TAHVO multi-purpose chips with an RTC, connected
1755 c30bb264 balrog
through CBUS
1756 c30bb264 balrog
@end itemize
1757 c30bb264 balrog
1758 9ee6e8bb pbrook
The Luminary Micro Stellaris LM3S811EVB emulation includes the following
1759 9ee6e8bb pbrook
devices:
1760 9ee6e8bb pbrook
1761 9ee6e8bb pbrook
@itemize @minus
1762 9ee6e8bb pbrook
@item
1763 9ee6e8bb pbrook
Cortex-M3 CPU core.
1764 9ee6e8bb pbrook
@item
1765 9ee6e8bb pbrook
64k Flash and 8k SRAM.
1766 9ee6e8bb pbrook
@item
1767 9ee6e8bb pbrook
Timers, UARTs, ADC and I@math{^2}C interface.
1768 9ee6e8bb pbrook
@item
1769 9ee6e8bb pbrook
OSRAM Pictiva 96x16 OLED with SSD0303 controller on I@math{^2}C bus.
1770 9ee6e8bb pbrook
@end itemize
1771 9ee6e8bb pbrook
1772 9ee6e8bb pbrook
The Luminary Micro Stellaris LM3S6965EVB emulation includes the following
1773 9ee6e8bb pbrook
devices:
1774 9ee6e8bb pbrook
1775 9ee6e8bb pbrook
@itemize @minus
1776 9ee6e8bb pbrook
@item
1777 9ee6e8bb pbrook
Cortex-M3 CPU core.
1778 9ee6e8bb pbrook
@item
1779 9ee6e8bb pbrook
256k Flash and 64k SRAM.
1780 9ee6e8bb pbrook
@item
1781 9ee6e8bb pbrook
Timers, UARTs, ADC, I@math{^2}C and SSI interfaces.
1782 9ee6e8bb pbrook
@item
1783 9ee6e8bb pbrook
OSRAM Pictiva 128x64 OLED with SSD0323 controller connected via SSI.
1784 9ee6e8bb pbrook
@end itemize
1785 9ee6e8bb pbrook
1786 57cd6e97 balrog
The Freecom MusicPal internet radio emulation includes the following
1787 57cd6e97 balrog
elements:
1788 57cd6e97 balrog
1789 57cd6e97 balrog
@itemize @minus
1790 57cd6e97 balrog
@item
1791 57cd6e97 balrog
Marvell MV88W8618 ARM core.
1792 57cd6e97 balrog
@item
1793 57cd6e97 balrog
32 MB RAM, 256 KB SRAM, 8 MB flash.
1794 57cd6e97 balrog
@item
1795 57cd6e97 balrog
Up to 2 16550 UARTs
1796 57cd6e97 balrog
@item
1797 57cd6e97 balrog
MV88W8xx8 Ethernet controller
1798 57cd6e97 balrog
@item
1799 57cd6e97 balrog
MV88W8618 audio controller, WM8750 CODEC and mixer
1800 57cd6e97 balrog
@item
1801 57cd6e97 balrog
128?64 display with brightness control
1802 57cd6e97 balrog
@item
1803 57cd6e97 balrog
2 buttons, 2 navigation wheels with button function
1804 57cd6e97 balrog
@end itemize
1805 57cd6e97 balrog
1806 997641a8 balrog
The Siemens SX1 models v1 and v2 (default) basic emulation.
1807 997641a8 balrog
The emulaton includes the following elements:
1808 997641a8 balrog
1809 997641a8 balrog
@itemize @minus
1810 997641a8 balrog
@item
1811 997641a8 balrog
Texas Instruments OMAP310 System-on-chip (ARM 925T core)
1812 997641a8 balrog
@item
1813 997641a8 balrog
ROM and RAM memories (ROM firmware image can be loaded with -pflash)
1814 997641a8 balrog
V1
1815 997641a8 balrog
1 Flash of 16MB and 1 Flash of 8MB
1816 997641a8 balrog
V2
1817 997641a8 balrog
1 Flash of 32MB
1818 997641a8 balrog
@item
1819 997641a8 balrog
On-chip LCD controller
1820 997641a8 balrog
@item
1821 997641a8 balrog
On-chip Real Time Clock
1822 997641a8 balrog
@item
1823 997641a8 balrog
Secure Digital card connected to OMAP MMC/SD host
1824 997641a8 balrog
@item
1825 997641a8 balrog
Three on-chip UARTs
1826 997641a8 balrog
@end itemize
1827 997641a8 balrog
1828 4af39611 Paul Brook
The "Syborg" Symbian Virtual Platform base model includes the following
1829 4af39611 Paul Brook
elements:
1830 4af39611 Paul Brook
1831 4af39611 Paul Brook
@itemize @minus
1832 4af39611 Paul Brook
@item
1833 4af39611 Paul Brook
ARM Cortex-A8 CPU
1834 4af39611 Paul Brook
@item
1835 4af39611 Paul Brook
Interrupt controller
1836 4af39611 Paul Brook
@item
1837 4af39611 Paul Brook
Timer
1838 4af39611 Paul Brook
@item
1839 4af39611 Paul Brook
Real Time Clock
1840 4af39611 Paul Brook
@item
1841 4af39611 Paul Brook
Keyboard
1842 4af39611 Paul Brook
@item
1843 4af39611 Paul Brook
Framebuffer
1844 4af39611 Paul Brook
@item
1845 4af39611 Paul Brook
Touchscreen
1846 4af39611 Paul Brook
@item
1847 4af39611 Paul Brook
UARTs
1848 4af39611 Paul Brook
@end itemize
1849 4af39611 Paul Brook
1850 3f9f3aa1 bellard
A Linux 2.6 test image is available on the QEMU web site. More
1851 3f9f3aa1 bellard
information is available in the QEMU mailing-list archive.
1852 9d0a8e6f bellard
1853 d2c639d6 blueswir1
@c man begin OPTIONS
1854 d2c639d6 blueswir1
1855 d2c639d6 blueswir1
The following options are specific to the ARM emulation:
1856 d2c639d6 blueswir1
1857 d2c639d6 blueswir1
@table @option
1858 d2c639d6 blueswir1
1859 d2c639d6 blueswir1
@item -semihosting
1860 d2c639d6 blueswir1
Enable semihosting syscall emulation.
1861 d2c639d6 blueswir1
1862 d2c639d6 blueswir1
On ARM this implements the "Angel" interface.
1863 d2c639d6 blueswir1
1864 d2c639d6 blueswir1
Note that this allows guest direct access to the host filesystem,
1865 d2c639d6 blueswir1
so should only be used with trusted guest OS.
1866 d2c639d6 blueswir1
1867 d2c639d6 blueswir1
@end table
1868 d2c639d6 blueswir1
1869 24d4de45 ths
@node ColdFire System emulator
1870 24d4de45 ths
@section ColdFire System emulator
1871 209a4e69 pbrook
1872 209a4e69 pbrook
Use the executable @file{qemu-system-m68k} to simulate a ColdFire machine.
1873 209a4e69 pbrook
The emulator is able to boot a uClinux kernel.
1874 707e011b pbrook
1875 707e011b pbrook
The M5208EVB emulation includes the following devices:
1876 707e011b pbrook
1877 707e011b pbrook
@itemize @minus
1878 5fafdf24 ths
@item
1879 707e011b pbrook
MCF5208 ColdFire V2 Microprocessor (ISA A+ with EMAC).
1880 707e011b pbrook
@item
1881 707e011b pbrook
Three Two on-chip UARTs.
1882 707e011b pbrook
@item
1883 707e011b pbrook
Fast Ethernet Controller (FEC)
1884 707e011b pbrook
@end itemize
1885 707e011b pbrook
1886 707e011b pbrook
The AN5206 emulation includes the following devices:
1887 209a4e69 pbrook
1888 209a4e69 pbrook
@itemize @minus
1889 5fafdf24 ths
@item
1890 209a4e69 pbrook
MCF5206 ColdFire V2 Microprocessor.
1891 209a4e69 pbrook
@item
1892 209a4e69 pbrook
Two on-chip UARTs.
1893 209a4e69 pbrook
@end itemize
1894 209a4e69 pbrook
1895 d2c639d6 blueswir1
@c man begin OPTIONS
1896 d2c639d6 blueswir1
1897 d2c639d6 blueswir1
The following options are specific to the ARM emulation:
1898 d2c639d6 blueswir1
1899 d2c639d6 blueswir1
@table @option
1900 d2c639d6 blueswir1
1901 d2c639d6 blueswir1
@item -semihosting
1902 d2c639d6 blueswir1
Enable semihosting syscall emulation.
1903 d2c639d6 blueswir1
1904 d2c639d6 blueswir1
On M68K this implements the "ColdFire GDB" interface used by libgloss.
1905 d2c639d6 blueswir1
1906 d2c639d6 blueswir1
Note that this allows guest direct access to the host filesystem,
1907 d2c639d6 blueswir1
so should only be used with trusted guest OS.
1908 d2c639d6 blueswir1
1909 d2c639d6 blueswir1
@end table
1910 d2c639d6 blueswir1
1911 5fafdf24 ths
@node QEMU User space emulator
1912 5fafdf24 ths
@chapter QEMU User space emulator
1913 83195237 bellard
1914 83195237 bellard
@menu
1915 83195237 bellard
* Supported Operating Systems ::
1916 83195237 bellard
* Linux User space emulator::
1917 83195237 bellard
* Mac OS X/Darwin User space emulator ::
1918 84778508 blueswir1
* BSD User space emulator ::
1919 83195237 bellard
@end menu
1920 83195237 bellard
1921 83195237 bellard
@node Supported Operating Systems
1922 83195237 bellard
@section Supported Operating Systems
1923 83195237 bellard
1924 83195237 bellard
The following OS are supported in user space emulation:
1925 83195237 bellard
1926 83195237 bellard
@itemize @minus
1927 83195237 bellard
@item
1928 4be456f1 ths
Linux (referred as qemu-linux-user)
1929 83195237 bellard
@item
1930 4be456f1 ths
Mac OS X/Darwin (referred as qemu-darwin-user)
1931 84778508 blueswir1
@item
1932 84778508 blueswir1
BSD (referred as qemu-bsd-user)
1933 83195237 bellard
@end itemize
1934 83195237 bellard
1935 83195237 bellard
@node Linux User space emulator
1936 83195237 bellard
@section Linux User space emulator
1937 386405f7 bellard
1938 debc7065 bellard
@menu
1939 debc7065 bellard
* Quick Start::
1940 debc7065 bellard
* Wine launch::
1941 debc7065 bellard
* Command line options::
1942 79737e4a pbrook
* Other binaries::
1943 debc7065 bellard
@end menu
1944 debc7065 bellard
1945 debc7065 bellard
@node Quick Start
1946 83195237 bellard
@subsection Quick Start
1947 df0f11a0 bellard
1948 1f673135 bellard
In order to launch a Linux process, QEMU needs the process executable
1949 5fafdf24 ths
itself and all the target (x86) dynamic libraries used by it.
1950 386405f7 bellard
1951 1f673135 bellard
@itemize
1952 386405f7 bellard
1953 1f673135 bellard
@item On x86, you can just try to launch any process by using the native
1954 1f673135 bellard
libraries:
1955 386405f7 bellard
1956 5fafdf24 ths
@example
1957 1f673135 bellard
qemu-i386 -L / /bin/ls
1958 1f673135 bellard
@end example
1959 386405f7 bellard
1960 1f673135 bellard
@code{-L /} tells that the x86 dynamic linker must be searched with a
1961 1f673135 bellard
@file{/} prefix.
1962 386405f7 bellard
1963 dbcf5e82 ths
@item Since QEMU is also a linux process, you can launch qemu with
1964 dbcf5e82 ths
qemu (NOTE: you can only do that if you compiled QEMU from the sources):
1965 386405f7 bellard
1966 5fafdf24 ths
@example
1967 1f673135 bellard
qemu-i386 -L / qemu-i386 -L / /bin/ls
1968 1f673135 bellard
@end example
1969 386405f7 bellard
1970 1f673135 bellard
@item On non x86 CPUs, you need first to download at least an x86 glibc
1971 1f673135 bellard
(@file{qemu-runtime-i386-XXX-.tar.gz} on the QEMU web page). Ensure that
1972 1f673135 bellard
@code{LD_LIBRARY_PATH} is not set:
1973 df0f11a0 bellard
1974 1f673135 bellard
@example
1975 5fafdf24 ths
unset LD_LIBRARY_PATH
1976 1f673135 bellard
@end example
1977 1eb87257 bellard
1978 1f673135 bellard
Then you can launch the precompiled @file{ls} x86 executable:
1979 1eb87257 bellard
1980 1f673135 bellard
@example
1981 1f673135 bellard
qemu-i386 tests/i386/ls
1982 1f673135 bellard
@end example
1983 1f673135 bellard
You can look at @file{qemu-binfmt-conf.sh} so that
1984 1f673135 bellard
QEMU is automatically launched by the Linux kernel when you try to
1985 1f673135 bellard
launch x86 executables. It requires the @code{binfmt_misc} module in the
1986 1f673135 bellard
Linux kernel.
1987 1eb87257 bellard
1988 1f673135 bellard
@item The x86 version of QEMU is also included. You can try weird things such as:
1989 1f673135 bellard
@example
1990 debc7065 bellard
qemu-i386 /usr/local/qemu-i386/bin/qemu-i386 \
1991 debc7065 bellard
          /usr/local/qemu-i386/bin/ls-i386
1992 1f673135 bellard
@end example
1993 1eb20527 bellard
1994 1f673135 bellard
@end itemize
1995 1eb20527 bellard
1996 debc7065 bellard
@node Wine launch
1997 83195237 bellard
@subsection Wine launch
1998 1eb20527 bellard
1999 1f673135 bellard
@itemize
2000 386405f7 bellard
2001 1f673135 bellard
@item Ensure that you have a working QEMU with the x86 glibc
2002 1f673135 bellard
distribution (see previous section). In order to verify it, you must be
2003 1f673135 bellard
able to do:
2004 386405f7 bellard
2005 1f673135 bellard
@example
2006 1f673135 bellard
qemu-i386 /usr/local/qemu-i386/bin/ls-i386
2007 1f673135 bellard
@end example
2008 386405f7 bellard
2009 1f673135 bellard
@item Download the binary x86 Wine install
2010 5fafdf24 ths
(@file{qemu-XXX-i386-wine.tar.gz} on the QEMU web page).
2011 386405f7 bellard
2012 1f673135 bellard
@item Configure Wine on your account. Look at the provided script
2013 debc7065 bellard
@file{/usr/local/qemu-i386/@/bin/wine-conf.sh}. Your previous
2014 1f673135 bellard
@code{$@{HOME@}/.wine} directory is saved to @code{$@{HOME@}/.wine.org}.
2015 386405f7 bellard
2016 1f673135 bellard
@item Then you can try the example @file{putty.exe}:
2017 386405f7 bellard
2018 1f673135 bellard
@example
2019 debc7065 bellard
qemu-i386 /usr/local/qemu-i386/wine/bin/wine \
2020 debc7065 bellard
          /usr/local/qemu-i386/wine/c/Program\ Files/putty.exe
2021 1f673135 bellard
@end example
2022 386405f7 bellard
2023 1f673135 bellard
@end itemize
2024 fd429f2f bellard
2025 debc7065 bellard
@node Command line options
2026 83195237 bellard
@subsection Command line options
2027 1eb20527 bellard
2028 1f673135 bellard
@example
2029 379f6698 Paul Brook
usage: qemu-i386 [-h] [-d] [-L path] [-s size] [-cpu model] [-g port] [-B offset] program [arguments...]
2030 1f673135 bellard
@end example
2031 1eb20527 bellard
2032 1f673135 bellard
@table @option
2033 1f673135 bellard
@item -h
2034 1f673135 bellard
Print the help
2035 3b46e624 ths
@item -L path
2036 1f673135 bellard
Set the x86 elf interpreter prefix (default=/usr/local/qemu-i386)
2037 1f673135 bellard
@item -s size
2038 1f673135 bellard
Set the x86 stack size in bytes (default=524288)
2039 34a3d239 blueswir1
@item -cpu model
2040 34a3d239 blueswir1
Select CPU model (-cpu ? for list and additional feature selection)
2041 379f6698 Paul Brook
@item -B offset
2042 379f6698 Paul Brook
Offset guest address by the specified number of bytes.  This is useful when
2043 379f6698 Paul Brook
the address region rewuired by guest applications is reserved on the host.
2044 379f6698 Paul Brook
Ths option is currently only supported on some hosts.
2045 386405f7 bellard
@end table
2046 386405f7 bellard
2047 1f673135 bellard
Debug options:
2048 386405f7 bellard
2049 1f673135 bellard
@table @option
2050 1f673135 bellard
@item -d
2051 1f673135 bellard
Activate log (logfile=/tmp/qemu.log)
2052 1f673135 bellard
@item -p pagesize
2053 1f673135 bellard
Act as if the host page size was 'pagesize' bytes
2054 34a3d239 blueswir1
@item -g port
2055 34a3d239 blueswir1
Wait gdb connection to port
2056 1b530a6d aurel32
@item -singlestep
2057 1b530a6d aurel32
Run the emulation in single step mode.
2058 1f673135 bellard
@end table
2059 386405f7 bellard
2060 b01bcae6 balrog
Environment variables:
2061 b01bcae6 balrog
2062 b01bcae6 balrog
@table @env
2063 b01bcae6 balrog
@item QEMU_STRACE
2064 b01bcae6 balrog
Print system calls and arguments similar to the 'strace' program
2065 b01bcae6 balrog
(NOTE: the actual 'strace' program will not work because the user
2066 b01bcae6 balrog
space emulator hasn't implemented ptrace).  At the moment this is
2067 b01bcae6 balrog
incomplete.  All system calls that don't have a specific argument
2068 b01bcae6 balrog
format are printed with information for six arguments.  Many
2069 b01bcae6 balrog
flag-style arguments don't have decoders and will show up as numbers.
2070 5cfdf930 ths
@end table
2071 b01bcae6 balrog
2072 79737e4a pbrook
@node Other binaries
2073 83195237 bellard
@subsection Other binaries
2074 79737e4a pbrook
2075 79737e4a pbrook
@command{qemu-arm} is also capable of running ARM "Angel" semihosted ELF
2076 79737e4a pbrook
binaries (as implemented by the arm-elf and arm-eabi Newlib/GDB
2077 79737e4a pbrook
configurations), and arm-uclinux bFLT format binaries.
2078 79737e4a pbrook
2079 e6e5906b pbrook
@command{qemu-m68k} is capable of running semihosted binaries using the BDM
2080 e6e5906b pbrook
(m5xxx-ram-hosted.ld) or m68k-sim (sim.ld) syscall interfaces, and
2081 e6e5906b pbrook
coldfire uClinux bFLT format binaries.
2082 e6e5906b pbrook
2083 79737e4a pbrook
The binary format is detected automatically.
2084 79737e4a pbrook
2085 34a3d239 blueswir1
@command{qemu-sparc} can execute Sparc32 binaries (Sparc32 CPU, 32 bit ABI).
2086 34a3d239 blueswir1
2087 a785e42e blueswir1
@command{qemu-sparc32plus} can execute Sparc32 and SPARC32PLUS binaries
2088 a785e42e blueswir1
(Sparc64 CPU, 32 bit ABI).
2089 a785e42e blueswir1
2090 a785e42e blueswir1
@command{qemu-sparc64} can execute some Sparc64 (Sparc64 CPU, 64 bit ABI) and
2091 a785e42e blueswir1
SPARC32PLUS binaries (Sparc64 CPU, 32 bit ABI).
2092 a785e42e blueswir1
2093 83195237 bellard
@node Mac OS X/Darwin User space emulator
2094 83195237 bellard
@section Mac OS X/Darwin User space emulator
2095 83195237 bellard
2096 83195237 bellard
@menu
2097 83195237 bellard
* Mac OS X/Darwin Status::
2098 83195237 bellard
* Mac OS X/Darwin Quick Start::
2099 83195237 bellard
* Mac OS X/Darwin Command line options::
2100 83195237 bellard
@end menu
2101 83195237 bellard
2102 83195237 bellard
@node Mac OS X/Darwin Status
2103 83195237 bellard
@subsection Mac OS X/Darwin Status
2104 83195237 bellard
2105 83195237 bellard
@itemize @minus
2106 83195237 bellard
@item
2107 83195237 bellard
target x86 on x86: Most apps (Cocoa and Carbon too) works. [1]
2108 83195237 bellard
@item
2109 83195237 bellard
target PowerPC on x86: Not working as the ppc commpage can't be mapped (yet!)
2110 83195237 bellard
@item
2111 dbcf5e82 ths
target PowerPC on PowerPC: Most apps (Cocoa and Carbon too) works. [1]
2112 83195237 bellard
@item
2113 83195237 bellard
target x86 on PowerPC: most utilities work. Cocoa and Carbon apps are not yet supported.
2114 83195237 bellard
@end itemize
2115 83195237 bellard
2116 83195237 bellard
[1] If you're host commpage can be executed by qemu.
2117 83195237 bellard
2118 83195237 bellard
@node Mac OS X/Darwin Quick Start
2119 83195237 bellard
@subsection Quick Start
2120 83195237 bellard
2121 83195237 bellard
In order to launch a Mac OS X/Darwin process, QEMU needs the process executable
2122 83195237 bellard
itself and all the target dynamic libraries used by it. If you don't have the FAT
2123 83195237 bellard
libraries (you're running Mac OS X/ppc) you'll need to obtain it from a Mac OS X
2124 83195237 bellard
CD or compile them by hand.
2125 83195237 bellard
2126 83195237 bellard
@itemize
2127 83195237 bellard
2128 83195237 bellard
@item On x86, you can just try to launch any process by using the native
2129 83195237 bellard
libraries:
2130 83195237 bellard
2131 5fafdf24 ths
@example
2132 dbcf5e82 ths
qemu-i386 /bin/ls
2133 83195237 bellard
@end example
2134 83195237 bellard
2135 83195237 bellard
or to run the ppc version of the executable:
2136 83195237 bellard
2137 5fafdf24 ths
@example
2138 dbcf5e82 ths
qemu-ppc /bin/ls
2139 83195237 bellard
@end example
2140 83195237 bellard
2141 83195237 bellard
@item On ppc, you'll have to tell qemu where your x86 libraries (and dynamic linker)
2142 83195237 bellard
are installed:
2143 83195237 bellard
2144 5fafdf24 ths
@example
2145 dbcf5e82 ths
qemu-i386 -L /opt/x86_root/ /bin/ls
2146 83195237 bellard
@end example
2147 83195237 bellard
2148 83195237 bellard
@code{-L /opt/x86_root/} tells that the dynamic linker (dyld) path is in
2149 83195237 bellard
@file{/opt/x86_root/usr/bin/dyld}.
2150 83195237 bellard
2151 83195237 bellard
@end itemize
2152 83195237 bellard
2153 83195237 bellard
@node Mac OS X/Darwin Command line options
2154 83195237 bellard
@subsection Command line options
2155 83195237 bellard
2156 83195237 bellard
@example
2157 dbcf5e82 ths
usage: qemu-i386 [-h] [-d] [-L path] [-s size] program [arguments...]
2158 83195237 bellard
@end example
2159 83195237 bellard
2160 83195237 bellard
@table @option
2161 83195237 bellard
@item -h
2162 83195237 bellard
Print the help
2163 3b46e624 ths
@item -L path
2164 83195237 bellard
Set the library root path (default=/)
2165 83195237 bellard
@item -s size
2166 83195237 bellard
Set the stack size in bytes (default=524288)
2167 83195237 bellard
@end table
2168 83195237 bellard
2169 83195237 bellard
Debug options:
2170 83195237 bellard
2171 83195237 bellard
@table @option
2172 83195237 bellard
@item -d
2173 83195237 bellard
Activate log (logfile=/tmp/qemu.log)
2174 83195237 bellard
@item -p pagesize
2175 83195237 bellard
Act as if the host page size was 'pagesize' bytes
2176 1b530a6d aurel32
@item -singlestep
2177 1b530a6d aurel32
Run the emulation in single step mode.
2178 83195237 bellard
@end table
2179 83195237 bellard
2180 84778508 blueswir1
@node BSD User space emulator
2181 84778508 blueswir1
@section BSD User space emulator
2182 84778508 blueswir1
2183 84778508 blueswir1
@menu
2184 84778508 blueswir1
* BSD Status::
2185 84778508 blueswir1
* BSD Quick Start::
2186 84778508 blueswir1
* BSD Command line options::
2187 84778508 blueswir1
@end menu
2188 84778508 blueswir1
2189 84778508 blueswir1
@node BSD Status
2190 84778508 blueswir1
@subsection BSD Status
2191 84778508 blueswir1
2192 84778508 blueswir1
@itemize @minus
2193 84778508 blueswir1
@item
2194 84778508 blueswir1
target Sparc64 on Sparc64: Some trivial programs work.
2195 84778508 blueswir1
@end itemize
2196 84778508 blueswir1
2197 84778508 blueswir1
@node BSD Quick Start
2198 84778508 blueswir1
@subsection Quick Start
2199 84778508 blueswir1
2200 84778508 blueswir1
In order to launch a BSD process, QEMU needs the process executable
2201 84778508 blueswir1
itself and all the target dynamic libraries used by it.
2202 84778508 blueswir1
2203 84778508 blueswir1
@itemize
2204 84778508 blueswir1
2205 84778508 blueswir1
@item On Sparc64, you can just try to launch any process by using the native
2206 84778508 blueswir1
libraries:
2207 84778508 blueswir1
2208 84778508 blueswir1
@example
2209 84778508 blueswir1
qemu-sparc64 /bin/ls
2210 84778508 blueswir1
@end example
2211 84778508 blueswir1
2212 84778508 blueswir1
@end itemize
2213 84778508 blueswir1
2214 84778508 blueswir1
@node BSD Command line options
2215 84778508 blueswir1
@subsection Command line options
2216 84778508 blueswir1
2217 84778508 blueswir1
@example
2218 84778508 blueswir1
usage: qemu-sparc64 [-h] [-d] [-L path] [-s size] [-bsd type] program [arguments...]
2219 84778508 blueswir1
@end example
2220 84778508 blueswir1
2221 84778508 blueswir1
@table @option
2222 84778508 blueswir1
@item -h
2223 84778508 blueswir1
Print the help
2224 84778508 blueswir1
@item -L path
2225 84778508 blueswir1
Set the library root path (default=/)
2226 84778508 blueswir1
@item -s size
2227 84778508 blueswir1
Set the stack size in bytes (default=524288)
2228 84778508 blueswir1
@item -bsd type
2229 84778508 blueswir1
Set the type of the emulated BSD Operating system. Valid values are
2230 84778508 blueswir1
FreeBSD, NetBSD and OpenBSD (default).
2231 84778508 blueswir1
@end table
2232 84778508 blueswir1
2233 84778508 blueswir1
Debug options:
2234 84778508 blueswir1
2235 84778508 blueswir1
@table @option
2236 84778508 blueswir1
@item -d
2237 84778508 blueswir1
Activate log (logfile=/tmp/qemu.log)
2238 84778508 blueswir1
@item -p pagesize
2239 84778508 blueswir1
Act as if the host page size was 'pagesize' bytes
2240 1b530a6d aurel32
@item -singlestep
2241 1b530a6d aurel32
Run the emulation in single step mode.
2242 84778508 blueswir1
@end table
2243 84778508 blueswir1
2244 15a34c63 bellard
@node compilation
2245 15a34c63 bellard
@chapter Compilation from the sources
2246 15a34c63 bellard
2247 debc7065 bellard
@menu
2248 debc7065 bellard
* Linux/Unix::
2249 debc7065 bellard
* Windows::
2250 debc7065 bellard
* Cross compilation for Windows with Linux::
2251 debc7065 bellard
* Mac OS X::
2252 debc7065 bellard
@end menu
2253 debc7065 bellard
2254 debc7065 bellard
@node Linux/Unix
2255 7c3fc84d bellard
@section Linux/Unix
2256 7c3fc84d bellard
2257 7c3fc84d bellard
@subsection Compilation
2258 7c3fc84d bellard
2259 7c3fc84d bellard
First you must decompress the sources:
2260 7c3fc84d bellard
@example
2261 7c3fc84d bellard
cd /tmp
2262 7c3fc84d bellard
tar zxvf qemu-x.y.z.tar.gz
2263 7c3fc84d bellard
cd qemu-x.y.z
2264 7c3fc84d bellard
@end example
2265 7c3fc84d bellard
2266 7c3fc84d bellard
Then you configure QEMU and build it (usually no options are needed):
2267 7c3fc84d bellard
@example
2268 7c3fc84d bellard
./configure
2269 7c3fc84d bellard
make
2270 7c3fc84d bellard
@end example
2271 7c3fc84d bellard
2272 7c3fc84d bellard
Then type as root user:
2273 7c3fc84d bellard
@example
2274 7c3fc84d bellard
make install
2275 7c3fc84d bellard
@end example
2276 7c3fc84d bellard
to install QEMU in @file{/usr/local}.
2277 7c3fc84d bellard
2278 debc7065 bellard
@node Windows
2279 15a34c63 bellard
@section Windows
2280 15a34c63 bellard
2281 15a34c63 bellard
@itemize
2282 15a34c63 bellard
@item Install the current versions of MSYS and MinGW from
2283 15a34c63 bellard
@url{http://www.mingw.org/}. You can find detailed installation
2284 15a34c63 bellard
instructions in the download section and the FAQ.
2285 15a34c63 bellard
2286 5fafdf24 ths
@item Download
2287 15a34c63 bellard
the MinGW development library of SDL 1.2.x
2288 debc7065 bellard
(@file{SDL-devel-1.2.x-@/mingw32.tar.gz}) from
2289 15a34c63 bellard
@url{http://www.libsdl.org}. Unpack it in a temporary place, and
2290 15a34c63 bellard
unpack the archive @file{i386-mingw32msvc.tar.gz} in the MinGW tool
2291 15a34c63 bellard
directory. Edit the @file{sdl-config} script so that it gives the
2292 15a34c63 bellard
correct SDL directory when invoked.
2293 15a34c63 bellard
2294 15a34c63 bellard
@item Extract the current version of QEMU.
2295 5fafdf24 ths
2296 15a34c63 bellard
@item Start the MSYS shell (file @file{msys.bat}).
2297 15a34c63 bellard
2298 5fafdf24 ths
@item Change to the QEMU directory. Launch @file{./configure} and
2299 15a34c63 bellard
@file{make}.  If you have problems using SDL, verify that
2300 15a34c63 bellard
@file{sdl-config} can be launched from the MSYS command line.
2301 15a34c63 bellard
2302 5fafdf24 ths
@item You can install QEMU in @file{Program Files/Qemu} by typing
2303 15a34c63 bellard
@file{make install}. Don't forget to copy @file{SDL.dll} in
2304 15a34c63 bellard
@file{Program Files/Qemu}.
2305 15a34c63 bellard
2306 15a34c63 bellard
@end itemize
2307 15a34c63 bellard
2308 debc7065 bellard
@node Cross compilation for Windows with Linux
2309 15a34c63 bellard
@section Cross compilation for Windows with Linux
2310 15a34c63 bellard
2311 15a34c63 bellard
@itemize
2312 15a34c63 bellard
@item
2313 15a34c63 bellard
Install the MinGW cross compilation tools available at
2314 15a34c63 bellard
@url{http://www.mingw.org/}.
2315 15a34c63 bellard
2316 5fafdf24 ths
@item
2317 15a34c63 bellard
Install the Win32 version of SDL (@url{http://www.libsdl.org}) by
2318 15a34c63 bellard
unpacking @file{i386-mingw32msvc.tar.gz}. Set up the PATH environment
2319 15a34c63 bellard
variable so that @file{i386-mingw32msvc-sdl-config} can be launched by
2320 15a34c63 bellard
the QEMU configuration script.
2321 15a34c63 bellard
2322 5fafdf24 ths
@item
2323 15a34c63 bellard
Configure QEMU for Windows cross compilation:
2324 15a34c63 bellard
@example
2325 15a34c63 bellard
./configure --enable-mingw32
2326 15a34c63 bellard
@end example
2327 15a34c63 bellard
If necessary, you can change the cross-prefix according to the prefix
2328 4be456f1 ths
chosen for the MinGW tools with --cross-prefix. You can also use
2329 15a34c63 bellard
--prefix to set the Win32 install path.
2330 15a34c63 bellard
2331 5fafdf24 ths
@item You can install QEMU in the installation directory by typing
2332 15a34c63 bellard
@file{make install}. Don't forget to copy @file{SDL.dll} in the
2333 5fafdf24 ths
installation directory.
2334 15a34c63 bellard
2335 15a34c63 bellard
@end itemize
2336 15a34c63 bellard
2337 15a34c63 bellard
Note: Currently, Wine does not seem able to launch
2338 15a34c63 bellard
QEMU for Win32.
2339 15a34c63 bellard
2340 debc7065 bellard
@node Mac OS X
2341 15a34c63 bellard
@section Mac OS X
2342 15a34c63 bellard
2343 15a34c63 bellard
The Mac OS X patches are not fully merged in QEMU, so you should look
2344 15a34c63 bellard
at the QEMU mailing list archive to have all the necessary
2345 15a34c63 bellard
information.
2346 15a34c63 bellard
2347 debc7065 bellard
@node Index
2348 debc7065 bellard
@chapter Index
2349 debc7065 bellard
@printindex cp
2350 debc7065 bellard
2351 debc7065 bellard
@bye