root / qemu-doc.texi @ d79284e0
History | View | Annotate | Download (35.8 kB)
1 | 386405f7 | bellard | \input texinfo @c -*- texinfo -*- |
---|---|---|---|
2 | 386405f7 | bellard | |
3 | 0806e3f6 | bellard | @iftex |
4 | 1f673135 | bellard | @settitle QEMU CPU Emulator User Documentation |
5 | 386405f7 | bellard | @titlepage |
6 | 386405f7 | bellard | @sp 7 |
7 | 1f673135 | bellard | @center @titlefont{QEMU CPU Emulator User Documentation} |
8 | 386405f7 | bellard | @sp 3 |
9 | 386405f7 | bellard | @end titlepage |
10 | 0806e3f6 | bellard | @end iftex |
11 | 386405f7 | bellard | |
12 | 386405f7 | bellard | @chapter Introduction |
13 | 386405f7 | bellard | |
14 | 322d0c66 | bellard | @section Features |
15 | 386405f7 | bellard | |
16 | 1f673135 | bellard | QEMU is a FAST! processor emulator using dynamic translation to |
17 | 1f673135 | bellard | achieve good emulation speed. |
18 | 1eb20527 | bellard | |
19 | 1eb20527 | bellard | QEMU has two operating modes: |
20 | 0806e3f6 | bellard | |
21 | 0806e3f6 | bellard | @itemize @minus |
22 | 0806e3f6 | bellard | |
23 | 0806e3f6 | bellard | @item |
24 | 1f673135 | bellard | Full system emulation. In this mode, QEMU emulates a full system (for |
25 | 1f673135 | bellard | example a PC), including a processor and various peripherials. It can |
26 | 1f673135 | bellard | be used to launch different Operating Systems without rebooting the |
27 | 1f673135 | bellard | PC or to debug system code. |
28 | 1eb20527 | bellard | |
29 | 0806e3f6 | bellard | @item |
30 | 1f673135 | bellard | User mode emulation (Linux host only). In this mode, QEMU can launch |
31 | 1f673135 | bellard | Linux processes compiled for one CPU on another CPU. It can be used to |
32 | 1f673135 | bellard | launch the Wine Windows API emulator (@url{http://www.winehq.org}) or |
33 | 1f673135 | bellard | to ease cross-compilation and cross-debugging. |
34 | 1eb20527 | bellard | |
35 | 1eb20527 | bellard | @end itemize |
36 | 1eb20527 | bellard | |
37 | 1f673135 | bellard | As QEMU requires no host kernel driver to run, it is very safe and |
38 | 1eb20527 | bellard | easy to use. |
39 | 322d0c66 | bellard | |
40 | 52c00a5f | bellard | For system emulation, the following hardware targets are supported: |
41 | 52c00a5f | bellard | @itemize |
42 | 52c00a5f | bellard | @item PC (x86 processor) |
43 | 52c00a5f | bellard | @item PREP (PowerPC processor) |
44 | 15a34c63 | bellard | @item PowerMac (PowerPC processor, in progress) |
45 | 52c00a5f | bellard | @end itemize |
46 | 386405f7 | bellard | |
47 | 1f673135 | bellard | For user emulation, x86, PowerPC, ARM, and SPARC CPUs are supported. |
48 | 0806e3f6 | bellard | |
49 | 5b9f457a | bellard | @chapter Installation |
50 | 5b9f457a | bellard | |
51 | 15a34c63 | bellard | If you want to compile QEMU yourself, see @ref{compilation}. |
52 | 15a34c63 | bellard | |
53 | 1f673135 | bellard | @section Linux |
54 | 1f673135 | bellard | |
55 | bc7712a4 | bellard | Download the binary distribution (@file{qemu-XXX-i386.tar.gz}) in |
56 | bc7712a4 | bellard | @file{/tmp} and untar it as root from @file{/}: |
57 | 5b9f457a | bellard | |
58 | 5b9f457a | bellard | @example |
59 | 5b9f457a | bellard | su |
60 | 5b9f457a | bellard | cd / |
61 | 5b9f457a | bellard | tar zxvf /tmp/qemu-XXX-i386.tar.gz |
62 | 5b9f457a | bellard | @end example |
63 | 5b9f457a | bellard | |
64 | 1f673135 | bellard | @section Windows |
65 | 8cd0ac2f | bellard | |
66 | 15a34c63 | bellard | Download the experimental binary installer at |
67 | 15a34c63 | bellard | @url{http://www.freeoszoo.org/download.php}. |
68 | d691f669 | bellard | |
69 | 1f673135 | bellard | @section Mac OS X |
70 | d691f669 | bellard | |
71 | 15a34c63 | bellard | Download the experimental binary installer at |
72 | 15a34c63 | bellard | @url{http://www.freeoszoo.org/download.php}. |
73 | df0f11a0 | bellard | |
74 | 52c00a5f | bellard | @chapter QEMU PC System emulator invocation |
75 | 1eb20527 | bellard | |
76 | 0806e3f6 | bellard | @section Introduction |
77 | 0806e3f6 | bellard | |
78 | 0806e3f6 | bellard | @c man begin DESCRIPTION |
79 | 0806e3f6 | bellard | |
80 | 52c00a5f | bellard | The QEMU System emulator simulates a complete PC. |
81 | 0806e3f6 | bellard | |
82 | 0806e3f6 | bellard | In order to meet specific user needs, two versions of QEMU are |
83 | 0806e3f6 | bellard | available: |
84 | 0806e3f6 | bellard | |
85 | 0806e3f6 | bellard | @enumerate |
86 | 0806e3f6 | bellard | |
87 | 0806e3f6 | bellard | @item |
88 | 15a34c63 | bellard | @code{qemu-fast} uses the host Memory Management Unit (MMU) to |
89 | 15a34c63 | bellard | simulate the x86 MMU. It is @emph{fast} but has limitations because |
90 | 15a34c63 | bellard | the whole 4 GB address space cannot be used and some memory mapped |
91 | 15a34c63 | bellard | peripherials cannot be emulated accurately yet. Therefore, a specific |
92 | 3eb2619f | bellard | guest Linux kernel can be used (@xref{linux_compile}) as guest |
93 | 3eb2619f | bellard | OS. |
94 | 3eb2619f | bellard | |
95 | 3eb2619f | bellard | Moreover there is no separation between the host and target address |
96 | 3eb2619f | bellard | spaces, so it offers no security (the target OS can modify the |
97 | 3eb2619f | bellard | @code{qemu-fast} code by writing at the right addresses). |
98 | 0806e3f6 | bellard | |
99 | 0806e3f6 | bellard | @item |
100 | 3eb2619f | bellard | @code{qemu} uses a software MMU. It is about @emph{two times slower} |
101 | 3eb2619f | bellard | but gives a more accurate emulation and a complete separation between |
102 | 3eb2619f | bellard | the host and target address spaces. |
103 | 0806e3f6 | bellard | |
104 | 0806e3f6 | bellard | @end enumerate |
105 | 0806e3f6 | bellard | |
106 | 0806e3f6 | bellard | QEMU emulates the following PC peripherials: |
107 | 0806e3f6 | bellard | |
108 | 0806e3f6 | bellard | @itemize @minus |
109 | 15a34c63 | bellard | @item |
110 | 15a34c63 | bellard | i440FX host PCI bridge and PIIX3 PCI to ISA bridge |
111 | 0806e3f6 | bellard | @item |
112 | 15a34c63 | bellard | Cirrus CLGD 5446 PCI VGA card or dummy VGA card with Bochs VESA |
113 | 15a34c63 | bellard | extensions (hardware level, including all non standard modes). |
114 | 0806e3f6 | bellard | @item |
115 | 0806e3f6 | bellard | PS/2 mouse and keyboard |
116 | 0806e3f6 | bellard | @item |
117 | 15a34c63 | bellard | 2 PCI IDE interfaces with hard disk and CD-ROM support |
118 | 1f673135 | bellard | @item |
119 | 1f673135 | bellard | Floppy disk |
120 | 0806e3f6 | bellard | @item |
121 | 15a34c63 | bellard | NE2000 PCI network adapters |
122 | 0806e3f6 | bellard | @item |
123 | 05d5818c | bellard | Serial ports |
124 | 05d5818c | bellard | @item |
125 | 181f1558 | bellard | Soundblaster 16 card |
126 | 0806e3f6 | bellard | @end itemize |
127 | 0806e3f6 | bellard | |
128 | 15a34c63 | bellard | QEMU uses the PC BIOS from the Bochs project and the Plex86/Bochs LGPL |
129 | 15a34c63 | bellard | VGA BIOS. |
130 | 15a34c63 | bellard | |
131 | 0806e3f6 | bellard | @c man end |
132 | 0806e3f6 | bellard | |
133 | 1eb20527 | bellard | @section Quick Start |
134 | 1eb20527 | bellard | |
135 | 285dc330 | bellard | Download and uncompress the linux image (@file{linux.img}) and type: |
136 | 0806e3f6 | bellard | |
137 | 0806e3f6 | bellard | @example |
138 | 285dc330 | bellard | qemu linux.img |
139 | 0806e3f6 | bellard | @end example |
140 | 0806e3f6 | bellard | |
141 | 0806e3f6 | bellard | Linux should boot and give you a prompt. |
142 | 0806e3f6 | bellard | |
143 | ec410fc9 | bellard | @section Invocation |
144 | ec410fc9 | bellard | |
145 | ec410fc9 | bellard | @example |
146 | 0806e3f6 | bellard | @c man begin SYNOPSIS |
147 | 0806e3f6 | bellard | usage: qemu [options] [disk_image] |
148 | 0806e3f6 | bellard | @c man end |
149 | ec410fc9 | bellard | @end example |
150 | ec410fc9 | bellard | |
151 | 0806e3f6 | bellard | @c man begin OPTIONS |
152 | 9d4520d0 | bellard | @var{disk_image} is a raw hard disk image for IDE hard disk 0. |
153 | ec410fc9 | bellard | |
154 | ec410fc9 | bellard | General options: |
155 | ec410fc9 | bellard | @table @option |
156 | 2be3bc02 | bellard | @item -fda file |
157 | 2be3bc02 | bellard | @item -fdb file |
158 | be3edd95 | bellard | Use @var{file} as floppy disk 0/1 image (@xref{disk_images}). You can |
159 | be3edd95 | bellard | use the host floppy by using @file{/dev/fd0} as filename. |
160 | 2be3bc02 | bellard | |
161 | ec410fc9 | bellard | @item -hda file |
162 | ec410fc9 | bellard | @item -hdb file |
163 | 181f1558 | bellard | @item -hdc file |
164 | 181f1558 | bellard | @item -hdd file |
165 | 2be3bc02 | bellard | Use @var{file} as hard disk 0, 1, 2 or 3 image (@xref{disk_images}). |
166 | 1f47a922 | bellard | |
167 | 181f1558 | bellard | @item -cdrom file |
168 | 181f1558 | bellard | Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and and |
169 | be3edd95 | bellard | @option{-cdrom} at the same time). You can use the host CD-ROM by |
170 | be3edd95 | bellard | using @file{/dev/cdrom} as filename. |
171 | 181f1558 | bellard | |
172 | 1f673135 | bellard | @item -boot [a|c|d] |
173 | 1f673135 | bellard | Boot on floppy (a), hard disk (c) or CD-ROM (d). Hard disk boot is |
174 | 2be3bc02 | bellard | the default. |
175 | 1f47a922 | bellard | |
176 | 181f1558 | bellard | @item -snapshot |
177 | 1f47a922 | bellard | Write to temporary files instead of disk image files. In this case, |
178 | 1f47a922 | bellard | the raw disk image you use is not written back. You can however force |
179 | 1f47a922 | bellard | the write back by pressing @key{C-a s} (@xref{disk_images}). |
180 | ec410fc9 | bellard | |
181 | ec410fc9 | bellard | @item -m megs |
182 | 15a34c63 | bellard | Set virtual RAM size to @var{megs} megabytes. Default is 128 MB. |
183 | ec410fc9 | bellard | |
184 | 0806e3f6 | bellard | @item -nographic |
185 | 0806e3f6 | bellard | |
186 | 0806e3f6 | bellard | Normally, QEMU uses SDL to display the VGA output. With this option, |
187 | 0806e3f6 | bellard | you can totally disable graphical output so that QEMU is a simple |
188 | 0806e3f6 | bellard | command line application. The emulated serial port is redirected on |
189 | 0806e3f6 | bellard | the console. Therefore, you can still use QEMU to debug a Linux kernel |
190 | 0806e3f6 | bellard | with a serial console. |
191 | 0806e3f6 | bellard | |
192 | 3d11d0eb | bellard | @item -k language |
193 | 3d11d0eb | bellard | |
194 | 3d11d0eb | bellard | Use keyboard layout @var{language} (for example @code{fr} for |
195 | 3d11d0eb | bellard | French). This option is only needed where it is not easy to get raw PC |
196 | 3d11d0eb | bellard | keycodes (e.g. on Macs or with some X11 servers). You don't need to |
197 | 3d11d0eb | bellard | use it on PC/Linux or PC/Windows hosts. |
198 | 3d11d0eb | bellard | |
199 | 3d11d0eb | bellard | The available layouts are: |
200 | 3d11d0eb | bellard | @example |
201 | 3d11d0eb | bellard | ar de-ch es fo fr-ca hu ja mk no pt-br sv |
202 | 3d11d0eb | bellard | da en-gb et fr fr-ch is lt nl pl ru th |
203 | 3d11d0eb | bellard | de en-us fi fr-be hr it lv nl-be pt sl tr |
204 | 3d11d0eb | bellard | @end example |
205 | 3d11d0eb | bellard | |
206 | 3d11d0eb | bellard | The default is @code{en-us}. |
207 | 3d11d0eb | bellard | |
208 | a8c490cd | bellard | @item -enable-audio |
209 | a8c490cd | bellard | |
210 | a8c490cd | bellard | The SB16 emulation is disabled by default as it may give problems with |
211 | a8c490cd | bellard | Windows. You can enable it manually with this option. |
212 | a8c490cd | bellard | |
213 | 15a34c63 | bellard | @item -localtime |
214 | 15a34c63 | bellard | Set the real time clock to local time (the default is to UTC |
215 | 15a34c63 | bellard | time). This option is needed to have correct date in MS-DOS or |
216 | 15a34c63 | bellard | Windows. |
217 | 15a34c63 | bellard | |
218 | d63d307f | bellard | @item -full-screen |
219 | d63d307f | bellard | Start in full screen. |
220 | d63d307f | bellard | |
221 | f7cce898 | bellard | @item -pidfile file |
222 | f7cce898 | bellard | Store the QEMU process PID in @var{file}. It is useful if you launch QEMU |
223 | f7cce898 | bellard | from a script. |
224 | f7cce898 | bellard | |
225 | 0806e3f6 | bellard | @end table |
226 | 0806e3f6 | bellard | |
227 | 1f673135 | bellard | Network options: |
228 | 1f673135 | bellard | |
229 | 1f673135 | bellard | @table @option |
230 | 1f673135 | bellard | |
231 | 1f673135 | bellard | @item -n script |
232 | 52c00a5f | bellard | Set TUN/TAP network init script [default=/etc/qemu-ifup]. This script |
233 | 52c00a5f | bellard | is launched to configure the host network interface (usually tun0) |
234 | 1f673135 | bellard | corresponding to the virtual NE2000 card. |
235 | 1f673135 | bellard | |
236 | 1f673135 | bellard | @item -macaddr addr |
237 | 1f673135 | bellard | |
238 | 1f673135 | bellard | Set the mac address of the first interface (the format is |
239 | 1f673135 | bellard | aa:bb:cc:dd:ee:ff in hexa). The mac address is incremented for each |
240 | 1f673135 | bellard | new network interface. |
241 | 1f673135 | bellard | |
242 | 52c00a5f | bellard | @item -tun-fd fd |
243 | 52c00a5f | bellard | Assumes @var{fd} talks to a tap/tun host network interface and use |
244 | 52c00a5f | bellard | it. Read @url{http://bellard.org/qemu/tetrinet.html} to have an |
245 | 52c00a5f | bellard | example of its use. |
246 | 52c00a5f | bellard | |
247 | 52c00a5f | bellard | @item -user-net |
248 | 15a34c63 | bellard | Use the user mode network stack. This is the default if no tun/tap |
249 | 15a34c63 | bellard | network init script is found. |
250 | 52c00a5f | bellard | |
251 | 9bf05444 | bellard | @item -tftp prefix |
252 | 9bf05444 | bellard | When using the user mode network stack, activate a built-in TFTP |
253 | 9bf05444 | bellard | server. All filenames beginning with @var{prefix} can be downloaded |
254 | 9bf05444 | bellard | from the host to the guest using a TFTP client. The TFTP client on the |
255 | 9bf05444 | bellard | guest must be configured in binary mode (use the command @code{bin} of |
256 | 9bf05444 | bellard | the Unix TFTP client). The host IP address on the guest is as usual |
257 | 9bf05444 | bellard | 10.0.2.2. |
258 | 9bf05444 | bellard | |
259 | 2518bd0d | bellard | @item -smb dir |
260 | 2518bd0d | bellard | When using the user mode network stack, activate a built-in SMB |
261 | 2518bd0d | bellard | server so that Windows OSes can access to the host files in @file{dir} |
262 | 2518bd0d | bellard | transparently. |
263 | 2518bd0d | bellard | |
264 | 2518bd0d | bellard | In the guest Windows OS, the line: |
265 | 2518bd0d | bellard | @example |
266 | 2518bd0d | bellard | 10.0.2.4 smbserver |
267 | 2518bd0d | bellard | @end example |
268 | 2518bd0d | bellard | must be added in the file @file{C:\WINDOWS\LMHOSTS} (for windows 9x/Me) |
269 | 2518bd0d | bellard | or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000). |
270 | 2518bd0d | bellard | |
271 | 2518bd0d | bellard | Then @file{dir} can be accessed in @file{\\smbserver\qemu}. |
272 | 2518bd0d | bellard | |
273 | 2518bd0d | bellard | Note that a SAMBA server must be installed on the host OS in |
274 | 2518bd0d | bellard | @file{/usr/sbin/smbd}. QEMU was tested succesfully with smbd version |
275 | 2518bd0d | bellard | 2.2.7a from the Red Hat 9. |
276 | 2518bd0d | bellard | |
277 | 9bf05444 | bellard | @item -redir [tcp|udp]:host-port:[guest-host]:guest-port |
278 | 9bf05444 | bellard | |
279 | 9bf05444 | bellard | When using the user mode network stack, redirect incoming TCP or UDP |
280 | 9bf05444 | bellard | connections to the host port @var{host-port} to the guest |
281 | 9bf05444 | bellard | @var{guest-host} on guest port @var{guest-port}. If @var{guest-host} |
282 | 9bf05444 | bellard | is not specified, its value is 10.0.2.15 (default address given by the |
283 | 9bf05444 | bellard | built-in DHCP server). |
284 | 9bf05444 | bellard | |
285 | 9bf05444 | bellard | For example, to redirect host X11 connection from screen 1 to guest |
286 | 9bf05444 | bellard | screen 0, use the following: |
287 | 9bf05444 | bellard | |
288 | 9bf05444 | bellard | @example |
289 | 9bf05444 | bellard | # on the host |
290 | 9bf05444 | bellard | qemu -redir tcp:6001::6000 [...] |
291 | 9bf05444 | bellard | # this host xterm should open in the guest X11 server |
292 | 9bf05444 | bellard | xterm -display :1 |
293 | 9bf05444 | bellard | @end example |
294 | 9bf05444 | bellard | |
295 | 9bf05444 | bellard | To redirect telnet connections from host port 5555 to telnet port on |
296 | 9bf05444 | bellard | the guest, use the following: |
297 | 9bf05444 | bellard | |
298 | 9bf05444 | bellard | @example |
299 | 9bf05444 | bellard | # on the host |
300 | 9bf05444 | bellard | qemu -redir tcp:5555::23 [...] |
301 | 9bf05444 | bellard | telnet localhost 5555 |
302 | 9bf05444 | bellard | @end example |
303 | 9bf05444 | bellard | |
304 | 9bf05444 | bellard | Then when you use on the host @code{telnet localhost 5555}, you |
305 | 9bf05444 | bellard | connect to the guest telnet server. |
306 | 9bf05444 | bellard | |
307 | 52c00a5f | bellard | @item -dummy-net |
308 | 15a34c63 | bellard | Use the dummy network stack: no packet will be received by the network |
309 | 52c00a5f | bellard | cards. |
310 | 1f673135 | bellard | |
311 | 1f673135 | bellard | @end table |
312 | 1f673135 | bellard | |
313 | 1f673135 | bellard | Linux boot specific. When using this options, you can use a given |
314 | 1f673135 | bellard | Linux kernel without installing it in the disk image. It can be useful |
315 | 1f673135 | bellard | for easier testing of various kernels. |
316 | 1f673135 | bellard | |
317 | 0806e3f6 | bellard | @table @option |
318 | 0806e3f6 | bellard | |
319 | 0806e3f6 | bellard | @item -kernel bzImage |
320 | 0806e3f6 | bellard | Use @var{bzImage} as kernel image. |
321 | 0806e3f6 | bellard | |
322 | 0806e3f6 | bellard | @item -append cmdline |
323 | 0806e3f6 | bellard | Use @var{cmdline} as kernel command line |
324 | 0806e3f6 | bellard | |
325 | 0806e3f6 | bellard | @item -initrd file |
326 | 0806e3f6 | bellard | Use @var{file} as initial ram disk. |
327 | 0806e3f6 | bellard | |
328 | ec410fc9 | bellard | @end table |
329 | ec410fc9 | bellard | |
330 | 15a34c63 | bellard | Debug/Expert options: |
331 | ec410fc9 | bellard | @table @option |
332 | a0a821a4 | bellard | |
333 | a0a821a4 | bellard | @item -serial dev |
334 | a0a821a4 | bellard | Redirect the virtual serial port to host device @var{dev}. Available |
335 | a0a821a4 | bellard | devices are: |
336 | a0a821a4 | bellard | @table @code |
337 | a0a821a4 | bellard | @item vc |
338 | a0a821a4 | bellard | Virtual console |
339 | a0a821a4 | bellard | @item pty |
340 | a0a821a4 | bellard | [Linux only] Pseudo TTY (a new PTY is automatically allocated) |
341 | a0a821a4 | bellard | @item null |
342 | a0a821a4 | bellard | void device |
343 | a0a821a4 | bellard | @item stdio |
344 | a0a821a4 | bellard | [Unix only] standard input/output |
345 | a0a821a4 | bellard | @end table |
346 | a0a821a4 | bellard | The default device is @code{vc} in graphical mode and @code{stdio} in |
347 | a0a821a4 | bellard | non graphical mode. |
348 | a0a821a4 | bellard | |
349 | 05d5818c | bellard | This option can be used several times to simulate up to 4 serials |
350 | 05d5818c | bellard | ports. |
351 | 05d5818c | bellard | |
352 | a0a821a4 | bellard | @item -monitor dev |
353 | a0a821a4 | bellard | Redirect the monitor to host device @var{dev} (same devices as the |
354 | a0a821a4 | bellard | serial port). |
355 | a0a821a4 | bellard | The default device is @code{vc} in graphical mode and @code{stdio} in |
356 | a0a821a4 | bellard | non graphical mode. |
357 | a0a821a4 | bellard | |
358 | ec410fc9 | bellard | @item -s |
359 | 0806e3f6 | bellard | Wait gdb connection to port 1234 (@xref{gdb_usage}). |
360 | ec410fc9 | bellard | @item -p port |
361 | ec410fc9 | bellard | Change gdb connection port. |
362 | 52c00a5f | bellard | @item -S |
363 | 52c00a5f | bellard | Do not start CPU at startup (you must type 'c' in the monitor). |
364 | ec410fc9 | bellard | @item -d |
365 | 9d4520d0 | bellard | Output log in /tmp/qemu.log |
366 | 46d4767d | bellard | @item -hdachs c,h,s,[,t] |
367 | 46d4767d | bellard | Force hard disk 0 physical geometry (1 <= @var{c} <= 16383, 1 <= |
368 | 46d4767d | bellard | @var{h} <= 16, 1 <= @var{s} <= 63) and optionally force the BIOS |
369 | 46d4767d | bellard | translation mode (@var{t}=none, lba or auto). Usually QEMU can guess |
370 | 46d4767d | bellard | all thoses parameters. This option is useful for old MS-DOS disk |
371 | 46d4767d | bellard | images. |
372 | 15a34c63 | bellard | @item -isa |
373 | 15a34c63 | bellard | Simulate an ISA-only system (default is PCI system). |
374 | 15a34c63 | bellard | @item -std-vga |
375 | 15a34c63 | bellard | Simulate a standard VGA card with Bochs VBE extensions (default is |
376 | 15a34c63 | bellard | Cirrus Logic GD5446 PCI VGA) |
377 | d63d307f | bellard | @item -loadvm file |
378 | d63d307f | bellard | Start right away with a saved state (@code{loadvm} in monitor) |
379 | ec410fc9 | bellard | @end table |
380 | ec410fc9 | bellard | |
381 | 3e11db9a | bellard | @c man end |
382 | 3e11db9a | bellard | |
383 | 3e11db9a | bellard | @section Keys |
384 | 3e11db9a | bellard | |
385 | 3e11db9a | bellard | @c man begin OPTIONS |
386 | 3e11db9a | bellard | |
387 | a1b74fe8 | bellard | During the graphical emulation, you can use the following keys: |
388 | a1b74fe8 | bellard | @table @key |
389 | f9859310 | bellard | @item Ctrl-Alt-f |
390 | a1b74fe8 | bellard | Toggle full screen |
391 | a0a821a4 | bellard | |
392 | f9859310 | bellard | @item Ctrl-Alt-n |
393 | a0a821a4 | bellard | Switch to virtual console 'n'. Standard console mappings are: |
394 | a0a821a4 | bellard | @table @emph |
395 | a0a821a4 | bellard | @item 1 |
396 | a0a821a4 | bellard | Target system display |
397 | a0a821a4 | bellard | @item 2 |
398 | a0a821a4 | bellard | Monitor |
399 | a0a821a4 | bellard | @item 3 |
400 | a0a821a4 | bellard | Serial port |
401 | a1b74fe8 | bellard | @end table |
402 | a1b74fe8 | bellard | |
403 | f9859310 | bellard | @item Ctrl-Alt |
404 | a0a821a4 | bellard | Toggle mouse and keyboard grab. |
405 | a0a821a4 | bellard | @end table |
406 | a0a821a4 | bellard | |
407 | 3e11db9a | bellard | In the virtual consoles, you can use @key{Ctrl-Up}, @key{Ctrl-Down}, |
408 | 3e11db9a | bellard | @key{Ctrl-PageUp} and @key{Ctrl-PageDown} to move in the back log. |
409 | 3e11db9a | bellard | |
410 | a0a821a4 | bellard | During emulation, if you are using the @option{-nographic} option, use |
411 | a0a821a4 | bellard | @key{Ctrl-a h} to get terminal commands: |
412 | ec410fc9 | bellard | |
413 | ec410fc9 | bellard | @table @key |
414 | a1b74fe8 | bellard | @item Ctrl-a h |
415 | ec410fc9 | bellard | Print this help |
416 | a1b74fe8 | bellard | @item Ctrl-a x |
417 | ec410fc9 | bellard | Exit emulatior |
418 | a1b74fe8 | bellard | @item Ctrl-a s |
419 | 1f47a922 | bellard | Save disk data back to file (if -snapshot) |
420 | a1b74fe8 | bellard | @item Ctrl-a b |
421 | 1f673135 | bellard | Send break (magic sysrq in Linux) |
422 | a1b74fe8 | bellard | @item Ctrl-a c |
423 | 1f673135 | bellard | Switch between console and monitor |
424 | a1b74fe8 | bellard | @item Ctrl-a Ctrl-a |
425 | a1b74fe8 | bellard | Send Ctrl-a |
426 | ec410fc9 | bellard | @end table |
427 | 0806e3f6 | bellard | @c man end |
428 | 0806e3f6 | bellard | |
429 | 0806e3f6 | bellard | @ignore |
430 | 0806e3f6 | bellard | |
431 | 0806e3f6 | bellard | @setfilename qemu |
432 | 0806e3f6 | bellard | @settitle QEMU System Emulator |
433 | 0806e3f6 | bellard | |
434 | 1f673135 | bellard | @c man begin SEEALSO |
435 | 1f673135 | bellard | The HTML documentation of QEMU for more precise information and Linux |
436 | 1f673135 | bellard | user mode emulator invocation. |
437 | 1f673135 | bellard | @c man end |
438 | 1f673135 | bellard | |
439 | 1f673135 | bellard | @c man begin AUTHOR |
440 | 1f673135 | bellard | Fabrice Bellard |
441 | 1f673135 | bellard | @c man end |
442 | 1f673135 | bellard | |
443 | 1f673135 | bellard | @end ignore |
444 | 1f673135 | bellard | |
445 | 1f673135 | bellard | @end ignore |
446 | 1f673135 | bellard | |
447 | 1f673135 | bellard | |
448 | 1f673135 | bellard | @section QEMU Monitor |
449 | 1f673135 | bellard | |
450 | 1f673135 | bellard | The QEMU monitor is used to give complex commands to the QEMU |
451 | 1f673135 | bellard | emulator. You can use it to: |
452 | 1f673135 | bellard | |
453 | 1f673135 | bellard | @itemize @minus |
454 | 1f673135 | bellard | |
455 | 1f673135 | bellard | @item |
456 | 1f673135 | bellard | Remove or insert removable medias images |
457 | 1f673135 | bellard | (such as CD-ROM or floppies) |
458 | 1f673135 | bellard | |
459 | 1f673135 | bellard | @item |
460 | 1f673135 | bellard | Freeze/unfreeze the Virtual Machine (VM) and save or restore its state |
461 | 1f673135 | bellard | from a disk file. |
462 | 1f673135 | bellard | |
463 | 1f673135 | bellard | @item Inspect the VM state without an external debugger. |
464 | 1f673135 | bellard | |
465 | 1f673135 | bellard | @end itemize |
466 | 1f673135 | bellard | |
467 | 1f673135 | bellard | @subsection Commands |
468 | 1f673135 | bellard | |
469 | 1f673135 | bellard | The following commands are available: |
470 | 1f673135 | bellard | |
471 | 1f673135 | bellard | @table @option |
472 | 1f673135 | bellard | |
473 | 1f673135 | bellard | @item help or ? [cmd] |
474 | 1f673135 | bellard | Show the help for all commands or just for command @var{cmd}. |
475 | 1f673135 | bellard | |
476 | 1f673135 | bellard | @item commit |
477 | 1f673135 | bellard | Commit changes to the disk images (if -snapshot is used) |
478 | 1f673135 | bellard | |
479 | 1f673135 | bellard | @item info subcommand |
480 | 1f673135 | bellard | show various information about the system state |
481 | 1f673135 | bellard | |
482 | 1f673135 | bellard | @table @option |
483 | 1f673135 | bellard | @item info network |
484 | 1f673135 | bellard | show the network state |
485 | 1f673135 | bellard | @item info block |
486 | 1f673135 | bellard | show the block devices |
487 | 1f673135 | bellard | @item info registers |
488 | 1f673135 | bellard | show the cpu registers |
489 | 1f673135 | bellard | @item info history |
490 | 1f673135 | bellard | show the command line history |
491 | 1f673135 | bellard | @end table |
492 | 1f673135 | bellard | |
493 | 1f673135 | bellard | @item q or quit |
494 | 1f673135 | bellard | Quit the emulator. |
495 | 1f673135 | bellard | |
496 | 1f673135 | bellard | @item eject [-f] device |
497 | 1f673135 | bellard | Eject a removable media (use -f to force it). |
498 | 1f673135 | bellard | |
499 | 1f673135 | bellard | @item change device filename |
500 | 1f673135 | bellard | Change a removable media. |
501 | 1f673135 | bellard | |
502 | 1f673135 | bellard | @item screendump filename |
503 | 1f673135 | bellard | Save screen into PPM image @var{filename}. |
504 | 1f673135 | bellard | |
505 | 1f673135 | bellard | @item log item1[,...] |
506 | 1f673135 | bellard | Activate logging of the specified items to @file{/tmp/qemu.log}. |
507 | 1f673135 | bellard | |
508 | 1f673135 | bellard | @item savevm filename |
509 | 1f673135 | bellard | Save the whole virtual machine state to @var{filename}. |
510 | 1f673135 | bellard | |
511 | 1f673135 | bellard | @item loadvm filename |
512 | 1f673135 | bellard | Restore the whole virtual machine state from @var{filename}. |
513 | 1f673135 | bellard | |
514 | 1f673135 | bellard | @item stop |
515 | 1f673135 | bellard | Stop emulation. |
516 | 1f673135 | bellard | |
517 | 1f673135 | bellard | @item c or cont |
518 | 1f673135 | bellard | Resume emulation. |
519 | 1f673135 | bellard | |
520 | 1f673135 | bellard | @item gdbserver [port] |
521 | 1f673135 | bellard | Start gdbserver session (default port=1234) |
522 | 1f673135 | bellard | |
523 | 1f673135 | bellard | @item x/fmt addr |
524 | 1f673135 | bellard | Virtual memory dump starting at @var{addr}. |
525 | 1f673135 | bellard | |
526 | 1f673135 | bellard | @item xp /fmt addr |
527 | 1f673135 | bellard | Physical memory dump starting at @var{addr}. |
528 | 1f673135 | bellard | |
529 | 1f673135 | bellard | @var{fmt} is a format which tells the command how to format the |
530 | 1f673135 | bellard | data. Its syntax is: @option{/@{count@}@{format@}@{size@}} |
531 | 1f673135 | bellard | |
532 | 1f673135 | bellard | @table @var |
533 | 1f673135 | bellard | @item count |
534 | 1f673135 | bellard | is the number of items to be dumped. |
535 | 1f673135 | bellard | |
536 | 1f673135 | bellard | @item format |
537 | 1f673135 | bellard | can be x (hexa), d (signed decimal), u (unsigned decimal), o (octal), |
538 | 1f673135 | bellard | c (char) or i (asm instruction). |
539 | 1f673135 | bellard | |
540 | 1f673135 | bellard | @item size |
541 | 52c00a5f | bellard | can be b (8 bits), h (16 bits), w (32 bits) or g (64 bits). On x86, |
542 | 52c00a5f | bellard | @code{h} or @code{w} can be specified with the @code{i} format to |
543 | 52c00a5f | bellard | respectively select 16 or 32 bit code instruction size. |
544 | 1f673135 | bellard | |
545 | 1f673135 | bellard | @end table |
546 | 1f673135 | bellard | |
547 | 1f673135 | bellard | Examples: |
548 | 1f673135 | bellard | @itemize |
549 | 1f673135 | bellard | @item |
550 | 1f673135 | bellard | Dump 10 instructions at the current instruction pointer: |
551 | 1f673135 | bellard | @example |
552 | 1f673135 | bellard | (qemu) x/10i $eip |
553 | 1f673135 | bellard | 0x90107063: ret |
554 | 1f673135 | bellard | 0x90107064: sti |
555 | 1f673135 | bellard | 0x90107065: lea 0x0(%esi,1),%esi |
556 | 1f673135 | bellard | 0x90107069: lea 0x0(%edi,1),%edi |
557 | 1f673135 | bellard | 0x90107070: ret |
558 | 1f673135 | bellard | 0x90107071: jmp 0x90107080 |
559 | 1f673135 | bellard | 0x90107073: nop |
560 | 1f673135 | bellard | 0x90107074: nop |
561 | 1f673135 | bellard | 0x90107075: nop |
562 | 1f673135 | bellard | 0x90107076: nop |
563 | 1f673135 | bellard | @end example |
564 | 1f673135 | bellard | |
565 | 1f673135 | bellard | @item |
566 | 1f673135 | bellard | Dump 80 16 bit values at the start of the video memory. |
567 | 1f673135 | bellard | @example |
568 | 1f673135 | bellard | (qemu) xp/80hx 0xb8000 |
569 | 1f673135 | bellard | 0x000b8000: 0x0b50 0x0b6c 0x0b65 0x0b78 0x0b38 0x0b36 0x0b2f 0x0b42 |
570 | 1f673135 | bellard | 0x000b8010: 0x0b6f 0x0b63 0x0b68 0x0b73 0x0b20 0x0b56 0x0b47 0x0b41 |
571 | 1f673135 | bellard | 0x000b8020: 0x0b42 0x0b69 0x0b6f 0x0b73 0x0b20 0x0b63 0x0b75 0x0b72 |
572 | 1f673135 | bellard | 0x000b8030: 0x0b72 0x0b65 0x0b6e 0x0b74 0x0b2d 0x0b63 0x0b76 0x0b73 |
573 | 1f673135 | bellard | 0x000b8040: 0x0b20 0x0b30 0x0b35 0x0b20 0x0b4e 0x0b6f 0x0b76 0x0b20 |
574 | 1f673135 | bellard | 0x000b8050: 0x0b32 0x0b30 0x0b30 0x0b33 0x0720 0x0720 0x0720 0x0720 |
575 | 1f673135 | bellard | 0x000b8060: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 |
576 | 1f673135 | bellard | 0x000b8070: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 |
577 | 1f673135 | bellard | 0x000b8080: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 |
578 | 1f673135 | bellard | 0x000b8090: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 |
579 | 1f673135 | bellard | @end example |
580 | 1f673135 | bellard | @end itemize |
581 | 1f673135 | bellard | |
582 | 1f673135 | bellard | @item p or print/fmt expr |
583 | 1f673135 | bellard | |
584 | 1f673135 | bellard | Print expression value. Only the @var{format} part of @var{fmt} is |
585 | 1f673135 | bellard | used. |
586 | 0806e3f6 | bellard | |
587 | a3a91a35 | bellard | @item sendkey keys |
588 | a3a91a35 | bellard | |
589 | a3a91a35 | bellard | Send @var{keys} to the emulator. Use @code{-} to press several keys |
590 | a3a91a35 | bellard | simultaneously. Example: |
591 | a3a91a35 | bellard | @example |
592 | a3a91a35 | bellard | sendkey ctrl-alt-f1 |
593 | a3a91a35 | bellard | @end example |
594 | a3a91a35 | bellard | |
595 | a3a91a35 | bellard | This command is useful to send keys that your graphical user interface |
596 | a3a91a35 | bellard | intercepts at low level, such as @code{ctrl-alt-f1} in X Window. |
597 | a3a91a35 | bellard | |
598 | 15a34c63 | bellard | @item system_reset |
599 | 15a34c63 | bellard | |
600 | 15a34c63 | bellard | Reset the system. |
601 | 15a34c63 | bellard | |
602 | 1f673135 | bellard | @end table |
603 | 0806e3f6 | bellard | |
604 | 1f673135 | bellard | @subsection Integer expressions |
605 | 1f673135 | bellard | |
606 | 1f673135 | bellard | The monitor understands integers expressions for every integer |
607 | 1f673135 | bellard | argument. You can use register names to get the value of specifics |
608 | 1f673135 | bellard | CPU registers by prefixing them with @emph{$}. |
609 | ec410fc9 | bellard | |
610 | 1f47a922 | bellard | @node disk_images |
611 | 1f47a922 | bellard | @section Disk Images |
612 | 1f47a922 | bellard | |
613 | acd935ef | bellard | Since version 0.6.1, QEMU supports many disk image formats, including |
614 | acd935ef | bellard | growable disk images (their size increase as non empty sectors are |
615 | acd935ef | bellard | written), compressed and encrypted disk images. |
616 | 1f47a922 | bellard | |
617 | acd935ef | bellard | @subsection Quick start for disk image creation |
618 | acd935ef | bellard | |
619 | acd935ef | bellard | You can create a disk image with the command: |
620 | 1f47a922 | bellard | @example |
621 | acd935ef | bellard | qemu-img create myimage.img mysize |
622 | 1f47a922 | bellard | @end example |
623 | acd935ef | bellard | where @var{myimage.img} is the disk image filename and @var{mysize} is its |
624 | acd935ef | bellard | size in kilobytes. You can add an @code{M} suffix to give the size in |
625 | acd935ef | bellard | megabytes and a @code{G} suffix for gigabytes. |
626 | acd935ef | bellard | |
627 | acd935ef | bellard | @xref{qemu_img_invocation} for more information. |
628 | 1f47a922 | bellard | |
629 | 1f47a922 | bellard | @subsection Snapshot mode |
630 | 1f47a922 | bellard | |
631 | 1f47a922 | bellard | If you use the option @option{-snapshot}, all disk images are |
632 | 1f47a922 | bellard | considered as read only. When sectors in written, they are written in |
633 | 1f47a922 | bellard | a temporary file created in @file{/tmp}. You can however force the |
634 | acd935ef | bellard | write back to the raw disk images by using the @code{commit} monitor |
635 | acd935ef | bellard | command (or @key{C-a s} in the serial console). |
636 | 1f47a922 | bellard | |
637 | acd935ef | bellard | @node qemu_img_invocation |
638 | acd935ef | bellard | @subsection @code{qemu-img} Invocation |
639 | 1f47a922 | bellard | |
640 | acd935ef | bellard | @include qemu-img.texi |
641 | 05efe46e | bellard | |
642 | 9d4fb82e | bellard | @section Network emulation |
643 | 9d4fb82e | bellard | |
644 | 9d4fb82e | bellard | QEMU simulates up to 6 networks cards (NE2000 boards). Each card can |
645 | 9d4fb82e | bellard | be connected to a specific host network interface. |
646 | 9d4fb82e | bellard | |
647 | 9d4fb82e | bellard | @subsection Using tun/tap network interface |
648 | 9d4fb82e | bellard | |
649 | 9d4fb82e | bellard | This is the standard way to emulate network. QEMU adds a virtual |
650 | 9d4fb82e | bellard | network device on your host (called @code{tun0}), and you can then |
651 | 9d4fb82e | bellard | configure it as if it was a real ethernet card. |
652 | 9d4fb82e | bellard | |
653 | 9d4fb82e | bellard | As an example, you can download the @file{linux-test-xxx.tar.gz} |
654 | 9d4fb82e | bellard | archive and copy the script @file{qemu-ifup} in @file{/etc} and |
655 | 9d4fb82e | bellard | configure properly @code{sudo} so that the command @code{ifconfig} |
656 | 9d4fb82e | bellard | contained in @file{qemu-ifup} can be executed as root. You must verify |
657 | 9d4fb82e | bellard | that your host kernel supports the TUN/TAP network interfaces: the |
658 | 9d4fb82e | bellard | device @file{/dev/net/tun} must be present. |
659 | 9d4fb82e | bellard | |
660 | 9d4fb82e | bellard | See @ref{direct_linux_boot} to have an example of network use with a |
661 | 9d4fb82e | bellard | Linux distribution. |
662 | 9d4fb82e | bellard | |
663 | 9d4fb82e | bellard | @subsection Using the user mode network stack |
664 | 9d4fb82e | bellard | |
665 | 443f1376 | bellard | By using the option @option{-user-net} or if you have no tun/tap init |
666 | 443f1376 | bellard | script, QEMU uses a completely user mode network stack (you don't need |
667 | 443f1376 | bellard | root priviledge to use the virtual network). The virtual network |
668 | 443f1376 | bellard | configuration is the following: |
669 | 9d4fb82e | bellard | |
670 | 9d4fb82e | bellard | @example |
671 | 9d4fb82e | bellard | |
672 | 9d4fb82e | bellard | QEMU Virtual Machine <------> Firewall/DHCP server <-----> Internet |
673 | 9d4fb82e | bellard | (10.0.2.x) | (10.0.2.2) |
674 | 9d4fb82e | bellard | | |
675 | 2518bd0d | bellard | ----> DNS server (10.0.2.3) |
676 | 2518bd0d | bellard | | |
677 | 2518bd0d | bellard | ----> SMB server (10.0.2.4) |
678 | 9d4fb82e | bellard | @end example |
679 | 9d4fb82e | bellard | |
680 | 9d4fb82e | bellard | The QEMU VM behaves as if it was behind a firewall which blocks all |
681 | 9d4fb82e | bellard | incoming connections. You can use a DHCP client to automatically |
682 | 9d4fb82e | bellard | configure the network in the QEMU VM. |
683 | 9d4fb82e | bellard | |
684 | 9d4fb82e | bellard | In order to check that the user mode network is working, you can ping |
685 | 9d4fb82e | bellard | the address 10.0.2.2 and verify that you got an address in the range |
686 | 9d4fb82e | bellard | 10.0.2.x from the QEMU virtual DHCP server. |
687 | 9d4fb82e | bellard | |
688 | b415a407 | bellard | Note that @code{ping} is not supported reliably to the internet as it |
689 | b415a407 | bellard | would require root priviledges. It means you can only ping the local |
690 | b415a407 | bellard | router (10.0.2.2). |
691 | b415a407 | bellard | |
692 | 9bf05444 | bellard | When using the built-in TFTP server, the router is also the TFTP |
693 | 9bf05444 | bellard | server. |
694 | 9bf05444 | bellard | |
695 | 9bf05444 | bellard | When using the @option{-redir} option, TCP or UDP connections can be |
696 | 9bf05444 | bellard | redirected from the host to the guest. It allows for example to |
697 | 9bf05444 | bellard | redirect X11, telnet or SSH connections. |
698 | 443f1376 | bellard | |
699 | 9d4fb82e | bellard | @node direct_linux_boot |
700 | 9d4fb82e | bellard | @section Direct Linux Boot |
701 | 1f673135 | bellard | |
702 | 1f673135 | bellard | This section explains how to launch a Linux kernel inside QEMU without |
703 | 1f673135 | bellard | having to make a full bootable image. It is very useful for fast Linux |
704 | 1f673135 | bellard | kernel testing. The QEMU network configuration is also explained. |
705 | 1f673135 | bellard | |
706 | 1f673135 | bellard | @enumerate |
707 | 1f673135 | bellard | @item |
708 | 1f673135 | bellard | Download the archive @file{linux-test-xxx.tar.gz} containing a Linux |
709 | 1f673135 | bellard | kernel and a disk image. |
710 | 1f673135 | bellard | |
711 | 1f673135 | bellard | @item Optional: If you want network support (for example to launch X11 examples), you |
712 | 1f673135 | bellard | must copy the script @file{qemu-ifup} in @file{/etc} and configure |
713 | 1f673135 | bellard | properly @code{sudo} so that the command @code{ifconfig} contained in |
714 | 1f673135 | bellard | @file{qemu-ifup} can be executed as root. You must verify that your host |
715 | 1f673135 | bellard | kernel supports the TUN/TAP network interfaces: the device |
716 | 1f673135 | bellard | @file{/dev/net/tun} must be present. |
717 | 1f673135 | bellard | |
718 | 1f673135 | bellard | When network is enabled, there is a virtual network connection between |
719 | 1f673135 | bellard | the host kernel and the emulated kernel. The emulated kernel is seen |
720 | 1f673135 | bellard | from the host kernel at IP address 172.20.0.2 and the host kernel is |
721 | 1f673135 | bellard | seen from the emulated kernel at IP address 172.20.0.1. |
722 | 1f673135 | bellard | |
723 | 1f673135 | bellard | @item Launch @code{qemu.sh}. You should have the following output: |
724 | 1f673135 | bellard | |
725 | 1f673135 | bellard | @example |
726 | 1f673135 | bellard | > ./qemu.sh |
727 | 1f673135 | bellard | Connected to host network interface: tun0 |
728 | 1f673135 | bellard | Linux version 2.4.21 (bellard@voyager.localdomain) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #5 Tue Nov 11 18:18:53 CET 2003 |
729 | 1f673135 | bellard | BIOS-provided physical RAM map: |
730 | 1f673135 | bellard | BIOS-e801: 0000000000000000 - 000000000009f000 (usable) |
731 | 1f673135 | bellard | BIOS-e801: 0000000000100000 - 0000000002000000 (usable) |
732 | 1f673135 | bellard | 32MB LOWMEM available. |
733 | 1f673135 | bellard | On node 0 totalpages: 8192 |
734 | 1f673135 | bellard | zone(0): 4096 pages. |
735 | 1f673135 | bellard | zone(1): 4096 pages. |
736 | 1f673135 | bellard | zone(2): 0 pages. |
737 | 1f673135 | bellard | Kernel command line: root=/dev/hda sb=0x220,5,1,5 ide2=noprobe ide3=noprobe ide4=noprobe ide5=noprobe console=ttyS0 |
738 | 1f673135 | bellard | ide_setup: ide2=noprobe |
739 | 1f673135 | bellard | ide_setup: ide3=noprobe |
740 | 1f673135 | bellard | ide_setup: ide4=noprobe |
741 | 1f673135 | bellard | ide_setup: ide5=noprobe |
742 | 1f673135 | bellard | Initializing CPU#0 |
743 | 1f673135 | bellard | Detected 2399.621 MHz processor. |
744 | 1f673135 | bellard | Console: colour EGA 80x25 |
745 | 1f673135 | bellard | Calibrating delay loop... 4744.80 BogoMIPS |
746 | 1f673135 | bellard | Memory: 28872k/32768k available (1210k kernel code, 3508k reserved, 266k data, 64k init, 0k highmem) |
747 | 1f673135 | bellard | Dentry cache hash table entries: 4096 (order: 3, 32768 bytes) |
748 | 1f673135 | bellard | Inode cache hash table entries: 2048 (order: 2, 16384 bytes) |
749 | 1f673135 | bellard | Mount cache hash table entries: 512 (order: 0, 4096 bytes) |
750 | 1f673135 | bellard | Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes) |
751 | 1f673135 | bellard | Page-cache hash table entries: 8192 (order: 3, 32768 bytes) |
752 | 1f673135 | bellard | CPU: Intel Pentium Pro stepping 03 |
753 | 1f673135 | bellard | Checking 'hlt' instruction... OK. |
754 | 1f673135 | bellard | POSIX conformance testing by UNIFIX |
755 | 1f673135 | bellard | Linux NET4.0 for Linux 2.4 |
756 | 1f673135 | bellard | Based upon Swansea University Computer Society NET3.039 |
757 | 1f673135 | bellard | Initializing RT netlink socket |
758 | 1f673135 | bellard | apm: BIOS not found. |
759 | 1f673135 | bellard | Starting kswapd |
760 | 1f673135 | bellard | Journalled Block Device driver loaded |
761 | 1f673135 | bellard | Detected PS/2 Mouse Port. |
762 | 1f673135 | bellard | pty: 256 Unix98 ptys configured |
763 | 1f673135 | bellard | Serial driver version 5.05c (2001-07-08) with no serial options enabled |
764 | 1f673135 | bellard | ttyS00 at 0x03f8 (irq = 4) is a 16450 |
765 | 1f673135 | bellard | ne.c:v1.10 9/23/94 Donald Becker (becker@scyld.com) |
766 | 1f673135 | bellard | Last modified Nov 1, 2000 by Paul Gortmaker |
767 | 1f673135 | bellard | NE*000 ethercard probe at 0x300: 52 54 00 12 34 56 |
768 | 1f673135 | bellard | eth0: NE2000 found at 0x300, using IRQ 9. |
769 | 1f673135 | bellard | RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize |
770 | 1f673135 | bellard | Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4 |
771 | 1f673135 | bellard | ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx |
772 | 1f673135 | bellard | hda: QEMU HARDDISK, ATA DISK drive |
773 | 1f673135 | bellard | ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 |
774 | 1f673135 | bellard | hda: attached ide-disk driver. |
775 | 1f673135 | bellard | hda: 20480 sectors (10 MB) w/256KiB Cache, CHS=20/16/63 |
776 | 1f673135 | bellard | Partition check: |
777 | 1f673135 | bellard | hda: |
778 | 1f673135 | bellard | Soundblaster audio driver Copyright (C) by Hannu Savolainen 1993-1996 |
779 | 1f673135 | bellard | NET4: Linux TCP/IP 1.0 for NET4.0 |
780 | 1f673135 | bellard | IP Protocols: ICMP, UDP, TCP, IGMP |
781 | 1f673135 | bellard | IP: routing cache hash table of 512 buckets, 4Kbytes |
782 | 1f673135 | bellard | TCP: Hash tables configured (established 2048 bind 4096) |
783 | 1f673135 | bellard | NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. |
784 | 1f673135 | bellard | EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended |
785 | 1f673135 | bellard | VFS: Mounted root (ext2 filesystem). |
786 | 1f673135 | bellard | Freeing unused kernel memory: 64k freed |
787 | 1f673135 | bellard | |
788 | 1f673135 | bellard | Linux version 2.4.21 (bellard@voyager.localdomain) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #5 Tue Nov 11 18:18:53 CET 2003 |
789 | 1f673135 | bellard | |
790 | 1f673135 | bellard | QEMU Linux test distribution (based on Redhat 9) |
791 | 1f673135 | bellard | |
792 | 1f673135 | bellard | Type 'exit' to halt the system |
793 | 1f673135 | bellard | |
794 | 1f673135 | bellard | sh-2.05b# |
795 | 1f673135 | bellard | @end example |
796 | 1f673135 | bellard | |
797 | 1f673135 | bellard | @item |
798 | 1f673135 | bellard | Then you can play with the kernel inside the virtual serial console. You |
799 | 1f673135 | bellard | can launch @code{ls} for example. Type @key{Ctrl-a h} to have an help |
800 | 1f673135 | bellard | about the keys you can type inside the virtual serial console. In |
801 | 1f673135 | bellard | particular, use @key{Ctrl-a x} to exit QEMU and use @key{Ctrl-a b} as |
802 | 1f673135 | bellard | the Magic SysRq key. |
803 | 1f673135 | bellard | |
804 | 1f673135 | bellard | @item |
805 | 1f673135 | bellard | If the network is enabled, launch the script @file{/etc/linuxrc} in the |
806 | 1f673135 | bellard | emulator (don't forget the leading dot): |
807 | 1f673135 | bellard | @example |
808 | 1f673135 | bellard | . /etc/linuxrc |
809 | 1f673135 | bellard | @end example |
810 | 1f673135 | bellard | |
811 | 1f673135 | bellard | Then enable X11 connections on your PC from the emulated Linux: |
812 | 1f673135 | bellard | @example |
813 | 1f673135 | bellard | xhost +172.20.0.2 |
814 | 1f673135 | bellard | @end example |
815 | 1f673135 | bellard | |
816 | 1f673135 | bellard | You can now launch @file{xterm} or @file{xlogo} and verify that you have |
817 | 1f673135 | bellard | a real Virtual Linux system ! |
818 | 1f673135 | bellard | |
819 | 1f673135 | bellard | @end enumerate |
820 | 1f673135 | bellard | |
821 | 1f673135 | bellard | NOTES: |
822 | 1f673135 | bellard | @enumerate |
823 | 1f673135 | bellard | @item |
824 | 1f673135 | bellard | A 2.5.74 kernel is also included in the archive. Just |
825 | 1f673135 | bellard | replace the bzImage in qemu.sh to try it. |
826 | 1f673135 | bellard | |
827 | 1f673135 | bellard | @item |
828 | 1f673135 | bellard | qemu-fast creates a temporary file in @var{$QEMU_TMPDIR} (@file{/tmp} is the |
829 | 1f673135 | bellard | default) containing all the simulated PC memory. If possible, try to use |
830 | 1f673135 | bellard | a temporary directory using the tmpfs filesystem to avoid too many |
831 | 1f673135 | bellard | unnecessary disk accesses. |
832 | 1f673135 | bellard | |
833 | 1f673135 | bellard | @item |
834 | 1f673135 | bellard | In order to exit cleanly from qemu, you can do a @emph{shutdown} inside |
835 | 1f673135 | bellard | qemu. qemu will automatically exit when the Linux shutdown is done. |
836 | 1f673135 | bellard | |
837 | 1f673135 | bellard | @item |
838 | 1f673135 | bellard | You can boot slightly faster by disabling the probe of non present IDE |
839 | 1f673135 | bellard | interfaces. To do so, add the following options on the kernel command |
840 | 1f673135 | bellard | line: |
841 | 1f673135 | bellard | @example |
842 | 1f673135 | bellard | ide1=noprobe ide2=noprobe ide3=noprobe ide4=noprobe ide5=noprobe |
843 | 1f673135 | bellard | @end example |
844 | 1f673135 | bellard | |
845 | 1f673135 | bellard | @item |
846 | 1f673135 | bellard | The example disk image is a modified version of the one made by Kevin |
847 | 1f673135 | bellard | Lawton for the plex86 Project (@url{www.plex86.org}). |
848 | 1f673135 | bellard | |
849 | 1f673135 | bellard | @end enumerate |
850 | 1f673135 | bellard | |
851 | 0806e3f6 | bellard | @node linux_compile |
852 | 4690764b | bellard | @section Linux Kernel Compilation |
853 | 4690764b | bellard | |
854 | 285dc330 | bellard | You can use any linux kernel with QEMU. However, if you want to use |
855 | 1f673135 | bellard | @code{qemu-fast} to get maximum performances, you must use a modified |
856 | 1f673135 | bellard | guest kernel. If you are using a 2.6 guest kernel, you can use |
857 | 1f673135 | bellard | directly the patch @file{linux-2.6-qemu-fast.patch} made by Rusty |
858 | 1f673135 | bellard | Russel available in the QEMU source archive. Otherwise, you can make the |
859 | 1f673135 | bellard | following changes @emph{by hand} to the Linux kernel: |
860 | 1eb20527 | bellard | |
861 | 4690764b | bellard | @enumerate |
862 | 4690764b | bellard | @item |
863 | 4690764b | bellard | The kernel must be mapped at 0x90000000 (the default is |
864 | 4690764b | bellard | 0xc0000000). You must modify only two lines in the kernel source: |
865 | 1eb20527 | bellard | |
866 | 4690764b | bellard | In @file{include/asm/page.h}, replace |
867 | 1eb20527 | bellard | @example |
868 | 1eb20527 | bellard | #define __PAGE_OFFSET (0xc0000000) |
869 | 1eb20527 | bellard | @end example |
870 | 1eb20527 | bellard | by |
871 | 1eb20527 | bellard | @example |
872 | 1eb20527 | bellard | #define __PAGE_OFFSET (0x90000000) |
873 | 1eb20527 | bellard | @end example |
874 | 1eb20527 | bellard | |
875 | 4690764b | bellard | And in @file{arch/i386/vmlinux.lds}, replace |
876 | 1eb20527 | bellard | @example |
877 | 1eb20527 | bellard | . = 0xc0000000 + 0x100000; |
878 | 1eb20527 | bellard | @end example |
879 | 1eb20527 | bellard | by |
880 | 1eb20527 | bellard | @example |
881 | 1eb20527 | bellard | . = 0x90000000 + 0x100000; |
882 | 1eb20527 | bellard | @end example |
883 | 1eb20527 | bellard | |
884 | 4690764b | bellard | @item |
885 | 4690764b | bellard | If you want to enable SMP (Symmetric Multi-Processing) support, you |
886 | 4690764b | bellard | must make the following change in @file{include/asm/fixmap.h}. Replace |
887 | 1eb20527 | bellard | @example |
888 | 4690764b | bellard | #define FIXADDR_TOP (0xffffX000UL) |
889 | 1eb20527 | bellard | @end example |
890 | 4690764b | bellard | by |
891 | 4690764b | bellard | @example |
892 | 4690764b | bellard | #define FIXADDR_TOP (0xa7ffX000UL) |
893 | 4690764b | bellard | @end example |
894 | 4690764b | bellard | (X is 'e' or 'f' depending on the kernel version). Although you can |
895 | 4690764b | bellard | use an SMP kernel with QEMU, it only supports one CPU. |
896 | 1eb20527 | bellard | |
897 | 4690764b | bellard | @item |
898 | 1f673135 | bellard | If you are not using a 2.6 kernel as host kernel but if you use a target |
899 | 1f673135 | bellard | 2.6 kernel, you must also ensure that the 'HZ' define is set to 100 |
900 | d5a0b50c | bellard | (1000 is the default) as QEMU cannot currently emulate timers at |
901 | 1f673135 | bellard | frequencies greater than 100 Hz on host Linux systems < 2.6. In |
902 | 4690764b | bellard | @file{include/asm/param.h}, replace: |
903 | d5a0b50c | bellard | |
904 | d5a0b50c | bellard | @example |
905 | d5a0b50c | bellard | # define HZ 1000 /* Internal kernel timer frequency */ |
906 | d5a0b50c | bellard | @end example |
907 | d5a0b50c | bellard | by |
908 | d5a0b50c | bellard | @example |
909 | d5a0b50c | bellard | # define HZ 100 /* Internal kernel timer frequency */ |
910 | d5a0b50c | bellard | @end example |
911 | d5a0b50c | bellard | |
912 | 4690764b | bellard | @end enumerate |
913 | 4690764b | bellard | |
914 | 4690764b | bellard | The file config-2.x.x gives the configuration of the example kernels. |
915 | 4690764b | bellard | |
916 | 4690764b | bellard | Just type |
917 | 4690764b | bellard | @example |
918 | 4690764b | bellard | make bzImage |
919 | 4690764b | bellard | @end example |
920 | 4690764b | bellard | |
921 | 4690764b | bellard | As you would do to make a real kernel. Then you can use with QEMU |
922 | 4690764b | bellard | exactly the same kernel as you would boot on your PC (in |
923 | 4690764b | bellard | @file{arch/i386/boot/bzImage}). |
924 | da415d54 | bellard | |
925 | 0806e3f6 | bellard | @node gdb_usage |
926 | da415d54 | bellard | @section GDB usage |
927 | da415d54 | bellard | |
928 | da415d54 | bellard | QEMU has a primitive support to work with gdb, so that you can do |
929 | 0806e3f6 | bellard | 'Ctrl-C' while the virtual machine is running and inspect its state. |
930 | da415d54 | bellard | |
931 | 9d4520d0 | bellard | In order to use gdb, launch qemu with the '-s' option. It will wait for a |
932 | da415d54 | bellard | gdb connection: |
933 | da415d54 | bellard | @example |
934 | 6c9bf893 | bellard | > qemu -s -kernel arch/i386/boot/bzImage -hda root-2.4.20.img -append "root=/dev/hda" |
935 | da415d54 | bellard | Connected to host network interface: tun0 |
936 | da415d54 | bellard | Waiting gdb connection on port 1234 |
937 | da415d54 | bellard | @end example |
938 | da415d54 | bellard | |
939 | da415d54 | bellard | Then launch gdb on the 'vmlinux' executable: |
940 | da415d54 | bellard | @example |
941 | da415d54 | bellard | > gdb vmlinux |
942 | da415d54 | bellard | @end example |
943 | da415d54 | bellard | |
944 | da415d54 | bellard | In gdb, connect to QEMU: |
945 | da415d54 | bellard | @example |
946 | 6c9bf893 | bellard | (gdb) target remote localhost:1234 |
947 | da415d54 | bellard | @end example |
948 | da415d54 | bellard | |
949 | da415d54 | bellard | Then you can use gdb normally. For example, type 'c' to launch the kernel: |
950 | da415d54 | bellard | @example |
951 | da415d54 | bellard | (gdb) c |
952 | da415d54 | bellard | @end example |
953 | da415d54 | bellard | |
954 | 0806e3f6 | bellard | Here are some useful tips in order to use gdb on system code: |
955 | 0806e3f6 | bellard | |
956 | 0806e3f6 | bellard | @enumerate |
957 | 0806e3f6 | bellard | @item |
958 | 0806e3f6 | bellard | Use @code{info reg} to display all the CPU registers. |
959 | 0806e3f6 | bellard | @item |
960 | 0806e3f6 | bellard | Use @code{x/10i $eip} to display the code at the PC position. |
961 | 0806e3f6 | bellard | @item |
962 | 0806e3f6 | bellard | Use @code{set architecture i8086} to dump 16 bit code. Then use |
963 | 0806e3f6 | bellard | @code{x/10i $cs*16+*eip} to dump the code at the PC position. |
964 | 0806e3f6 | bellard | @end enumerate |
965 | 0806e3f6 | bellard | |
966 | 1a084f3d | bellard | @section Target OS specific information |
967 | 1a084f3d | bellard | |
968 | 1a084f3d | bellard | @subsection Linux |
969 | 1a084f3d | bellard | |
970 | 15a34c63 | bellard | To have access to SVGA graphic modes under X11, use the @code{vesa} or |
971 | 15a34c63 | bellard | the @code{cirrus} X11 driver. For optimal performances, use 16 bit |
972 | 15a34c63 | bellard | color depth in the guest and the host OS. |
973 | 1a084f3d | bellard | |
974 | e3371e62 | bellard | When using a 2.6 guest Linux kernel, you should add the option |
975 | e3371e62 | bellard | @code{clock=pit} on the kernel command line because the 2.6 Linux |
976 | e3371e62 | bellard | kernels make very strict real time clock checks by default that QEMU |
977 | e3371e62 | bellard | cannot simulate exactly. |
978 | e3371e62 | bellard | |
979 | 1a084f3d | bellard | @subsection Windows |
980 | 1a084f3d | bellard | |
981 | 1a084f3d | bellard | If you have a slow host, using Windows 95 is better as it gives the |
982 | 1a084f3d | bellard | best speed. Windows 2000 is also a good choice. |
983 | 1a084f3d | bellard | |
984 | e3371e62 | bellard | @subsubsection SVGA graphic modes support |
985 | e3371e62 | bellard | |
986 | e3371e62 | bellard | QEMU emulates a Cirrus Logic GD5446 Video |
987 | 15a34c63 | bellard | card. All Windows versions starting from Windows 95 should recognize |
988 | 15a34c63 | bellard | and use this graphic card. For optimal performances, use 16 bit color |
989 | 15a34c63 | bellard | depth in the guest and the host OS. |
990 | 1a084f3d | bellard | |
991 | e3371e62 | bellard | @subsubsection CPU usage reduction |
992 | e3371e62 | bellard | |
993 | e3371e62 | bellard | Windows 9x does not correctly use the CPU HLT |
994 | 15a34c63 | bellard | instruction. The result is that it takes host CPU cycles even when |
995 | 15a34c63 | bellard | idle. You can install the utility from |
996 | 15a34c63 | bellard | @url{http://www.user.cityline.ru/~maxamn/amnhltm.zip} to solve this |
997 | 15a34c63 | bellard | problem. Note that no such tool is needed for NT, 2000 or XP. |
998 | 1a084f3d | bellard | |
999 | e3371e62 | bellard | @subsubsection Windows 2000 disk full problems |
1000 | e3371e62 | bellard | |
1001 | e3371e62 | bellard | Currently (release 0.6.0) QEMU has a bug which gives a @code{disk |
1002 | e3371e62 | bellard | full} error during installation of some releases of Windows 2000. The |
1003 | e3371e62 | bellard | workaround is to stop QEMU as soon as you notice that your disk image |
1004 | e3371e62 | bellard | size is growing too fast (monitor it with @code{ls -ls}). Then |
1005 | e3371e62 | bellard | relaunch QEMU to continue the installation. If you still experience |
1006 | e3371e62 | bellard | the problem, relaunch QEMU again. |
1007 | e3371e62 | bellard | |
1008 | e3371e62 | bellard | Future QEMU releases are likely to correct this bug. |
1009 | e3371e62 | bellard | |
1010 | e3371e62 | bellard | @subsubsection Windows XP security problems |
1011 | e3371e62 | bellard | |
1012 | e3371e62 | bellard | Some releases of Windows XP install correctly but give a security |
1013 | e3371e62 | bellard | error when booting: |
1014 | e3371e62 | bellard | @example |
1015 | e3371e62 | bellard | A problem is preventing Windows from accurately checking the |
1016 | e3371e62 | bellard | license for this computer. Error code: 0x800703e6. |
1017 | e3371e62 | bellard | @end example |
1018 | e3371e62 | bellard | The only known workaround is to boot in Safe mode |
1019 | e3371e62 | bellard | without networking support. |
1020 | e3371e62 | bellard | |
1021 | e3371e62 | bellard | Future QEMU releases are likely to correct this bug. |
1022 | e3371e62 | bellard | |
1023 | a0a821a4 | bellard | @subsection MS-DOS and FreeDOS |
1024 | a0a821a4 | bellard | |
1025 | a0a821a4 | bellard | @subsubsection CPU usage reduction |
1026 | a0a821a4 | bellard | |
1027 | a0a821a4 | bellard | DOS does not correctly use the CPU HLT instruction. The result is that |
1028 | a0a821a4 | bellard | it takes host CPU cycles even when idle. You can install the utility |
1029 | a0a821a4 | bellard | from @url{http://www.vmware.com/software/dosidle210.zip} to solve this |
1030 | a0a821a4 | bellard | problem. |
1031 | a0a821a4 | bellard | |
1032 | 15a34c63 | bellard | @chapter QEMU PowerPC System emulator invocation |
1033 | 1a084f3d | bellard | |
1034 | 15a34c63 | bellard | Use the executable @file{qemu-system-ppc} to simulate a complete PREP |
1035 | 15a34c63 | bellard | or PowerMac PowerPC system. |
1036 | 1a084f3d | bellard | |
1037 | 15a34c63 | bellard | QEMU emulates the following PowerMac peripherials: |
1038 | 1a084f3d | bellard | |
1039 | 15a34c63 | bellard | @itemize @minus |
1040 | 15a34c63 | bellard | @item |
1041 | 15a34c63 | bellard | UniNorth PCI Bridge |
1042 | 15a34c63 | bellard | @item |
1043 | 15a34c63 | bellard | PCI VGA compatible card with VESA Bochs Extensions |
1044 | 15a34c63 | bellard | @item |
1045 | 15a34c63 | bellard | 2 PMAC IDE interfaces with hard disk and CD-ROM support |
1046 | 15a34c63 | bellard | @item |
1047 | 15a34c63 | bellard | NE2000 PCI adapters |
1048 | 15a34c63 | bellard | @item |
1049 | 15a34c63 | bellard | Non Volatile RAM |
1050 | 15a34c63 | bellard | @item |
1051 | 15a34c63 | bellard | VIA-CUDA with ADB keyboard and mouse. |
1052 | 1a084f3d | bellard | @end itemize |
1053 | 1a084f3d | bellard | |
1054 | 52c00a5f | bellard | QEMU emulates the following PREP peripherials: |
1055 | 52c00a5f | bellard | |
1056 | 52c00a5f | bellard | @itemize @minus |
1057 | 52c00a5f | bellard | @item |
1058 | 15a34c63 | bellard | PCI Bridge |
1059 | 15a34c63 | bellard | @item |
1060 | 15a34c63 | bellard | PCI VGA compatible card with VESA Bochs Extensions |
1061 | 15a34c63 | bellard | @item |
1062 | 52c00a5f | bellard | 2 IDE interfaces with hard disk and CD-ROM support |
1063 | 52c00a5f | bellard | @item |
1064 | 52c00a5f | bellard | Floppy disk |
1065 | 52c00a5f | bellard | @item |
1066 | 15a34c63 | bellard | NE2000 network adapters |
1067 | 52c00a5f | bellard | @item |
1068 | 52c00a5f | bellard | Serial port |
1069 | 52c00a5f | bellard | @item |
1070 | 52c00a5f | bellard | PREP Non Volatile RAM |
1071 | 15a34c63 | bellard | @item |
1072 | 15a34c63 | bellard | PC compatible keyboard and mouse. |
1073 | 52c00a5f | bellard | @end itemize |
1074 | 52c00a5f | bellard | |
1075 | 15a34c63 | bellard | QEMU uses the Open Hack'Ware Open Firmware Compatible BIOS available at |
1076 | 15a34c63 | bellard | @url{http://site.voila.fr/jmayer/OpenHackWare/index.htm}. |
1077 | 15a34c63 | bellard | |
1078 | 52c00a5f | bellard | You can read the qemu PC system emulation chapter to have more |
1079 | 52c00a5f | bellard | informations about QEMU usage. |
1080 | 52c00a5f | bellard | |
1081 | 15a34c63 | bellard | @c man begin OPTIONS |
1082 | 15a34c63 | bellard | |
1083 | 15a34c63 | bellard | The following options are specific to the PowerPC emulation: |
1084 | 15a34c63 | bellard | |
1085 | 15a34c63 | bellard | @table @option |
1086 | 15a34c63 | bellard | |
1087 | 15a34c63 | bellard | @item -prep |
1088 | 15a34c63 | bellard | Simulate a PREP system (default is PowerMAC) |
1089 | 15a34c63 | bellard | |
1090 | 15a34c63 | bellard | @item -g WxH[xDEPTH] |
1091 | 15a34c63 | bellard | |
1092 | 15a34c63 | bellard | Set the initial VGA graphic mode. The default is 800x600x15. |
1093 | 15a34c63 | bellard | |
1094 | 15a34c63 | bellard | @end table |
1095 | 15a34c63 | bellard | |
1096 | 15a34c63 | bellard | @c man end |
1097 | 15a34c63 | bellard | |
1098 | 15a34c63 | bellard | |
1099 | 52c00a5f | bellard | More information is available at |
1100 | 52c00a5f | bellard | @url{http://jocelyn.mayer.free.fr/qemu-ppc/}. |
1101 | 52c00a5f | bellard | |
1102 | e80cfcfc | bellard | @chapter Sparc System emulator invocation |
1103 | e80cfcfc | bellard | |
1104 | e80cfcfc | bellard | Use the executable @file{qemu-system-sparc} to simulate a JavaStation |
1105 | e80cfcfc | bellard | (sun4m architecture). The emulation is far from complete. |
1106 | e80cfcfc | bellard | |
1107 | e80cfcfc | bellard | QEMU emulates the following sun4m peripherials: |
1108 | e80cfcfc | bellard | |
1109 | e80cfcfc | bellard | @itemize @minus |
1110 | e80cfcfc | bellard | @item |
1111 | e80cfcfc | bellard | IOMMU |
1112 | e80cfcfc | bellard | @item |
1113 | e80cfcfc | bellard | TCX Frame buffer |
1114 | e80cfcfc | bellard | @item |
1115 | e80cfcfc | bellard | Lance (Am7990) Ethernet |
1116 | e80cfcfc | bellard | @item |
1117 | e80cfcfc | bellard | Non Volatile RAM M48T08 |
1118 | e80cfcfc | bellard | @item |
1119 | e80cfcfc | bellard | Slave I/O: timers, interrupt controllers, Zilog serial ports |
1120 | e80cfcfc | bellard | @end itemize |
1121 | e80cfcfc | bellard | |
1122 | e80cfcfc | bellard | QEMU uses the Proll, a PROM replacement available at |
1123 | e80cfcfc | bellard | @url{http://people.redhat.com/zaitcev/linux/}. |
1124 | e80cfcfc | bellard | |
1125 | 1f673135 | bellard | @chapter QEMU User space emulator invocation |
1126 | 386405f7 | bellard | |
1127 | 1f673135 | bellard | @section Quick Start |
1128 | df0f11a0 | bellard | |
1129 | 1f673135 | bellard | In order to launch a Linux process, QEMU needs the process executable |
1130 | 1f673135 | bellard | itself and all the target (x86) dynamic libraries used by it. |
1131 | 386405f7 | bellard | |
1132 | 1f673135 | bellard | @itemize |
1133 | 386405f7 | bellard | |
1134 | 1f673135 | bellard | @item On x86, you can just try to launch any process by using the native |
1135 | 1f673135 | bellard | libraries: |
1136 | 386405f7 | bellard | |
1137 | 1f673135 | bellard | @example |
1138 | 1f673135 | bellard | qemu-i386 -L / /bin/ls |
1139 | 1f673135 | bellard | @end example |
1140 | 386405f7 | bellard | |
1141 | 1f673135 | bellard | @code{-L /} tells that the x86 dynamic linker must be searched with a |
1142 | 1f673135 | bellard | @file{/} prefix. |
1143 | 386405f7 | bellard | |
1144 | 1f673135 | bellard | @item Since QEMU is also a linux process, you can launch qemu with qemu (NOTE: you can only do that if you compiled QEMU from the sources): |
1145 | 386405f7 | bellard | |
1146 | 1f673135 | bellard | @example |
1147 | 1f673135 | bellard | qemu-i386 -L / qemu-i386 -L / /bin/ls |
1148 | 1f673135 | bellard | @end example |
1149 | 386405f7 | bellard | |
1150 | 1f673135 | bellard | @item On non x86 CPUs, you need first to download at least an x86 glibc |
1151 | 1f673135 | bellard | (@file{qemu-runtime-i386-XXX-.tar.gz} on the QEMU web page). Ensure that |
1152 | 1f673135 | bellard | @code{LD_LIBRARY_PATH} is not set: |
1153 | df0f11a0 | bellard | |
1154 | 1f673135 | bellard | @example |
1155 | 1f673135 | bellard | unset LD_LIBRARY_PATH |
1156 | 1f673135 | bellard | @end example |
1157 | 1eb87257 | bellard | |
1158 | 1f673135 | bellard | Then you can launch the precompiled @file{ls} x86 executable: |
1159 | 1eb87257 | bellard | |
1160 | 1f673135 | bellard | @example |
1161 | 1f673135 | bellard | qemu-i386 tests/i386/ls |
1162 | 1f673135 | bellard | @end example |
1163 | 1f673135 | bellard | You can look at @file{qemu-binfmt-conf.sh} so that |
1164 | 1f673135 | bellard | QEMU is automatically launched by the Linux kernel when you try to |
1165 | 1f673135 | bellard | launch x86 executables. It requires the @code{binfmt_misc} module in the |
1166 | 1f673135 | bellard | Linux kernel. |
1167 | 1eb87257 | bellard | |
1168 | 1f673135 | bellard | @item The x86 version of QEMU is also included. You can try weird things such as: |
1169 | 1f673135 | bellard | @example |
1170 | 1f673135 | bellard | qemu-i386 /usr/local/qemu-i386/bin/qemu-i386 /usr/local/qemu-i386/bin/ls-i386 |
1171 | 1f673135 | bellard | @end example |
1172 | 1eb20527 | bellard | |
1173 | 1f673135 | bellard | @end itemize |
1174 | 1eb20527 | bellard | |
1175 | 1f673135 | bellard | @section Wine launch |
1176 | 1eb20527 | bellard | |
1177 | 1f673135 | bellard | @itemize |
1178 | 386405f7 | bellard | |
1179 | 1f673135 | bellard | @item Ensure that you have a working QEMU with the x86 glibc |
1180 | 1f673135 | bellard | distribution (see previous section). In order to verify it, you must be |
1181 | 1f673135 | bellard | able to do: |
1182 | 386405f7 | bellard | |
1183 | 1f673135 | bellard | @example |
1184 | 1f673135 | bellard | qemu-i386 /usr/local/qemu-i386/bin/ls-i386 |
1185 | 1f673135 | bellard | @end example |
1186 | 386405f7 | bellard | |
1187 | 1f673135 | bellard | @item Download the binary x86 Wine install |
1188 | 1f673135 | bellard | (@file{qemu-XXX-i386-wine.tar.gz} on the QEMU web page). |
1189 | 386405f7 | bellard | |
1190 | 1f673135 | bellard | @item Configure Wine on your account. Look at the provided script |
1191 | 1f673135 | bellard | @file{/usr/local/qemu-i386/bin/wine-conf.sh}. Your previous |
1192 | 1f673135 | bellard | @code{$@{HOME@}/.wine} directory is saved to @code{$@{HOME@}/.wine.org}. |
1193 | 386405f7 | bellard | |
1194 | 1f673135 | bellard | @item Then you can try the example @file{putty.exe}: |
1195 | 386405f7 | bellard | |
1196 | 1f673135 | bellard | @example |
1197 | 1f673135 | bellard | qemu-i386 /usr/local/qemu-i386/wine/bin/wine /usr/local/qemu-i386/wine/c/Program\ Files/putty.exe |
1198 | 1f673135 | bellard | @end example |
1199 | 386405f7 | bellard | |
1200 | 1f673135 | bellard | @end itemize |
1201 | fd429f2f | bellard | |
1202 | 1f673135 | bellard | @section Command line options |
1203 | 1eb20527 | bellard | |
1204 | 1f673135 | bellard | @example |
1205 | 1f673135 | bellard | usage: qemu-i386 [-h] [-d] [-L path] [-s size] program [arguments...] |
1206 | 1f673135 | bellard | @end example |
1207 | 1eb20527 | bellard | |
1208 | 1f673135 | bellard | @table @option |
1209 | 1f673135 | bellard | @item -h |
1210 | 1f673135 | bellard | Print the help |
1211 | 1f673135 | bellard | @item -L path |
1212 | 1f673135 | bellard | Set the x86 elf interpreter prefix (default=/usr/local/qemu-i386) |
1213 | 1f673135 | bellard | @item -s size |
1214 | 1f673135 | bellard | Set the x86 stack size in bytes (default=524288) |
1215 | 386405f7 | bellard | @end table |
1216 | 386405f7 | bellard | |
1217 | 1f673135 | bellard | Debug options: |
1218 | 386405f7 | bellard | |
1219 | 1f673135 | bellard | @table @option |
1220 | 1f673135 | bellard | @item -d |
1221 | 1f673135 | bellard | Activate log (logfile=/tmp/qemu.log) |
1222 | 1f673135 | bellard | @item -p pagesize |
1223 | 1f673135 | bellard | Act as if the host page size was 'pagesize' bytes |
1224 | 1f673135 | bellard | @end table |
1225 | 386405f7 | bellard | |
1226 | 15a34c63 | bellard | @node compilation |
1227 | 15a34c63 | bellard | @chapter Compilation from the sources |
1228 | 15a34c63 | bellard | |
1229 | 15a34c63 | bellard | @section Linux/BSD |
1230 | 15a34c63 | bellard | |
1231 | 15a34c63 | bellard | Read the @file{README} which gives the related information. |
1232 | 15a34c63 | bellard | |
1233 | 15a34c63 | bellard | @section Windows |
1234 | 15a34c63 | bellard | |
1235 | 15a34c63 | bellard | @itemize |
1236 | 15a34c63 | bellard | @item Install the current versions of MSYS and MinGW from |
1237 | 15a34c63 | bellard | @url{http://www.mingw.org/}. You can find detailed installation |
1238 | 15a34c63 | bellard | instructions in the download section and the FAQ. |
1239 | 15a34c63 | bellard | |
1240 | 15a34c63 | bellard | @item Download |
1241 | 15a34c63 | bellard | the MinGW development library of SDL 1.2.x |
1242 | 15a34c63 | bellard | (@file{SDL-devel-1.2.x-mingw32.tar.gz}) from |
1243 | 15a34c63 | bellard | @url{http://www.libsdl.org}. Unpack it in a temporary place, and |
1244 | 15a34c63 | bellard | unpack the archive @file{i386-mingw32msvc.tar.gz} in the MinGW tool |
1245 | 15a34c63 | bellard | directory. Edit the @file{sdl-config} script so that it gives the |
1246 | 15a34c63 | bellard | correct SDL directory when invoked. |
1247 | 15a34c63 | bellard | |
1248 | 15a34c63 | bellard | @item Extract the current version of QEMU. |
1249 | 15a34c63 | bellard | |
1250 | 15a34c63 | bellard | @item Start the MSYS shell (file @file{msys.bat}). |
1251 | 15a34c63 | bellard | |
1252 | 15a34c63 | bellard | @item Change to the QEMU directory. Launch @file{./configure} and |
1253 | 15a34c63 | bellard | @file{make}. If you have problems using SDL, verify that |
1254 | 15a34c63 | bellard | @file{sdl-config} can be launched from the MSYS command line. |
1255 | 15a34c63 | bellard | |
1256 | 15a34c63 | bellard | @item You can install QEMU in @file{Program Files/Qemu} by typing |
1257 | 15a34c63 | bellard | @file{make install}. Don't forget to copy @file{SDL.dll} in |
1258 | 15a34c63 | bellard | @file{Program Files/Qemu}. |
1259 | 15a34c63 | bellard | |
1260 | 15a34c63 | bellard | @end itemize |
1261 | 15a34c63 | bellard | |
1262 | 15a34c63 | bellard | @section Cross compilation for Windows with Linux |
1263 | 15a34c63 | bellard | |
1264 | 15a34c63 | bellard | @itemize |
1265 | 15a34c63 | bellard | @item |
1266 | 15a34c63 | bellard | Install the MinGW cross compilation tools available at |
1267 | 15a34c63 | bellard | @url{http://www.mingw.org/}. |
1268 | 15a34c63 | bellard | |
1269 | 15a34c63 | bellard | @item |
1270 | 15a34c63 | bellard | Install the Win32 version of SDL (@url{http://www.libsdl.org}) by |
1271 | 15a34c63 | bellard | unpacking @file{i386-mingw32msvc.tar.gz}. Set up the PATH environment |
1272 | 15a34c63 | bellard | variable so that @file{i386-mingw32msvc-sdl-config} can be launched by |
1273 | 15a34c63 | bellard | the QEMU configuration script. |
1274 | 15a34c63 | bellard | |
1275 | 15a34c63 | bellard | @item |
1276 | 15a34c63 | bellard | Configure QEMU for Windows cross compilation: |
1277 | 15a34c63 | bellard | @example |
1278 | 15a34c63 | bellard | ./configure --enable-mingw32 |
1279 | 15a34c63 | bellard | @end example |
1280 | 15a34c63 | bellard | If necessary, you can change the cross-prefix according to the prefix |
1281 | 15a34c63 | bellard | choosen for the MinGW tools with --cross-prefix. You can also use |
1282 | 15a34c63 | bellard | --prefix to set the Win32 install path. |
1283 | 15a34c63 | bellard | |
1284 | 15a34c63 | bellard | @item You can install QEMU in the installation directory by typing |
1285 | 15a34c63 | bellard | @file{make install}. Don't forget to copy @file{SDL.dll} in the |
1286 | 15a34c63 | bellard | installation directory. |
1287 | 15a34c63 | bellard | |
1288 | 15a34c63 | bellard | @end itemize |
1289 | 15a34c63 | bellard | |
1290 | 15a34c63 | bellard | Note: Currently, Wine does not seem able to launch |
1291 | 15a34c63 | bellard | QEMU for Win32. |
1292 | 15a34c63 | bellard | |
1293 | 15a34c63 | bellard | @section Mac OS X |
1294 | 15a34c63 | bellard | |
1295 | 15a34c63 | bellard | The Mac OS X patches are not fully merged in QEMU, so you should look |
1296 | 15a34c63 | bellard | at the QEMU mailing list archive to have all the necessary |
1297 | 15a34c63 | bellard | information. |