Commit 7c3fc84d86764fddd8dbc5408409eb5b2b4dc96e
1 parent
d7ce296f
update
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1276 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
179 additions
and
177 deletions
LICENSE
0 → 100644
1 | +The following points clarify the QEMU licenses: | |
2 | + | |
3 | +1) The QEMU virtual CPU core library (libqemu.a) and the QEMU PC | |
4 | + system emulator are released under the GNU Lesser General Public | |
5 | + License. | |
6 | + | |
7 | +2) The Linux user mode QEMU emulator is released under the GNU General | |
8 | + Public License. | |
9 | + | |
10 | +3) The QEMU Accelerator Module is a proprietary product. It is | |
11 | + available without charge. Commercial use of the QEMU Accelerator | |
12 | + Module is allowed. | |
13 | + | |
14 | + Redistribution of the QEMU Accelerator Module: any person or | |
15 | + organisation wishing to distribute it, for example on a CD or as a | |
16 | + binary or source package, must have an explicit authorization from | |
17 | + the author. | |
18 | + | |
19 | + The QEMU Accelerator Module is available without any express or | |
20 | + implied warranty. In no event will the author be held liable for | |
21 | + any damages arising from the use of this software. | |
22 | + | |
23 | +4) QEMU is a trademark of Fabrice Bellard. | |
24 | + | |
25 | + | |
26 | +Fabrice Bellard. | |
0 | 27 | \ No newline at end of file | ... | ... |
README
1 | -The QEMU x86 emulator | |
2 | ---------------------- | |
3 | - | |
4 | -INSTALLATION | |
5 | ------------- | |
6 | - | |
7 | -Type | |
8 | - | |
9 | - ./configure | |
10 | - make | |
11 | - | |
12 | -to build qemu, qemu-CPU and libqemu.a (CPU is the name of the various | |
13 | -supported target CPUs). | |
14 | - | |
15 | -Type | |
16 | - | |
17 | - make install | |
18 | - | |
19 | -to install QEMU in /usr/local | |
20 | - | |
21 | -Tested tool versions | |
22 | --------------------- | |
23 | - | |
24 | -In order to compile QEMU succesfully, it is very important that you | |
25 | -have the right tools. The most important one is gcc. I cannot guaranty | |
26 | -that QEMU works if you do not use a tested gcc version. Look at | |
27 | -'configure' and 'Makefile' if you want to make a different gcc | |
28 | -version work. | |
29 | - | |
30 | -host gcc binutils glibc linux distribution | |
31 | ----------------------------------------------------------------------- | |
32 | -x86 2.95.2 2.13.2 2.1.3 2.4.18 | |
33 | - 3.2 2.13.2 2.1.3 2.4.18 | |
34 | - 2.96 2.11.93.0.2 2.2.5 2.4.18 Red Hat 7.3 | |
35 | - 3.2.2 2.13.90.0.18 2.3.2 2.4.20 Red Hat 9 | |
36 | - | |
37 | -PowerPC 3.3 [4] 2.13.90.0.18 2.3.1 2.4.20briq | |
38 | - 3.2 | |
39 | - | |
40 | -Alpha 3.3 [1] 2.14.90.0.4 2.2.5 2.2.20 [2] Debian 3.0 | |
41 | - | |
42 | -Sparc32 2.95.4 2.12.90.0.1 2.2.5 2.4.18 Debian 3.0 | |
43 | - | |
44 | -ARM 2.95.4 2.12.90.0.1 2.2.5 2.4.9 [3] Debian 3.0 | |
45 | - | |
46 | -[1] On Alpha, QEMU needs the gcc 'visibility' attribute only available | |
47 | - for gcc version >= 3.3. | |
48 | -[2] Linux >= 2.4.20 is necessary for precise exception support | |
49 | - (untested). | |
50 | -[3] 2.4.9-ac10-rmk2-np1-cerf2 | |
51 | - | |
52 | -[4] gcc 2.95.x generates invalid code when using too many register | |
53 | -variables. You must use gcc 3.x on PowerPC. | |
54 | - | |
55 | -Documentation | |
56 | -------------- | |
57 | - | |
58 | 1 | Read the documentation in qemu-doc.html. |
59 | 2 | |
60 | - | |
61 | 3 | Fabrice Bellard. |
62 | 4 | \ No newline at end of file | ... | ... |
qemu-doc.texi
... | ... | @@ -34,8 +34,12 @@ to ease cross-compilation and cross-debugging. |
34 | 34 | |
35 | 35 | @end itemize |
36 | 36 | |
37 | -As QEMU requires no host kernel driver to run, it is very safe and | |
38 | -easy to use. | |
37 | +QEMU can run without an host kernel driver and yet gives acceptable | |
38 | +performance. On an x86 host, if you want the highest performance for | |
39 | +the x86 target, the @emph{QEMU Accelerator Module} (KQEMU) allows QEMU | |
40 | +to reach near native performances. KQEMU is currently only supported | |
41 | +for an x86 Linux 2.4 or 2.6 host system, but more host OSes will be | |
42 | +supported in the future. | |
39 | 43 | |
40 | 44 | For system emulation, the following hardware targets are supported: |
41 | 45 | @itemize |
... | ... | @@ -52,14 +56,8 @@ If you want to compile QEMU yourself, see @ref{compilation}. |
52 | 56 | |
53 | 57 | @section Linux |
54 | 58 | |
55 | -Download the binary distribution (@file{qemu-XXX-i386.tar.gz}) in | |
56 | -@file{/tmp} and untar it as root from @file{/}: | |
57 | - | |
58 | -@example | |
59 | -su | |
60 | -cd / | |
61 | -tar zxvf /tmp/qemu-XXX-i386.tar.gz | |
62 | -@end example | |
59 | +If a precompiled package is available for your distribution - you just | |
60 | +have to install it. Otherwise, see @ref{compilation}. | |
63 | 61 | |
64 | 62 | @section Windows |
65 | 63 | |
... | ... | @@ -77,33 +75,8 @@ Download the experimental binary installer at |
77 | 75 | |
78 | 76 | @c man begin DESCRIPTION |
79 | 77 | |
80 | -The QEMU System emulator simulates a complete PC. | |
81 | - | |
82 | -In order to meet specific user needs, two versions of QEMU are | |
83 | -available: | |
84 | - | |
85 | -@enumerate | |
86 | - | |
87 | -@item | |
88 | -@code{qemu-fast} uses the host Memory Management Unit (MMU) to | |
89 | -simulate the x86 MMU. It is @emph{fast} but has limitations because | |
90 | -the whole 4 GB address space cannot be used and some memory mapped | |
91 | -peripherials cannot be emulated accurately yet. Therefore, a specific | |
92 | -guest Linux kernel can be used (@xref{linux_compile}) as guest | |
93 | -OS. | |
94 | - | |
95 | -Moreover there is no separation between the host and target address | |
96 | -spaces, so it offers no security (the target OS can modify the | |
97 | -@code{qemu-fast} code by writing at the right addresses). | |
98 | - | |
99 | -@item | |
100 | -@code{qemu} uses a software MMU. It is about @emph{two times slower} | |
101 | -but gives a more accurate emulation and a complete separation between | |
102 | -the host and target address spaces. | |
103 | - | |
104 | -@end enumerate | |
105 | - | |
106 | -QEMU emulates the following PC peripherials: | |
78 | +The QEMU System emulator simulates the | |
79 | +following PC peripherials: | |
107 | 80 | |
108 | 81 | @itemize @minus |
109 | 82 | @item |
... | ... | @@ -369,6 +342,12 @@ Force hard disk 0 physical geometry (1 <= @var{c} <= 16383, 1 <= |
369 | 342 | translation mode (@var{t}=none, lba or auto). Usually QEMU can guess |
370 | 343 | all thoses parameters. This option is useful for old MS-DOS disk |
371 | 344 | images. |
345 | + | |
346 | +@item -no-kqemu | |
347 | +Disable the usage of the QEMU Accelerator module (KQEMU). QEMU will work as | |
348 | +usual but will be slower. This option can be useful to determine if | |
349 | +emulation problems are coming from KQEMU. | |
350 | + | |
372 | 351 | @item -isa |
373 | 352 | Simulate an ISA-only system (default is PCI system). |
374 | 353 | @item -std-vga |
... | ... | @@ -444,6 +423,25 @@ Fabrice Bellard |
444 | 423 | |
445 | 424 | @end ignore |
446 | 425 | |
426 | +@section QEMU Accelerator Module | |
427 | + | |
428 | +The QEMU Accelerator Module (KQEMU) is an optional part of QEMU currently only | |
429 | +available for Linux 2.4 or 2.6 x86 hosts. It enables QEMU to run x86 | |
430 | +code much faster. Provided it is installed on your PC (see | |
431 | +@ref{kqemu_install}), QEMU will automatically use it. | |
432 | + | |
433 | +WARNING: as with any alpha stage kernel driver, KQEMU may cause | |
434 | +arbitrary data loss on your PC, so you'd better backup your sensitive | |
435 | +data before using it. | |
436 | + | |
437 | +When using KQEMU, QEMU will create a big hidden file containing the | |
438 | +RAM of the virtual machine. For best performance, it is important that | |
439 | +this file is kept in RAM and not on the hard disk. QEMU uses the | |
440 | +@file{/dev/shm} directory to create this file because @code{tmpfs} is | |
441 | +usually mounted on it (check with the shell command | |
442 | +@code{df}). Otherwise @file{/tmp} is used as fallback. You can use the | |
443 | +@var{QEMU_TMPDIR} shell variable to set a new directory for the QEMU | |
444 | +RAM file. | |
447 | 445 | |
448 | 446 | @section QEMU Monitor |
449 | 447 | |
... | ... | @@ -825,12 +823,6 @@ A 2.5.74 kernel is also included in the archive. Just |
825 | 823 | replace the bzImage in qemu.sh to try it. |
826 | 824 | |
827 | 825 | @item |
828 | -qemu-fast creates a temporary file in @var{$QEMU_TMPDIR} (@file{/tmp} is the | |
829 | -default) containing all the simulated PC memory. If possible, try to use | |
830 | -a temporary directory using the tmpfs filesystem to avoid too many | |
831 | -unnecessary disk accesses. | |
832 | - | |
833 | -@item | |
834 | 826 | In order to exit cleanly from qemu, you can do a @emph{shutdown} inside |
835 | 827 | qemu. qemu will automatically exit when the Linux shutdown is done. |
836 | 828 | |
... | ... | @@ -848,80 +840,6 @@ Lawton for the plex86 Project (@url{www.plex86.org}). |
848 | 840 | |
849 | 841 | @end enumerate |
850 | 842 | |
851 | -@node linux_compile | |
852 | -@section Linux Kernel Compilation | |
853 | - | |
854 | -You can use any linux kernel with QEMU. However, if you want to use | |
855 | -@code{qemu-fast} to get maximum performances, you must use a modified | |
856 | -guest kernel. If you are using a 2.6 guest kernel, you can use | |
857 | -directly the patch @file{linux-2.6-qemu-fast.patch} made by Rusty | |
858 | -Russel available in the QEMU source archive. Otherwise, you can make the | |
859 | -following changes @emph{by hand} to the Linux kernel: | |
860 | - | |
861 | -@enumerate | |
862 | -@item | |
863 | -The kernel must be mapped at 0x90000000 (the default is | |
864 | -0xc0000000). You must modify only two lines in the kernel source: | |
865 | - | |
866 | -In @file{include/asm/page.h}, replace | |
867 | -@example | |
868 | -#define __PAGE_OFFSET (0xc0000000) | |
869 | -@end example | |
870 | -by | |
871 | -@example | |
872 | -#define __PAGE_OFFSET (0x90000000) | |
873 | -@end example | |
874 | - | |
875 | -And in @file{arch/i386/vmlinux.lds}, replace | |
876 | -@example | |
877 | - . = 0xc0000000 + 0x100000; | |
878 | -@end example | |
879 | -by | |
880 | -@example | |
881 | - . = 0x90000000 + 0x100000; | |
882 | -@end example | |
883 | - | |
884 | -@item | |
885 | -If you want to enable SMP (Symmetric Multi-Processing) support, you | |
886 | -must make the following change in @file{include/asm/fixmap.h}. Replace | |
887 | -@example | |
888 | -#define FIXADDR_TOP (0xffffX000UL) | |
889 | -@end example | |
890 | -by | |
891 | -@example | |
892 | -#define FIXADDR_TOP (0xa7ffX000UL) | |
893 | -@end example | |
894 | -(X is 'e' or 'f' depending on the kernel version). Although you can | |
895 | -use an SMP kernel with QEMU, it only supports one CPU. | |
896 | - | |
897 | -@item | |
898 | -If you are not using a 2.6 kernel as host kernel but if you use a target | |
899 | -2.6 kernel, you must also ensure that the 'HZ' define is set to 100 | |
900 | -(1000 is the default) as QEMU cannot currently emulate timers at | |
901 | -frequencies greater than 100 Hz on host Linux systems < 2.6. In | |
902 | -@file{include/asm/param.h}, replace: | |
903 | - | |
904 | -@example | |
905 | -# define HZ 1000 /* Internal kernel timer frequency */ | |
906 | -@end example | |
907 | -by | |
908 | -@example | |
909 | -# define HZ 100 /* Internal kernel timer frequency */ | |
910 | -@end example | |
911 | - | |
912 | -@end enumerate | |
913 | - | |
914 | -The file config-2.x.x gives the configuration of the example kernels. | |
915 | - | |
916 | -Just type | |
917 | -@example | |
918 | -make bzImage | |
919 | -@end example | |
920 | - | |
921 | -As you would do to make a real kernel. Then you can use with QEMU | |
922 | -exactly the same kernel as you would boot on your PC (in | |
923 | -@file{arch/i386/boot/bzImage}). | |
924 | - | |
925 | 843 | @node gdb_usage |
926 | 844 | @section GDB usage |
927 | 845 | |
... | ... | @@ -976,6 +894,12 @@ When using a 2.6 guest Linux kernel, you should add the option |
976 | 894 | kernels make very strict real time clock checks by default that QEMU |
977 | 895 | cannot simulate exactly. |
978 | 896 | |
897 | +When using a 2.6 guest Linux kernel, verify that the 4G/4G patch is | |
898 | +not activated because QEMU is slower with this patch. The QEMU | |
899 | +Accelerator Module is also much slower in this case. Earlier Fedora | |
900 | +Core 3 Linux kernel (< 2.6.9-1.724_FC3) were known to incorporte this | |
901 | +patch by default. Newer kernels don't have it. | |
902 | + | |
979 | 903 | @subsection Windows |
980 | 904 | |
981 | 905 | If you have a slow host, using Windows 95 is better as it gives the |
... | ... | @@ -1226,9 +1150,119 @@ Act as if the host page size was 'pagesize' bytes |
1226 | 1150 | @node compilation |
1227 | 1151 | @chapter Compilation from the sources |
1228 | 1152 | |
1229 | -@section Linux/BSD | |
1153 | +@section Linux/Unix | |
1154 | + | |
1155 | +@subsection Compilation | |
1156 | + | |
1157 | +First you must decompress the sources: | |
1158 | +@example | |
1159 | +cd /tmp | |
1160 | +tar zxvf qemu-x.y.z.tar.gz | |
1161 | +cd qemu-x.y.z | |
1162 | +@end example | |
1163 | + | |
1164 | +Then you configure QEMU and build it (usually no options are needed): | |
1165 | +@example | |
1166 | +./configure | |
1167 | +make | |
1168 | +@end example | |
1169 | + | |
1170 | +Then type as root user: | |
1171 | +@example | |
1172 | +make install | |
1173 | +@end example | |
1174 | +to install QEMU in @file{/usr/local}. | |
1175 | + | |
1176 | +@node kqemu_install | |
1177 | +@subsection QEMU Accelerator Installation | |
1178 | + | |
1179 | +If you use x86 Linux, the compilation of the QEMU Accelerator Kernel | |
1180 | +Module (KQEMU) is automatically activated provided you have the | |
1181 | +necessary kernel headers. If nonetheless the compilation fails, you | |
1182 | +can disable its compilation with the @option{--disable-kqemu} option. | |
1183 | + | |
1184 | +If you are using a 2.6 host kernel, then all the necessary kernel | |
1185 | +headers should be already installed. If you are using a 2.4 kernel, | |
1186 | +then you should verify that properly configured kernel sources are | |
1187 | +installed and compiled. On a Redhat 9 distribution for example, the | |
1188 | +following must be done: | |
1189 | +@example | |
1190 | +1) Install the kernel-source-xxx package | |
1191 | +2) cd /usr/src/linux-xxx | |
1192 | +3) make distclean | |
1193 | +4) Copy /boot/config-vvv in .config (use uname -r to know your configuration name 'vvv') | |
1194 | +5) Edit the Makefile to change the EXTRAVERSION line to match your | |
1195 | + current configuration name: | |
1196 | + EXTRAVERSION = -custom | |
1197 | +to | |
1198 | + EXTRAVERSION = -8 # This is an example, it can be -8smp too | |
1199 | +5) make menuconfig # Just save the configuration | |
1200 | +6) make dep bzImage | |
1201 | +@end example | |
1230 | 1202 | |
1231 | -Read the @file{README} which gives the related information. | |
1203 | +The installation of KQEMU is not fully automatic because it is highly | |
1204 | +distribution dependent. When launching | |
1205 | +@example | |
1206 | +make install | |
1207 | +@end example | |
1208 | + | |
1209 | +KQEMU is installed in /lib/modules/@var{kernel_version}/misc. The | |
1210 | +device @file{/dev/kqemu} is created with read/write access rights for | |
1211 | +everyone. If you fear security issues, you can restrict the access | |
1212 | +rights of @file{/dev/kqemu}. | |
1213 | + | |
1214 | +If you want that KQEMU is installed automatically at boot time, you can add | |
1215 | + | |
1216 | +@example | |
1217 | +# Load the KQEMU kernel module | |
1218 | +/sbin/modprobe kqemu | |
1219 | +@end example | |
1220 | + | |
1221 | +in @file{/etc/rc.d/rc.local}. | |
1222 | + | |
1223 | +If your distribution uses udev (like Fedora), the @file{/dev/kqemu} is | |
1224 | +not created automatically (yet) at every reboot. You can add the | |
1225 | +following in @file{/etc/rc.d/rc.local}: | |
1226 | + | |
1227 | +@example | |
1228 | +# Create the KQEMU device | |
1229 | +mknod /dev/kqemu c 254 0 | |
1230 | +chmod 666 /dev/kqemu | |
1231 | +@end example | |
1232 | + | |
1233 | +@subsection Tested tool versions | |
1234 | + | |
1235 | +In order to compile QEMU succesfully, it is very important that you | |
1236 | +have the right tools. The most important one is gcc. I cannot guaranty | |
1237 | +that QEMU works if you do not use a tested gcc version. Look at | |
1238 | +'configure' and 'Makefile' if you want to make a different gcc | |
1239 | +version work. | |
1240 | + | |
1241 | +@example | |
1242 | +host gcc binutils glibc linux distribution | |
1243 | +---------------------------------------------------------------------- | |
1244 | +x86 3.2 2.13.2 2.1.3 2.4.18 | |
1245 | + 2.96 2.11.93.0.2 2.2.5 2.4.18 Red Hat 7.3 | |
1246 | + 3.2.2 2.13.90.0.18 2.3.2 2.4.20 Red Hat 9 | |
1247 | + | |
1248 | +PowerPC 3.3 [4] 2.13.90.0.18 2.3.1 2.4.20briq | |
1249 | + 3.2 | |
1250 | + | |
1251 | +Alpha 3.3 [1] 2.14.90.0.4 2.2.5 2.2.20 [2] Debian 3.0 | |
1252 | + | |
1253 | +Sparc32 2.95.4 2.12.90.0.1 2.2.5 2.4.18 Debian 3.0 | |
1254 | + | |
1255 | +ARM 2.95.4 2.12.90.0.1 2.2.5 2.4.9 [3] Debian 3.0 | |
1256 | + | |
1257 | +[1] On Alpha, QEMU needs the gcc 'visibility' attribute only available | |
1258 | + for gcc version >= 3.3. | |
1259 | +[2] Linux >= 2.4.20 is necessary for precise exception support | |
1260 | + (untested). | |
1261 | +[3] 2.4.9-ac10-rmk2-np1-cerf2 | |
1262 | + | |
1263 | +[4] gcc 2.95.x generates invalid code when using too many register | |
1264 | +variables. You must use gcc 3.x on PowerPC. | |
1265 | +@end example | |
1232 | 1266 | |
1233 | 1267 | @section Windows |
1234 | 1268 | ... | ... |