--- trunk/man/gxemul.1 2007/10/08 16:18:27 10 +++ trunk/man/gxemul.1 2007/10/08 16:19:11 18 @@ -1,4 +1,4 @@ -.\" $Id: gxemul.1,v 1.24 2005/06/26 10:05:02 debug Exp $ +.\" $Id: gxemul.1,v 1.35 2005/10/27 14:01:11 debug Exp $ .\" .\" Copyright (C) 2004-2005 Anders Gavare. All rights reserved. .\" @@ -29,7 +29,7 @@ .\" This is a minimal man page for GXemul. Process this file with .\" groff -man -Tascii gxemul.1 or nroff -man gxemul.1 .\" -.Dd JUNE 2005 +.Dd OCTOBER 2005 .Dt GXEMUL 1 .Os .Sh NAME @@ -41,29 +41,45 @@ .Op file Ar ... .Nm .Op general options -.Op Ar @configfile ... +.Ar @configfile .Nm .Op userland, other, and general options .Ar file Op Ar args ... .Sh DESCRIPTION .Nm -is an experimental instruction-level machine emulator. It can be used to -run binary code for (among others) MIPS-based machines, regardless of host -platform. Several emulation modes are available. For some modes, -processors and surrounding hardware components are emulated well enough to -let unmodified operating systems (e.g. NetBSD) run as if they were running -on a real machine. -.Pp -There are three ways to invoke the emulator. When emulating a -complete machine, settings can be entered directly on the command line, or -they can be read from a configuration file. When emulating a userland -environment (syscall-only emulation, not emulating complete machines), -then the program name and its argument should be given on the command -line. +is an experimental instruction-level machine emulator. Several +emulation modes are available. In some modes, processors and surrounding +hardware components are emulated well enough to let unmodified operating +systems (e.g. NetBSD) run as if they were running on a real machine. +.Pp +The processor architecture best emulated by GXemul is MIPS, but other +architectures are also partially emulated. +.Pp +MIPS processors are emulated either using a simple type of binary +translator (on Alpha and i386 hosts), or using traditional slow +interpretation (all other hosts, including amd64 machines running in +64-bit mode). +.Pp +Non-MIPS processors (e.g. ARM) are emulated using a newer dynamic +translation system (called dyntrans in the rest of this man page); +dyntrans does not require any host-specific code, so it should work on any +platform. Performance is somewhere between binary translation and +traditional interpretation. +.Pp +There are three ways to invoke the emulator: +.Pp +1. When emulating a complete machine, configuration options can be entered +directly on the command line. +.Pp +2. Options can be read from a configuration file. +.Pp +3. When emulating a userland environment (syscall-only emulation, not +emulating complete machines), then the program name and its argument +should be given on the command line. (This mode doesn't really work yet.) .Pp The easiest way to use the emulator is to supply settings directly on the command line. The most important thing you need to supply is the -file argument. This is the name of a binary file (an ELF, a.out, ECOFF, +file argument. This is the name of a binary file (an ELF, a.out, COFF/ECOFF, SREC, or a raw binary image) which you wish to run in the emulator. This file might be an operating system kernel, or perhaps a ROM image file. .Pp @@ -97,6 +113,9 @@ .It Fl E Ar t Try to emulate machine type .Ar "t". +This option is not always needed, if the +.Fl e +option uniquely selects a machine. (Use .Fl H to get a list of types.) @@ -110,10 +129,17 @@ .Pp Other options: .Bl -tag -width Ds +.It Fl A +Disable load/store alignment checks in some cases. This might give a small +increase in performance, but the emulator will not run correctly if the +emulated code actually tries to do unaligned loads or stores. (This option +is only meaningful when emulating MIPS CPUs, when the host architecture is +Alpha or i386, and binary translation is enabled.) .It Fl B Disable dynamic binary translation. By default, bintrans will be turned on if the host+target architecture combination is -supported. +supported. Currently, the only supported target architecture for bintrans +is MIPS, and the supported host architectures are Alpha and i386. .It Fl C Ar x Try to emulate a specific CPU type, .Ar "x". @@ -152,12 +178,12 @@ Force a specific ID number. .El .Pp -Unless otherwise specified, filenames ending with ".iso" are assumed to be -CDROM images. Most others are assumed to be disks. Depending on which -machine is being emulated, the default for disks can be either SCSI or -IDE. Some disk images that are very small are assumed to be floppy disks. -(If you are not happy with the way a disk image is detected, then you need -to use explicit prefixes to force a specific type.) +Unless otherwise specified, filenames ending with ".iso" or ".cdr" are +assumed to be CDROM images. Most others are assumed to be disks. Depending +on which machine is being emulated, the default for disks can be either +SCSI or IDE. Some disk images that are very small are assumed to be floppy +disks. (If you are not happy with the way a disk image is detected, then +you need to use explicit prefixes to force a specific type.) .Pp For floppies, the gH;S; prefix is ignored. Instead, the number of heads and cylinders are assumed to be 2 and 80, respectively, and the @@ -172,7 +198,9 @@ .It Fl i Display each instruction as it is being executed. .It Fl J -Disable some speed tricks. +Disable some speed tricks. For MIPS emulation, these are mostly +timing-related. For non-MIPS emulation (i.e. those modes using dyntrans), +this flag disables the use of "instruction combinations". .It Fl j Ar n Set the name of the kernel to .Ar "n". @@ -197,10 +225,10 @@ Force a "netboot" (tftp instead of disk), even when a disk image is present (for DECstation, SGI, and ARC emulation). .It Fl o Ar arg -Set the boot argument (for DEC, ARC, or SGI emulation). +Set the boot argument (mostly useful for DEC, ARC, or SGI emulation). Default .Ar arg -for DEC is "-a", for ARC "-aN". +for DEC is "-a", for ARC/SGI it is "-aN", and for CATS it is "-A". .It Fl p Ar pc Add a breakpoint. (Remember to use the "0x" prefix for hex.) .It Fl Q @@ -278,7 +306,9 @@ .It Fl q Quiet mode; this suppresses startup messages. .It Fl s -Show opcode usage statistics after the simulation. +For MIPS emulation: Show opcode usage statistics after the simulation. +For non-MIPS emulation (i.e. using dyntrans): Save statistics to a file at +regular intervals of which physical addresses that were executed. .It Fl V Start up in the single-step debugger, paused. .It Fl v @@ -300,7 +330,7 @@ The following command will start NetBSD/pmax on an emulated DECstation 5000/200 (3MAX): .Pp -.Dl "gxemul -E dec -e 3max -d nbsd_pmax.img" +.Dl "gxemul -e 3max -d nbsd_pmax.img" .Pp nbsd_pmax.img should be a raw disk image containing a bootable NetBSD/pmax filesystem. @@ -326,15 +356,22 @@ There are many bugs. Some of the known bugs are listed in the BUGS file in the .Nm -source distribution, some are indirectly mentioned in the TODO file. +source distribution, some are indirectly mentioned in the TODO file, +and some are mentioned in the source code itself. .Pp The binary translation subsystem is really terrible, but it is less terrible than running without it. .Pp +Userland (syscall-only) emulation doesn't really work yet. +.Pp +Emulation of MIPS CPUs is done differently from other emulation modes; the +documentation sometimes only reflect the way things work with MIPS +emulation, and it is incorrect when applied to e.g. ARM emulation. +.Pp .Nm does not simulate individual pipe-line stages or penalties caused by -branch-prediction misses or cache misses, so it cannot be used for -accurate performance measurement. +branch-prediction misses or cache misses, so it cannot be used for +accurate simulation of any actual real-world processor. .Pp .Nm is not timing-accurate.