📄 qemu-doc.html
字号:
<HTML><HEAD><!-- Created by texi2html 1.56k from qemu-doc.texi on 3 May 2006 --><TITLE>QEMU CPU Emulator User Documentation</TITLE></HEAD><BODY><H1>QEMU CPU Emulator User Documentation</H1><P><P><HR><P><H1>Table of Contents</H1><UL><LI><A NAME="TOC1" HREF="qemu-doc.html#SEC1">1. Introduction</A><UL><LI><A NAME="TOC2" HREF="qemu-doc.html#SEC2">1.1 Features</A></UL><LI><A NAME="TOC3" HREF="qemu-doc.html#SEC3">2. Installation</A><UL><LI><A NAME="TOC4" HREF="qemu-doc.html#SEC4">2.1 Linux</A><LI><A NAME="TOC5" HREF="qemu-doc.html#SEC5">2.2 Windows</A><LI><A NAME="TOC6" HREF="qemu-doc.html#SEC6">2.3 Mac OS X</A></UL><LI><A NAME="TOC7" HREF="qemu-doc.html#SEC7">3. QEMU PC System emulator</A><UL><LI><A NAME="TOC8" HREF="qemu-doc.html#SEC8">3.1 Introduction</A><LI><A NAME="TOC9" HREF="qemu-doc.html#SEC9">3.2 Quick Start</A><LI><A NAME="TOC10" HREF="qemu-doc.html#SEC10">3.3 Invocation</A><LI><A NAME="TOC11" HREF="qemu-doc.html#SEC11">3.4 Keys</A><LI><A NAME="TOC12" HREF="qemu-doc.html#SEC12">3.5 QEMU Monitor</A><UL><LI><A NAME="TOC13" HREF="qemu-doc.html#SEC13">3.5.1 Commands</A><LI><A NAME="TOC14" HREF="qemu-doc.html#SEC14">3.5.2 Integer expressions</A></UL><LI><A NAME="TOC15" HREF="qemu-doc.html#SEC15">3.6 Disk Images</A><UL><LI><A NAME="TOC16" HREF="qemu-doc.html#SEC16">3.6.1 Quick start for disk image creation</A><LI><A NAME="TOC17" HREF="qemu-doc.html#SEC17">3.6.2 Snapshot mode</A><LI><A NAME="TOC18" HREF="qemu-doc.html#SEC18">3.6.3 <CODE>qemu-img</CODE> Invocation</A><LI><A NAME="TOC19" HREF="qemu-doc.html#SEC19">3.6.4 Virtual FAT disk images</A></UL><LI><A NAME="TOC20" HREF="qemu-doc.html#SEC20">3.7 Network emulation</A><UL><LI><A NAME="TOC21" HREF="qemu-doc.html#SEC21">3.7.1 VLANs</A><LI><A NAME="TOC22" HREF="qemu-doc.html#SEC22">3.7.2 Using TAP network interfaces</A><LI><A NAME="TOC23" HREF="qemu-doc.html#SEC23">3.7.3 Using the user mode network stack</A><LI><A NAME="TOC24" HREF="qemu-doc.html#SEC24">3.7.4 Connecting VLANs between QEMU instances</A></UL><LI><A NAME="TOC25" HREF="qemu-doc.html#SEC25">3.8 Direct Linux Boot</A><LI><A NAME="TOC26" HREF="qemu-doc.html#SEC26">3.9 USB emulation</A><UL><LI><A NAME="TOC27" HREF="qemu-doc.html#SEC27">3.9.1 Using virtual USB devices</A><LI><A NAME="TOC28" HREF="qemu-doc.html#SEC28">3.9.2 Using host USB devices on a Linux host</A></UL><LI><A NAME="TOC29" HREF="qemu-doc.html#SEC29">3.10 GDB usage</A><LI><A NAME="TOC30" HREF="qemu-doc.html#SEC30">3.11 Target OS specific information</A><UL><LI><A NAME="TOC31" HREF="qemu-doc.html#SEC31">3.11.1 Linux</A><LI><A NAME="TOC32" HREF="qemu-doc.html#SEC32">3.11.2 Windows</A><UL><LI><A NAME="TOC33" HREF="qemu-doc.html#SEC33">3.11.2.1 SVGA graphic modes support</A><LI><A NAME="TOC34" HREF="qemu-doc.html#SEC34">3.11.2.2 CPU usage reduction</A><LI><A NAME="TOC35" HREF="qemu-doc.html#SEC35">3.11.2.3 Windows 2000 disk full problem</A><LI><A NAME="TOC36" HREF="qemu-doc.html#SEC36">3.11.2.4 Windows 2000 shutdown</A><LI><A NAME="TOC37" HREF="qemu-doc.html#SEC37">3.11.2.5 Share a directory between Unix and Windows</A><LI><A NAME="TOC38" HREF="qemu-doc.html#SEC38">3.11.2.6 Windows XP security problems</A></UL><LI><A NAME="TOC39" HREF="qemu-doc.html#SEC39">3.11.3 MS-DOS and FreeDOS</A><UL><LI><A NAME="TOC40" HREF="qemu-doc.html#SEC40">3.11.3.1 CPU usage reduction</A></UL></UL></UL><LI><A NAME="TOC41" HREF="qemu-doc.html#SEC41">4. QEMU System emulator for non PC targets</A><UL><LI><A NAME="TOC42" HREF="qemu-doc.html#SEC42">4.1 QEMU PowerPC System emulator</A><LI><A NAME="TOC43" HREF="qemu-doc.html#SEC43">4.2 Sparc32 System emulator invocation</A><LI><A NAME="TOC44" HREF="qemu-doc.html#SEC44">4.3 Sparc64 System emulator invocation</A><LI><A NAME="TOC45" HREF="qemu-doc.html#SEC45">4.4 MIPS System emulator invocation</A><LI><A NAME="TOC46" HREF="qemu-doc.html#SEC46">4.5 ARM System emulator invocation</A></UL><LI><A NAME="TOC47" HREF="qemu-doc.html#SEC47">5. QEMU Linux User space emulator</A><UL><LI><A NAME="TOC48" HREF="qemu-doc.html#SEC48">5.1 Quick Start</A><LI><A NAME="TOC49" HREF="qemu-doc.html#SEC49">5.2 Wine launch</A><LI><A NAME="TOC50" HREF="qemu-doc.html#SEC50">5.3 Command line options</A></UL><LI><A NAME="TOC51" HREF="qemu-doc.html#SEC51">6. Compilation from the sources</A><UL><LI><A NAME="TOC52" HREF="qemu-doc.html#SEC52">6.1 Linux/Unix</A><UL><LI><A NAME="TOC53" HREF="qemu-doc.html#SEC53">6.1.1 Compilation</A><LI><A NAME="TOC54" HREF="qemu-doc.html#SEC54">6.1.2 Tested tool versions</A></UL><LI><A NAME="TOC55" HREF="qemu-doc.html#SEC55">6.2 Windows</A><LI><A NAME="TOC56" HREF="qemu-doc.html#SEC56">6.3 Cross compilation for Windows with Linux</A><LI><A NAME="TOC57" HREF="qemu-doc.html#SEC57">6.4 Mac OS X</A></UL><LI><A NAME="TOC58" HREF="qemu-doc.html#SEC58">7. Index</A></UL><P><HR><P><H1><A NAME="SEC1" HREF="qemu-doc.html#TOC1">1. Introduction</A></H1><H2><A NAME="SEC2" HREF="qemu-doc.html#TOC2">1.1 Features</A></H2><P>QEMU is a FAST! processor emulator using dynamic translation toachieve good emulation speed.<P>QEMU has two operating modes:<UL><LI>Full system emulation. In this mode, QEMU emulates a full system (forexample a PC), including one or several processors and variousperipherals. It can be used to launch different Operating Systemswithout rebooting the PC or to debug system code.<LI>User mode emulation (Linux host only). In this mode, QEMU can launchLinux processes compiled for one CPU on another CPU. It can be used tolaunch the Wine Windows API emulator (<A HREF="http://www.winehq.org">http://www.winehq.org</A>) orto ease cross-compilation and cross-debugging.</UL><P>QEMU can run without an host kernel driver and yet gives acceptableperformance. <P>For system emulation, the following hardware targets are supported:<UL><LI>PC (x86 or x86_64 processor)<LI>ISA PC (old style PC without PCI bus)<LI>PREP (PowerPC processor)<LI>G3 BW PowerMac (PowerPC processor)<LI>Mac99 PowerMac (PowerPC processor, in progress)<LI>Sun4m (32-bit Sparc processor)<LI>Sun4u (64-bit Sparc processor, in progress)<LI>Malta board (32-bit MIPS processor)<LI>ARM Integrator/CP (ARM926E or 1026E processor)</UL><P>For user emulation, x86, PowerPC, ARM, MIPS, and Sparc32/64 CPUs are supported.<H1><A NAME="SEC3" HREF="qemu-doc.html#TOC3">2. Installation</A></H1><P>If you want to compile QEMU yourself, see section <A HREF="qemu-doc.html#SEC51">6. Compilation from the sources</A>.<H2><A NAME="SEC4" HREF="qemu-doc.html#TOC4">2.1 Linux</A></H2><P>If a precompiled package is available for your distribution - you justhave to install it. Otherwise, see section <A HREF="qemu-doc.html#SEC51">6. Compilation from the sources</A>.<H2><A NAME="SEC5" HREF="qemu-doc.html#TOC5">2.2 Windows</A></H2><P>Download the experimental binary installer at<A HREF="http://www.free.oszoo.org/@/download.html">http://www.free.oszoo.org/@/download.html</A>.<H2><A NAME="SEC6" HREF="qemu-doc.html#TOC6">2.3 Mac OS X</A></H2><P>Download the experimental binary installer at<A HREF="http://www.free.oszoo.org/@/download.html">http://www.free.oszoo.org/@/download.html</A>.<H1><A NAME="SEC7" HREF="qemu-doc.html#TOC7">3. QEMU PC System emulator</A></H1><H2><A NAME="SEC8" HREF="qemu-doc.html#TOC8">3.1 Introduction</A></H2><P>The QEMU PC System emulator simulates thefollowing peripherals:<UL><LI>i440FX host PCI bridge and PIIX3 PCI to ISA bridge<LI>Cirrus CLGD 5446 PCI VGA card or dummy VGA card with Bochs VESAextensions (hardware level, including all non standard modes).<LI>PS/2 mouse and keyboard<LI>2 PCI IDE interfaces with hard disk and CD-ROM support<LI>Floppy disk<LI>NE2000 PCI network adapters<LI>Serial ports<LI>Creative SoundBlaster 16 sound card<LI>ENSONIQ AudioPCI ES1370 sound card<LI>Adlib(OPL2) - Yamaha YM3812 compatible chip<LI>PCI UHCI USB controller and a virtual USB hub.</UL><P>SMP is supported with up to 255 CPUs.<P>Note that adlib is only available when QEMU was configured with-enable-adlib<P>QEMU uses the PC BIOS from the Bochs project and the Plex86/Bochs LGPLVGA BIOS.<P>QEMU uses YM3812 emulation by Tatsuyuki Satoh.<H2><A NAME="SEC9" HREF="qemu-doc.html#TOC9">3.2 Quick Start</A></H2><P>Download and uncompress the linux image (<TT>`linux.img'</TT>) and type:<PRE>qemu linux.img</PRE><P>Linux should boot and give you a prompt.<H2><A NAME="SEC10" HREF="qemu-doc.html#TOC10">3.3 Invocation</A></H2><PRE>usage: qemu [options] [disk_image]</PRE><P><VAR>disk_image</VAR> is a raw hard disk image for IDE hard disk 0.<P>General options:<DL COMPACT><DT><SAMP>`-M machine'</SAMP><DD>Select the emulated machine (<CODE>-M ?</CODE> for list)<DT><SAMP>`-fda file'</SAMP><DD><DT><SAMP>`-fdb file'</SAMP><DD>Use <VAR>file</VAR> as floppy disk 0/1 image (see section <A HREF="qemu-doc.html#SEC15">3.6 Disk Images</A>). You canuse the host floppy by using <TT>`/dev/fd0'</TT> as filename.<DT><SAMP>`-hda file'</SAMP><DD><DT><SAMP>`-hdb file'</SAMP><DD><DT><SAMP>`-hdc file'</SAMP><DD><DT><SAMP>`-hdd file'</SAMP><DD>Use <VAR>file</VAR> as hard disk 0, 1, 2 or 3 image (see section <A HREF="qemu-doc.html#SEC15">3.6 Disk Images</A>).<DT><SAMP>`-cdrom file'</SAMP><DD>Use <VAR>file</VAR> as CD-ROM image (you cannot use <SAMP>`-hdc'</SAMP> and and<SAMP>`-cdrom'</SAMP> at the same time). You can use the host CD-ROM byusing <TT>`/dev/cdrom'</TT> as filename.<DT><SAMP>`-boot [a|c|d]'</SAMP><DD>Boot on floppy (a), hard disk (c) or CD-ROM (d). Hard disk boot isthe default.<DT><SAMP>`-snapshot'</SAMP><DD>Write to temporary files instead of disk image files. In this case,the raw disk image you use is not written back. You can however forcethe write back by pressing <KBD>C-a s</KBD> (see section <A HREF="qemu-doc.html#SEC15">3.6 Disk Images</A>). <DT><SAMP>`-m megs'</SAMP><DD>Set virtual RAM size to <VAR>megs</VAR> megabytes. Default is 128 MB.<DT><SAMP>`-smp n'</SAMP><DD>Simulate an SMP system with <VAR>n</VAR> CPUs. On the PC target, up to 255CPUs are supported.<DT><SAMP>`-nographic'</SAMP><DD>Normally, QEMU uses SDL to display the VGA output. With this option,you can totally disable graphical output so that QEMU is a simplecommand line application. The emulated serial port is redirected onthe console. Therefore, you can still use QEMU to debug a Linux kernelwith a serial console.<DT><SAMP>`-vnc d'</SAMP><DD>Normally, QEMU uses SDL to display the VGA output. With this option,you can have QEMU listen on VNC display d and redirect the VGA displayover the VNC session. It is very useful to enable the usb tablet devicewhen using this option (option <SAMP>`-usbdevice tablet'</SAMP>).<DT><SAMP>`-k language'</SAMP><DD>Use keyboard layout <VAR>language</VAR> (for example <CODE>fr</CODE> forFrench). This option is only needed where it is not easy to get raw PCkeycodes (e.g. on Macs or with some X11 servers). You don't need touse it on PC/Linux or PC/Windows hosts.The available layouts are:<PRE>ar de-ch es fo fr-ca hu ja mk no pt-br svda en-gb et fr fr-ch is lt nl pl ru thde en-us fi fr-be hr it lv nl-be pt sl tr</PRE>The default is <CODE>en-us</CODE>.<DT><SAMP>`-audio-help'</SAMP><DD>Will show the audio subsystem help: list of drivers, tunableparameters.<DT><SAMP>`-soundhw card1,card2,... or -soundhw all'</SAMP><DD>Enable audio and selected sound hardware. Use ? to print allavailable sound hardware.<PRE>qemu -soundhw sb16,adlib hdaqemu -soundhw es1370 hdaqemu -soundhw all hdaqemu -soundhw ?</PRE><DT><SAMP>`-localtime'</SAMP><DD>Set the real time clock to local time (the default is to UTCtime). This option is needed to have correct date in MS-DOS orWindows.<DT><SAMP>`-full-screen'</SAMP><DD>Start in full screen.<DT><SAMP>`-pidfile file'</SAMP><DD>Store the QEMU process PID in <VAR>file</VAR>. It is useful if you launch QEMUfrom a script.<DT><SAMP>`-win2k-hack'</SAMP><DD>Use it when installing Windows 2000 to avoid a disk full bug. AfterWindows 2000 is installed, you no longer need this option (this optionslows down the IDE transfers).</DL><P>USB options:<DL COMPACT><DT><SAMP>`-usb'</SAMP><DD>Enable the USB driver (will be the default soon)<DT><SAMP>`-usbdevice devname'</SAMP><DD>Add the USB device <VAR>devname</VAR>. See the monitor command<CODE>usb_add</CODE> to have more information.</DL><P>Network options:<DL COMPACT><DT><SAMP>`-net nic[,vlan=n][,macaddr=addr][,model=type]'</SAMP><DD>Create a new Network Interface Card and connect it to VLAN <VAR>n</VAR> (<VAR>n</VAR>= 0 is the default). The NIC is currently an NE2000 on the PCtarget. Optionally, the MAC address can be changed. If no<SAMP>`-net'</SAMP> option is specified, a single NIC is created.Qemu can emulate several different models of network card. Valid values for<VAR>type</VAR> are <CODE>ne2k_pci</CODE>, <CODE>ne2k_isa</CODE>, <CODE>rtl8139</CODE>,<CODE>smc91c111</CODE> and <CODE>lance</CODE>. Not all devices are supported on alltargets.<DT><SAMP>`-net user[,vlan=n][,hostname=name]'</SAMP><DD>Use the user mode network stack which requires no administratorpriviledge to run. <SAMP>`hostname=name'</SAMP> can be used to specify the clienthostname reported by the builtin DHCP server.<DT><SAMP>`-net tap[,vlan=n][,fd=h][,ifname=name][,script=file]'</SAMP><DD>Connect the host TAP network interface <VAR>name</VAR> to VLAN <VAR>n</VAR> anduse the network script <VAR>file</VAR> to configure it. The defaultnetwork script is <TT>`/etc/qemu-ifup'</TT>. If <VAR>name</VAR> is notprovided, the OS automatically provides one. <SAMP>`fd=h'</SAMP> can beused to specify the handle of an already opened host TAP interface. Example:<PRE>qemu linux.img -net nic -net tap</PRE>More complicated example (two NICs, each one connected to a TAP device)<PRE>qemu linux.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -