/[gxemul]/trunk/man/gxemul.1
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/man/gxemul.1

Parent Directory Parent Directory | Revision Log Revision Log


Revision 18 - (show annotations)
Mon Oct 8 16:19:11 2007 UTC (16 years, 6 months ago) by dpavlin
File size: 13403 byte(s)
++ trunk/HISTORY	(local)
$Id: HISTORY,v 1.1004 2005/10/27 14:01:10 debug Exp $
20051011        Passing -A as the default boot arg for CATS (works fine with
                OpenBSD/cats).
20051012	Fixing the VGA cursor offset bug, and speeding up framebuffer
		redraws if character cells contain the same thing as during
		the last redraw.
20051013	Adding a slow strd ARM instruction hack.
20051017	Minor updates: Adding a dummy i80321 Verde controller (for
		XScale emulation), fixing the disassembly of the ARM "ldrd"
		instruction, adding "support" for less-than-4KB pages for ARM
		(by not adding them to translation tables).
20051020	Continuing on some HPCarm stuff. A NetBSD/hpcarm kernel prints
		some boot messages on an emulated Jornada 720.
		Making dev_ram work better with dyntrans (speeds up some things
		quite a bit).
20051021	Automatically generating some of the most common ARM load/store
		multiple instructions.
20051022	Better statistics gathering for the ARM load/store multiple.
		Various other dyntrans and device updates.
20051023	Various minor updates.
20051024	Continuing; minor device and dyntrans fine-tuning. Adding the
		first "reasonable" instruction combination hacks for ARM (the
		cores of NetBSD/cats' memset and memcpy).
20051025	Fixing a dyntrans-related bug in dev_vga. Also changing the
		dyntrans low/high access notification to only be updated on
		writes, not reads. Hopefully it will be enough. (dev_vga in
		charcell mode now seems to work correctly with both reads and
		writes.)
		Experimenting with gathering dyntrans statistics (which parts
		of emulated RAM that are actually executed), and adding
		instruction combination hacks for cache cleaning and a part of
		NetBSD's scanc() function.
20051026	Adding a bitmap for ARM emulation which indicates if a page is
		(specifically) user accessible; loads and stores with the t-
		flag set can now use the translation arrays, which results in
		a measurable speedup.
20051027	Dyntrans updates; adding an extra bitmap array for 32-bit
		emulation modes, speeding up the check whether a physical page
		has any code translations or not (O(n) -> O(1)). Doing a
		similar reduction of O(n) to O(1) by avoiding the scan through
		the translation entries on a translation update (32-bit mode
		only).
		Various other minor hacks.
20051029	Quick release, without any testing at all.

==============  RELEASE 0.3.6.2  ==============


1 .\" $Id: gxemul.1,v 1.35 2005/10/27 14:01:11 debug Exp $
2 .\"
3 .\" Copyright (C) 2004-2005 Anders Gavare. All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions are met:
7 .\"
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. The name of the author may not be used to endorse or promote products
14 .\" derived from this software without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"
29 .\" This is a minimal man page for GXemul. Process this file with
30 .\" groff -man -Tascii gxemul.1 or nroff -man gxemul.1
31 .\"
32 .Dd OCTOBER 2005
33 .Dt GXEMUL 1
34 .Os
35 .Sh NAME
36 .Nm gxemul
37 .Nd an experimental machine emulator
38 .Sh SYNOPSIS
39 .Nm
40 .Op machine, other, and general options
41 .Op file Ar ...
42 .Nm
43 .Op general options
44 .Ar @configfile
45 .Nm
46 .Op userland, other, and general options
47 .Ar file Op Ar args ...
48 .Sh DESCRIPTION
49 .Nm
50 is an experimental instruction-level machine emulator. Several
51 emulation modes are available. In some modes, processors and surrounding
52 hardware components are emulated well enough to let unmodified operating
53 systems (e.g. NetBSD) run as if they were running on a real machine.
54 .Pp
55 The processor architecture best emulated by GXemul is MIPS, but other
56 architectures are also partially emulated.
57 .Pp
58 MIPS processors are emulated either using a simple type of binary
59 translator (on Alpha and i386 hosts), or using traditional slow
60 interpretation (all other hosts, including amd64 machines running in
61 64-bit mode).
62 .Pp
63 Non-MIPS processors (e.g. ARM) are emulated using a newer dynamic
64 translation system (called dyntrans in the rest of this man page);
65 dyntrans does not require any host-specific code, so it should work on any
66 platform. Performance is somewhere between binary translation and
67 traditional interpretation.
68 .Pp
69 There are three ways to invoke the emulator:
70 .Pp
71 1. When emulating a complete machine, configuration options can be entered
72 directly on the command line.
73 .Pp
74 2. Options can be read from a configuration file.
75 .Pp
76 3. When emulating a userland environment (syscall-only emulation, not
77 emulating complete machines), then the program name and its argument
78 should be given on the command line. (This mode doesn't really work yet.)
79 .Pp
80 The easiest way to use the emulator is to supply settings directly on the
81 command line. The most important thing you need to supply is the
82 file argument. This is the name of a binary file (an ELF, a.out, COFF/ECOFF,
83 SREC, or a raw binary image) which you wish to run in the emulator. This file
84 might be an operating system kernel, or perhaps a ROM image file.
85 .Pp
86 If more than one filename is supplied, all files are loaded into memory,
87 and the entry point (if available) is taken from the last file.
88 .Pp
89 Apart from the name of a binary file, it is also necessary to select
90 which specific emulation mode to use. For example, a MIPS-based machine
91 from DEC (a DECstation) is very different from a MIPS-based machine
92 from SGI. Use
93 .Nm
94 .Fl H
95 to get a list of available emulation modes.
96 .Pp
97 There are two exceptions to the normal invocation usage mentioned above.
98 The first is for DECstation emulation: if you have a bootable
99 DECstation harddisk or CDROM image, then just supplying the diskimage via
100 the
101 .Fl d
102 option is sufficient. (The filename of the kernel can then be
103 skipped, as the emulator runs the bootblocks from the diskimage directly and
104 doesn't need the kernel as a separate file.)
105 The second is if you supply an ISO9660 CDROM disk image. You may then use
106 the
107 .Fl j
108 option to indicate which file on the CDROM filesystem that should be
109 loaded into emulated memory.
110 .Pp
111 Machine selection options:
112 .Bl -tag -width Ds
113 .It Fl E Ar t
114 Try to emulate machine type
115 .Ar "t".
116 This option is not always needed, if the
117 .Fl e
118 option uniquely selects a machine.
119 (Use
120 .Fl H
121 to get a list of types.)
122 .It Fl e Ar st
123 Try to emulate machine subtype
124 .Ar "st".
125 Use this together with
126 .Fl E .
127 (This option is not always needed, if a machine type has no subtypes.)
128 .El
129 .Pp
130 Other options:
131 .Bl -tag -width Ds
132 .It Fl A
133 Disable load/store alignment checks in some cases. This might give a small
134 increase in performance, but the emulator will not run correctly if the
135 emulated code actually tries to do unaligned loads or stores. (This option
136 is only meaningful when emulating MIPS CPUs, when the host architecture is
137 Alpha or i386, and binary translation is enabled.)
138 .It Fl B
139 Disable dynamic binary translation. By default, bintrans
140 will be turned on if the host+target architecture combination is
141 supported. Currently, the only supported target architecture for bintrans
142 is MIPS, and the supported host architectures are Alpha and i386.
143 .It Fl C Ar x
144 Try to emulate a specific CPU type,
145 .Ar "x".
146 This overrides the default CPU type for the machine being emulated.
147 (Use
148 .Fl H
149 to get a list of available CPU types.)
150 .It Fl d Ar name
151 Add
152 .Ar name
153 as a disk image. By adding one or more modifier characters and then a
154 colon (":") as a prefix to
155 .Ar "name",
156 you can modify the way the disk image is treated. Available modifiers are:
157 .Bl -tag -width Ds
158 .It b
159 Specifies that this is a boot device.
160 .It c
161 CD-ROM.
162 .It d
163 DISK (this is the default).
164 .It f
165 FLOPPY.
166 .It gH;S;
167 Override the default geometry; use H heads and S sectors-per-track.
168 (The number of cylinders is calculated automatically.)
169 .It i
170 IDE.
171 .It r
172 Read-only (don't allow changes to be written to the file).
173 .It s
174 SCSI (this is the default for most machine types).
175 .It t
176 Tape.
177 .It 0-7
178 Force a specific ID number.
179 .El
180 .Pp
181 Unless otherwise specified, filenames ending with ".iso" or ".cdr" are
182 assumed to be CDROM images. Most others are assumed to be disks. Depending
183 on which machine is being emulated, the default for disks can be either
184 SCSI or IDE. Some disk images that are very small are assumed to be floppy
185 disks. (If you are not happy with the way a disk image is detected, then
186 you need to use explicit prefixes to force a specific type.)
187 .Pp
188 For floppies, the gH;S; prefix is ignored. Instead, the number of
189 heads and cylinders are assumed to be 2 and 80, respectively, and the
190 number of sectors per track is calculated automatically. (This works for
191 720KB, 1.2MB, 1.44MB, and 2.88MB floppies.)
192 .It Fl I Ar x
193 Emulate clock interrupts at
194 .Ar x
195 Hz. (This affects emulated clock devices only, not actual runtime speed.
196 This disables automatic clock adjustments, which is otherwise turned on.)
197 (This option is probably only valid for DECstation emulation.)
198 .It Fl i
199 Display each instruction as it is being executed.
200 .It Fl J
201 Disable some speed tricks. For MIPS emulation, these are mostly
202 timing-related. For non-MIPS emulation (i.e. those modes using dyntrans),
203 this flag disables the use of "instruction combinations".
204 .It Fl j Ar n
205 Set the name of the kernel to
206 .Ar "n".
207 When booting from an ISO9660 filesystem, the emulator will try to boot
208 using this file. (In some emulation modes, eg. DECstation, this name is passed
209 along to the boot program. Useful names are "bsd" for OpenBSD/pmax,
210 or "vmunix" for Ultrix.)
211 .It Fl M Ar m
212 Emulate
213 .Ar m
214 MBs of physical RAM. This overrides the default amount of RAM for the
215 selected machine type.
216 .It Fl m Ar nr
217 Run at most
218 .Ar nr
219 instructions (on any cpu).
220 .It Fl N
221 Display nr of instructions/second average, at regular intervals.
222 .It Fl n Ar nr
223 Set nr of CPUs (for SMP experiments).
224 .It Fl O
225 Force a "netboot" (tftp instead of disk), even when a disk image is
226 present (for DECstation, SGI, and ARC emulation).
227 .It Fl o Ar arg
228 Set the boot argument (mostly useful for DEC, ARC, or SGI emulation).
229 Default
230 .Ar arg
231 for DEC is "-a", for ARC/SGI it is "-aN", and for CATS it is "-A".
232 .It Fl p Ar pc
233 Add a breakpoint. (Remember to use the "0x" prefix for hex.)
234 .It Fl Q
235 Disable the built-in PROM emulation. This is useful for running raw ROM
236 images from real machines.
237 .It Fl R
238 Use a random bootstrap cpu, instead of CPU nr 0. (For SMP experiments.)
239 .It Fl r
240 Dump register contents for every executed instruction.
241 .It Fl S
242 Initialize the emulated RAM to random data, instead of zeroes.
243 .It Fl T
244 Enter the single-step debugger on unimplemented memory accesses.
245 .It Fl t
246 Show a trace tree of all function calls being made.
247 .It Fl U
248 Enable slow_serial_interrupts_hack_for_linux.
249 .It Fl X
250 Use X11.
251 .It Fl x
252 Open up new xterms for emulated serial ports. (Default is to open up
253 xterms when using configuration files, but not when starting an
254 emulation with settings directly on the command line.)
255 .It Fl Y Ar n
256 Scale down framebuffer windows by
257 .Ar n
258 x
259 .Ar n
260 times.
261 .It Fl y Ar x
262 Set max_random_cycles_per_chunk to
263 .Ar x
264 (experimental).
265 .It Fl Z Ar n
266 Set the number of graphics cards, for emulating a dual-head or tripple-head
267 environment. (Only for DECstation emulation so far.)
268 .It Fl z Ar disp
269 Add
270 .Ar disp
271 as an X11 display to use for framebuffers.
272 .El
273 .Pp
274 Userland options:
275 .Bl -tag -width Ds
276 .It Fl u Ar emul-mode
277 Userland-only (syscall) emulation. (Use
278 .Fl H
279 to get a list of available emulation modes.) Some (but not all) of the
280 options listed under Other options above can also be used with userland
281 emulation.
282 .El
283 .Pp
284 General options:
285 .Bl -tag -width Ds
286 .It Fl D
287 Guarantee fully deterministic behavior. Normally, the emulator calls
288 srandom() with a seed based on the current time at startup. When the
289 .Fl D
290 option is used, the srandom() call is skipped, which should cause two
291 subsequent invocations of the emulator to be identical, if all other
292 settings are identical and no user input is taking place. (If this option
293 is used, then
294 .Fl I
295 must also be used.)
296 .It Fl H
297 Display a list of available CPU types, machine types, and userland
298 emulation modes. (Most of these don't work. Please read the documentation
299 included in the
300 .Nm
301 distribution for details on which modes that actually work.)
302 .It Fl h
303 Display a list of all available command line options.
304 .It Fl K
305 Force the single-step debugger to be entered at the end of a simulation.
306 .It Fl q
307 Quiet mode; this suppresses startup messages.
308 .It Fl s
309 For MIPS emulation: Show opcode usage statistics after the simulation.
310 For non-MIPS emulation (i.e. using dyntrans): Save statistics to a file at
311 regular intervals of which physical addresses that were executed.
312 .It Fl V
313 Start up in the single-step debugger, paused.
314 .It Fl v
315 Verbose debug messages.
316 .El
317 .Pp
318 Configuration file startup:
319 .Bl -tag -width Ds
320 .It @ Ar configfile
321 Start an emulation based on the contents of
322 .Ar "configfile".
323 .El
324 .Pp
325 For more information, please read the documentation in the doc/
326 subdirectory of the
327 .Nm
328 distribution.
329 .Sh EXAMPLES
330 The following command will start NetBSD/pmax on an emulated DECstation
331 5000/200 (3MAX):
332 .Pp
333 .Dl "gxemul -e 3max -d nbsd_pmax.img"
334 .Pp
335 nbsd_pmax.img should be a raw disk image containing a bootable
336 NetBSD/pmax filesystem.
337 .Pp
338 The following command will start an emulation session based on settings in
339 the configuration file "mysession". The -v option tells gxemul to be
340 verbose.
341 .Pp
342 .Dl "gxemul -v @mysession"
343 .Pp
344 If you have compiled the small Hello World program mentioned in the
345 .Nm
346 documentation, the following command will start up an
347 emulated test machine in "paused" mode:
348 .Pp
349 .Dl "gxemul -E testmips -V hello_mips"
350 .Pp
351 (Paused mode means that you enter the interactive single-step debugger
352 directly at startup, instead of launching the Hello World program.)
353 .Pp
354 Please read the documentation for more details.
355 .Sh BUGS
356 There are many bugs. Some of the known bugs are listed in the BUGS
357 file in the
358 .Nm
359 source distribution, some are indirectly mentioned in the TODO file,
360 and some are mentioned in the source code itself.
361 .Pp
362 The binary translation subsystem is really terrible, but it is less
363 terrible than running without it.
364 .Pp
365 Userland (syscall-only) emulation doesn't really work yet.
366 .Pp
367 Emulation of MIPS CPUs is done differently from other emulation modes; the
368 documentation sometimes only reflect the way things work with MIPS
369 emulation, and it is incorrect when applied to e.g. ARM emulation.
370 .Pp
371 .Nm
372 does not simulate individual pipe-line stages or penalties caused by
373 branch-prediction misses or cache misses, so it cannot be used for
374 accurate simulation of any actual real-world processor.
375 .Pp
376 .Nm
377 is not timing-accurate.
378 .Sh AUTHOR
379 Anders Gavare <anders@gavare.se>
380 .Pp
381 See http://gavare.se/gxemul/ for more information.

  ViewVC Help
Powered by ViewVC 1.1.26