--- trunk/man/gxemul.1 2007/10/08 16:17:48 2 +++ trunk/man/gxemul.1 2007/10/08 16:18:51 14 @@ -1,4 +1,4 @@ -.\" $Id: gxemul.1,v 1.12 2005/04/07 16:00:24 debug Exp $ +.\" $Id: gxemul.1,v 1.33 2005/10/07 22:45:34 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 APRIL 2005 +.Dd OCTOBER 2005 .Dt GXEMUL 1 .Os .Sh NAME @@ -41,29 +41,34 @@ .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. -Several emulation modes are available. For some emulation modes, processors -and surrounding hardware components are emulated well enough to let -unmodified operating systems (eg 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 +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 @@ -78,20 +83,28 @@ .Fl H to get a list of available emulation modes. .Pp -(There is an exception to the normal invocation usage mentioned above; -if you want to use the DECstation emulation mode, and have a bootable +There are two exceptions to the normal invocation usage mentioned above. +The first is for DECstation emulation: if you have a bootable DECstation harddisk or CDROM image, then just supplying the diskimage via the .Fl d -option is sufficient. The filename of the kernel can then be +option is sufficient. (The filename of the kernel can then be skipped, as the emulator runs the bootblocks from the diskimage directly and doesn't need the kernel as a separate file.) +The second is if you supply an ISO9660 CDROM disk image. You may then use +the +.Fl j +option to indicate which file on the CDROM filesystem that should be +loaded into emulated memory. .Pp Machine selection options: .Bl -tag -width Ds .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.) @@ -105,14 +118,14 @@ .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. .It Fl B -Disable dynamic binary translation completely. By default, bintrans -will be turned on if the host architecture supports it. -However, in this release (0.3.1), there is no new bintrans system. -If you want to enable binary translation, use -.Fl "b". -.It Fl b -Use the OLD binary translation subsystem. (Alpha and i386 hosts only.) +Disable dynamic binary translation. By default, bintrans +will be turned on if the host+target architecture combination is +supported. .It Fl C Ar x Try to emulate a specific CPU type, .Ar "x". @@ -126,26 +139,42 @@ as a disk image. By adding one or more modifier characters and then a colon (":") as a prefix to .Ar "name", -you can modify the disk image's behaviour. Available modifiers are: +you can modify the way the disk image is treated. Available modifiers are: .Bl -tag -width Ds .It b Specifies that this is a boot device. .It c -CD-ROM (instead of a normal SCSI DISK). +CD-ROM. .It d -SCSI DISK (this is the default). +DISK (this is the default). +.It f +FLOPPY. +.It gH;S; +Override the default geometry; use H heads and S sectors-per-track. +(The number of cylinders is calculated automatically.) .It i -IDE (instead of SCSI). +IDE. .It r Read-only (don't allow changes to be written to the file). +.It s +SCSI (this is the default for most machine types). .It t -SCSI tape. +Tape. .It 0-7 -Force a specific SCSI ID number. +Force a specific ID number. .El .Pp -Filenames ending with ".iso" are assumed to be CDROM images, all others -are assumed to be normal SCSI disks. +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 +number of sectors per track is calculated automatically. (This works for +720KB, 1.2MB, 1.44MB, and 2.88MB floppies.) .It Fl I Ar x Emulate clock interrupts at .Ar x @@ -159,8 +188,10 @@ .It Fl j Ar n Set the name of the kernel to .Ar "n". -Useful names are "bsd" for OpenBSD/pmax, or "vmunix" for Ultrix. -("netbsd" is usually the default value.) +When booting from an ISO9660 filesystem, the emulator will try to boot +using this file. (In some emulation modes, eg. DECstation, this name is passed +along to the boot program. Useful names are "bsd" for OpenBSD/pmax, +or "vmunix" for Ultrix.) .It Fl M Ar m Emulate .Ar m @@ -181,9 +212,9 @@ Set the boot argument (for DEC, ARC, or SGI emulation). Default .Ar arg -for DEC is '-a', for ARC '-aN'. +for DEC is "-a", for ARC "-aN". .It Fl p Ar pc -Add a breakpoint (remember to use the '0x' prefix for hex). +Add a breakpoint. (Remember to use the "0x" prefix for hex.) .It Fl Q Disable the built-in PROM emulation. This is useful for running raw ROM images from real machines. @@ -237,12 +268,13 @@ General options: .Bl -tag -width Ds .It Fl D -Guarantee fully deterministic behaviour. Normally, the emulator calls +Guarantee fully deterministic behavior. Normally, the emulator calls srandom() with a seed based on the current time at startup. When the .Fl D option is used, the srandom() call is skipped, which should cause two -subsequent invokations of the emulator to be identical, if all other -settings are identical. (If this option is used, then +subsequent invocations of the emulator to be identical, if all other +settings are identical and no user input is taking place. (If this option +is used, then .Fl I must also be used.) .It Fl H @@ -278,11 +310,11 @@ distribution. .Sh EXAMPLES The following command will start NetBSD/pmax on an emulated DECstation -5000/200 (3MAX), with the old bintrans system enabled: +5000/200 (3MAX): .Pp -.Dl "gxemul -E dec -e 3max -b -d netbsddisk.img" +.Dl "gxemul -e 3max -d nbsd_pmax.img" .Pp -netbsddisk.img should be a raw disk image containing a bootable +nbsd_pmax.img should be a raw disk image containing a bootable NetBSD/pmax filesystem. .Pp The following command will start an emulation session based on settings in @@ -306,17 +338,21 @@ 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 -There is no new bintrans system in this release (0.3.1), so you will -need to add -.Fl b -to select the old bintrans system, if you want speed. +Userland (syscall-only) emulation doesn't really work yet. .Pp .Nm does not simulate individual pipe-line stages or penalties caused by -branch-prediction 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. .Sh AUTHOR Anders Gavare .Pp