275511ab5237f2c28d2e1b63e1401b20a9c50abc
[qemu] / kqemu / kqemu-doc.html
1 <HTML>
2 <HEAD>
3 <!-- Created by texi2html 1.56k from kqemu-doc.texi on 24 July 2005 -->
4
5 <TITLE>QEMU Accelerator User Documentation</TITLE>
6 </HEAD>
7 <BODY>
8 <H1>QEMU Accelerator User Documentation</H1>
9 <P>
10 <P><HR><P>
11 <H1>Table of Contents</H1>
12 <UL>
13 <LI><A NAME="TOC1" HREF="kqemu-doc.html#SEC1">1. Introduction</A>
14 <LI><A NAME="TOC2" HREF="kqemu-doc.html#SEC2">2. Installation</A>
15 <UL>
16 <LI><A NAME="TOC3" HREF="kqemu-doc.html#SEC3">2.1 QEMU Compilation</A>
17 <LI><A NAME="TOC4" HREF="kqemu-doc.html#SEC4">2.2 QEMU Accelerator Installation for Linux</A>
18 <LI><A NAME="TOC5" HREF="kqemu-doc.html#SEC5">2.3 QEMU Accelerator Installation for Windows</A>
19 </UL>
20 <LI><A NAME="TOC6" HREF="kqemu-doc.html#SEC6">3. Usage</A>
21 </UL>
22 <P><HR><P>
23
24 <P>
25 QEMU Accelerator User Documentation
26
27
28
29
30 <H1><A NAME="SEC1" HREF="kqemu-doc.html#TOC1">1. Introduction</A></H1>
31
32 <P>
33 QEMU Accelerator (KQEMU) is a driver allowing the QEMU PC emulator to
34 run much faster when emulating a PC on an x86 host. 
35
36
37 <P>
38 KQEMU is supported on x86 or x86_64 Linux 2.4 or 2.6
39 hosts. Experimental versions are available for FreeBSD and Windows
40 NT/2000/2003/XP.
41
42
43
44
45 <H1><A NAME="SEC2" HREF="kqemu-doc.html#TOC2">2. Installation</A></H1>
46
47
48
49 <H2><A NAME="SEC3" HREF="kqemu-doc.html#TOC3">2.1 QEMU Compilation</A></H2>
50
51 <P>
52 First you must decompress the QEMU sources:
53
54 <PRE>
55 cd /tmp
56 tar zxvf qemu-x.y.z.tar.gz
57 cd qemu-x.y.z
58 </PRE>
59
60 <P>
61 Download and install the QEMU Accelerator Module in
62 qemu-x.y.z/:
63
64 <PRE>
65 tar zxvf /tmp/kqemu-x.y.z.tar.gz
66 </PRE>
67
68 <P>
69 Then you configure QEMU and build it (usually no options are needed):
70
71 <PRE>
72 ./configure
73 make
74 </PRE>
75
76 <P>
77 Then type as root user:
78
79 <PRE>
80 make install
81 </PRE>
82
83 <P>
84 to install QEMU in <TT>`/usr/local'</TT>.
85
86
87
88
89 <H2><A NAME="SEC4" HREF="kqemu-doc.html#TOC4">2.2 QEMU Accelerator Installation for Linux</A></H2>
90
91 <P>
92 If you use x86 Linux, the compilation of the QEMU Accelerator Kernel
93 Module (KQEMU) is automatically activated provided you have the
94 necessary kernel headers. If nonetheless the compilation fails, you
95 can disable its compilation with the <SAMP>`--disable-kqemu'</SAMP>
96 configure option.
97
98
99 <P>
100 If you are using a 2.6 host kernel, then all the necessary kernel
101 headers should be already installed. If you are using a 2.4 kernel,
102 then you should verify that properly configured kernel sources are
103 installed and compiled. On a Redhat 9 distribution for example, the
104 following must be done:
105
106 <PRE>
107 1) Install the kernel-source-xxx package
108 2) cd /usr/src/linux-xxx
109 3) make distclean
110 4) Copy /boot/config-vvv in .config (use uname -r to know your configuration name 'vvv')
111 5) Edit the Makefile to change the EXTRAVERSION line to match your
112    current configuration name:
113    EXTRAVERSION = -custom
114 to 
115    EXTRAVERSION = -8 # This is an example, it can be -8smp too
116 5) make menuconfig # Just save the configuration
117 6) make dep bzImage
118 </PRE>
119
120 <P>
121 The installation of KQEMU is not fully automatic because it is highly
122 distribution dependent. When launching 
123
124 <PRE>
125 make install
126 </PRE>
127
128 <P>
129 KQEMU is installed in /lib/modules/<VAR>kernel_version</VAR>/misc. The
130 device <TT>`/dev/kqemu'</TT> is created with read/write access rights for
131 everyone. If you fear security issues, you can restrict the access
132 rights of <TT>`/dev/kqemu'</TT>.
133
134
135 <P>
136 If you want that KQEMU is installed automatically at boot time, you can add
137
138
139
140 <PRE>
141 # Load the KQEMU kernel module
142 /sbin/modprobe kqemu
143 </PRE>
144
145 <P>
146 in <TT>`/etc/rc.d/rc.local'</TT>.
147
148
149 <P>
150 If your distribution uses udev (like Fedora), use the kqemu module
151 option <CODE>major=0</CODE> to have the device <TT>`/dev/kqemu'</TT> automatically
152 created:
153
154
155
156 <PRE>
157 # Load the KQEMU kernel module
158 /sbin/modprobe kqemu major=0
159 </PRE>
160
161 <P>
162 It is usually necessary to change the device access rights by doing as
163 root: <CODE>chmod 666 /dev/kqemu</CODE>.
164
165
166 <P>
167 If the major number 250 is already used by another driver, you can use
168 the option <CODE>major=N</CODE> to set an alternate major number.
169
170
171
172
173 <H2><A NAME="SEC5" HREF="kqemu-doc.html#TOC5">2.3 QEMU Accelerator Installation for Windows</A></H2>
174
175 <P>
176 Copy the kqemu driver <TT>`kqemu.sys'</TT> to
177 <TT>`c:\winnt\system32\drivers'</TT>.  Then do:
178
179 <PRE>
180 regedit kqemu.reg 
181 </PRE>
182
183 <P>
184 Now kqemu is installed and you must restart your system.
185
186
187 <P>
188 In order to start kqemu, you must do:
189
190 <PRE>
191 net start kqemu
192 </PRE>
193
194
195
196 <H1><A NAME="SEC6" HREF="kqemu-doc.html#TOC6">3. Usage</A></H1>
197
198 <P>
199 When QEMU is compiled with KQEMU support, the following option is
200 added to QEMU:
201
202
203 <DL COMPACT>
204
205 <DT><SAMP>`-no-kqemu'</SAMP>
206 <DD>
207 Disable the usage of the QEMU Accelerator module (KQEMU). QEMU will work as
208 usual but will be slower. This option can be useful to determine if
209 emulation problems are coming from KQEMU.
210 </DL>
211
212 <P>
213 When using KQEMU, QEMU will create a big hidden file containing the
214 RAM of the virtual machine. For best performance, it is important that
215 this file is kept in RAM and not on the hard disk. QEMU uses the
216 <TT>`/dev/shm'</TT> directory to create this file because <CODE>tmpfs</CODE> is
217 usually mounted on it (check with the shell command
218 <CODE>df</CODE>). Otherwise <TT>`/tmp'</TT> is used as fallback. You can use the
219 <VAR>QEMU_TMPDIR</VAR> shell variable to set a new directory for the QEMU
220 RAM file.
221
222
223 <P>
224 KQEMU has only been tested with Linux 2.4, Linux 2.6 and Windows 2000
225 as guest OSes. If your guest OS do not work with KQEMU, you can
226 dynamically disable KQEMU with the <SAMP>`-no-kqemu'</SAMP> option.
227
228
229 <P>
230 If you use kqemu on an x86_64 host, you must use
231 <TT>`qemu-system-x86_64'</TT> instead of <TT>`qemu'</TT>.
232
233
234 <P>
235 To see if kqemu is enabled and working correctly, use the QEMU monitor
236 command:
237
238 <PRE>
239 info kqemu
240 </PRE>
241
242 <P><HR><P>
243 This document was generated on 24 July 2005 using
244 <A HREF="http://wwwinfo.cern.ch/dis/texi2html/">texi2html</A>&nbsp;1.56k.
245 </BODY>
246 </HTML>