/[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

Annotation of /trunk/man/gxemul.1

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16 - (hide annotations)
Mon Oct 8 16:19:01 2007 UTC (16 years, 6 months ago) by dpavlin
File size: 12541 byte(s)
++ trunk/HISTORY	(local)
$Id: HISTORY,v 1.988 2005/10/11 03:53:57 debug Exp $

==============  RELEASE 0.3.6  ==============

20051008	The bug was not because of faulty ARM documentation after all,
		but it was related to those parts of the code.
		Fixing the RTC (dev_mc146818) to work with CATS.
20051009	Rewriting the R() function; now there are 8192 automatically
		generated smaller functions doing the same thing, but hopefully
		faster. This also fixes some bugs which were triggered when
		trying to compile GXemul inside itself. :-)
		Adding a dummy dev_lpt.
20051010	Small hack to not update virtual translation tables if memory
		accesses are done with the NO_EXCEPTION flag; a time reduction
		of almost a factor 2 for a full NetBSD/cats install. :-)
20051011	Passing -A as the default boot arg for CATS (works fine with
		OpenBSD/cats).

==============  RELEASE 0.3.6.1  ==============


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

  ViewVC Help
Powered by ViewVC 1.1.26