1 |
.\" $Id: gxemul.1,v 1.12 2005/04/07 16:00:24 debug Exp $ |
.\" $Id: gxemul.1,v 1.29 2005/08/10 15:51:09 debug Exp $ |
2 |
.\" |
.\" |
3 |
.\" Copyright (C) 2004-2005 Anders Gavare. All rights reserved. |
.\" Copyright (C) 2004-2005 Anders Gavare. All rights reserved. |
4 |
.\" |
.\" |
29 |
.\" This is a minimal man page for GXemul. Process this file with |
.\" This is a minimal man page for GXemul. Process this file with |
30 |
.\" groff -man -Tascii gxemul.1 or nroff -man gxemul.1 |
.\" groff -man -Tascii gxemul.1 or nroff -man gxemul.1 |
31 |
.\" |
.\" |
32 |
.Dd APRIL 2005 |
.Dd AUGUST 2005 |
33 |
.Dt GXEMUL 1 |
.Dt GXEMUL 1 |
34 |
.Os |
.Os |
35 |
.Sh NAME |
.Sh NAME |
47 |
.Ar file Op Ar args ... |
.Ar file Op Ar args ... |
48 |
.Sh DESCRIPTION |
.Sh DESCRIPTION |
49 |
.Nm |
.Nm |
50 |
is an experimental instruction-level machine emulator. It can be used |
is an experimental instruction-level machine emulator. It can be used to |
51 |
to run binary code for (among others) MIPS-based machines. |
run binary code for MIPS-based machines, regardless of host |
52 |
Several emulation modes are available. For some emulation modes, processors |
platform. Several emulation modes are available. For some modes, |
53 |
and surrounding hardware components are emulated well enough to let |
processors and surrounding hardware components are emulated well enough to |
54 |
unmodified operating systems (eg NetBSD) run as if they were running on a |
let unmodified operating systems (e.g. NetBSD) run as if they were running |
55 |
real machine. |
on a real machine. |
56 |
|
.Pp |
57 |
|
(Non-MIPS emulation modes are also under development, but so far none of |
58 |
|
those modes has reached the completeness required to run unmodified |
59 |
|
operating systems.) |
60 |
.Pp |
.Pp |
61 |
There are three ways to invoke the emulator. When emulating a |
There are three ways to invoke the emulator. When emulating a |
62 |
complete machine, settings can be entered directly on the command line, or |
complete machine, settings can be entered directly on the command line, or |
82 |
.Fl H |
.Fl H |
83 |
to get a list of available emulation modes. |
to get a list of available emulation modes. |
84 |
.Pp |
.Pp |
85 |
(There is an exception to the normal invocation usage mentioned above; |
There are two exceptions to the normal invocation usage mentioned above. |
86 |
if you want to use the DECstation emulation mode, and have a bootable |
The first is for DECstation emulation: if you have a bootable |
87 |
DECstation harddisk or CDROM image, then just supplying the diskimage via |
DECstation harddisk or CDROM image, then just supplying the diskimage via |
88 |
the |
the |
89 |
.Fl d |
.Fl d |
90 |
option is sufficient. The filename of the kernel can then be |
option is sufficient. (The filename of the kernel can then be |
91 |
skipped, as the emulator runs the bootblocks from the diskimage directly and |
skipped, as the emulator runs the bootblocks from the diskimage directly and |
92 |
doesn't need the kernel as a separate file.) |
doesn't need the kernel as a separate file.) |
93 |
|
The second is if you supply an ISO9660 CDROM disk image. You may then use |
94 |
|
the |
95 |
|
.Fl j |
96 |
|
option to indicate which file on the CDROM filesystem that should be |
97 |
|
loaded into emulated memory. |
98 |
.Pp |
.Pp |
99 |
Machine selection options: |
Machine selection options: |
100 |
.Bl -tag -width Ds |
.Bl -tag -width Ds |
101 |
.It Fl E Ar t |
.It Fl E Ar t |
102 |
Try to emulate machine type |
Try to emulate machine type |
103 |
.Ar "t". |
.Ar "t". |
104 |
|
This option is not always needed, if the |
105 |
|
.Fl e |
106 |
|
option uniquely selects a machine. |
107 |
(Use |
(Use |
108 |
.Fl H |
.Fl H |
109 |
to get a list of types.) |
to get a list of types.) |
117 |
.Pp |
.Pp |
118 |
Other options: |
Other options: |
119 |
.Bl -tag -width Ds |
.Bl -tag -width Ds |
120 |
|
.It Fl A |
121 |
|
Disable load/store alignment checks in some cases. This might give a small |
122 |
|
increase in performance, but the emulator will not run correctly if the |
123 |
|
emulated code actually tries to do unaligned loads or stores. |
124 |
.It Fl B |
.It Fl B |
125 |
Disable dynamic binary translation completely. By default, bintrans |
Disable dynamic binary translation. By default, bintrans |
126 |
will be turned on if the host architecture supports it. |
will be turned on if the host+target architecture combination is |
127 |
However, in this release (0.3.1), there is no new bintrans system. |
supported. |
|
If you want to enable binary translation, use |
|
|
.Fl "b". |
|
|
.It Fl b |
|
|
Use the OLD binary translation subsystem. (Alpha and i386 hosts only.) |
|
128 |
.It Fl C Ar x |
.It Fl C Ar x |
129 |
Try to emulate a specific CPU type, |
Try to emulate a specific CPU type, |
130 |
.Ar "x". |
.Ar "x". |
138 |
as a disk image. By adding one or more modifier characters and then a |
as a disk image. By adding one or more modifier characters and then a |
139 |
colon (":") as a prefix to |
colon (":") as a prefix to |
140 |
.Ar "name", |
.Ar "name", |
141 |
you can modify the disk image's behaviour. Available modifiers are: |
you can modify the way the disk image is treated. Available modifiers are: |
142 |
.Bl -tag -width Ds |
.Bl -tag -width Ds |
143 |
.It b |
.It b |
144 |
Specifies that this is a boot device. |
Specifies that this is a boot device. |
145 |
.It c |
.It c |
146 |
CD-ROM (instead of a normal SCSI DISK). |
CD-ROM. |
147 |
.It d |
.It d |
148 |
SCSI DISK (this is the default). |
DISK (this is the default). |
149 |
|
.It f |
150 |
|
FLOPPY. |
151 |
|
.It gH;S; |
152 |
|
Override the default geometry; use H heads and S sectors-per-track. |
153 |
|
(The number of cylinders is calculated automatically.) |
154 |
.It i |
.It i |
155 |
IDE (instead of SCSI). |
IDE. |
156 |
.It r |
.It r |
157 |
Read-only (don't allow changes to be written to the file). |
Read-only (don't allow changes to be written to the file). |
158 |
|
.It s |
159 |
|
SCSI (this is the default for most machine types). |
160 |
.It t |
.It t |
161 |
SCSI tape. |
Tape. |
162 |
.It 0-7 |
.It 0-7 |
163 |
Force a specific SCSI ID number. |
Force a specific ID number. |
164 |
.El |
.El |
165 |
.Pp |
.Pp |
166 |
Filenames ending with ".iso" are assumed to be CDROM images, all others |
Unless otherwise specified, filenames ending with ".iso" are assumed to be |
167 |
are assumed to be normal SCSI disks. |
CDROM images. Most others are assumed to be disks. Depending on which |
168 |
|
machine is being emulated, the default for disks can be either SCSI or |
169 |
|
IDE. Some disk images that are very small are assumed to be floppy disks. |
170 |
|
(If you are not happy with the way a disk image is detected, then you need |
171 |
|
to use explicit prefixes to force a specific type.) |
172 |
|
.Pp |
173 |
|
For floppies, the gH;S; prefix is ignored. Instead, the number of |
174 |
|
heads and cylinders are assumed to be 2 and 80, respectively, and the |
175 |
|
number of sectors per track is calculated automatically. (This works for |
176 |
|
720KB, 1.2MB, 1.44MB, and 2.88MB floppies.) |
177 |
.It Fl I Ar x |
.It Fl I Ar x |
178 |
Emulate clock interrupts at |
Emulate clock interrupts at |
179 |
.Ar x |
.Ar x |
187 |
.It Fl j Ar n |
.It Fl j Ar n |
188 |
Set the name of the kernel to |
Set the name of the kernel to |
189 |
.Ar "n". |
.Ar "n". |
190 |
Useful names are "bsd" for OpenBSD/pmax, or "vmunix" for Ultrix. |
When booting from an ISO9660 filesystem, the emulator will try to boot |
191 |
("netbsd" is usually the default value.) |
using this file. (In some emulation modes, eg. DECstation, this name is passed |
192 |
|
along to the boot program. Useful names are "bsd" for OpenBSD/pmax, |
193 |
|
or "vmunix" for Ultrix.) |
194 |
.It Fl M Ar m |
.It Fl M Ar m |
195 |
Emulate |
Emulate |
196 |
.Ar m |
.Ar m |
211 |
Set the boot argument (for DEC, ARC, or SGI emulation). |
Set the boot argument (for DEC, ARC, or SGI emulation). |
212 |
Default |
Default |
213 |
.Ar arg |
.Ar arg |
214 |
for DEC is '-a', for ARC '-aN'. |
for DEC is "-a", for ARC "-aN". |
215 |
.It Fl p Ar pc |
.It Fl p Ar pc |
216 |
Add a breakpoint (remember to use the '0x' prefix for hex). |
Add a breakpoint. (Remember to use the "0x" prefix for hex.) |
217 |
.It Fl Q |
.It Fl Q |
218 |
Disable the built-in PROM emulation. This is useful for running raw ROM |
Disable the built-in PROM emulation. This is useful for running raw ROM |
219 |
images from real machines. |
images from real machines. |
267 |
General options: |
General options: |
268 |
.Bl -tag -width Ds |
.Bl -tag -width Ds |
269 |
.It Fl D |
.It Fl D |
270 |
Guarantee fully deterministic behaviour. Normally, the emulator calls |
Guarantee fully deterministic behavior. Normally, the emulator calls |
271 |
srandom() with a seed based on the current time at startup. When the |
srandom() with a seed based on the current time at startup. When the |
272 |
.Fl D |
.Fl D |
273 |
option is used, the srandom() call is skipped, which should cause two |
option is used, the srandom() call is skipped, which should cause two |
274 |
subsequent invokations of the emulator to be identical, if all other |
subsequent invocations of the emulator to be identical, if all other |
275 |
settings are identical. (If this option is used, then |
settings are identical and no user input is taking place. (If this option |
276 |
|
is used, then |
277 |
.Fl I |
.Fl I |
278 |
must also be used.) |
must also be used.) |
279 |
.It Fl H |
.It Fl H |
309 |
distribution. |
distribution. |
310 |
.Sh EXAMPLES |
.Sh EXAMPLES |
311 |
The following command will start NetBSD/pmax on an emulated DECstation |
The following command will start NetBSD/pmax on an emulated DECstation |
312 |
5000/200 (3MAX), with the old bintrans system enabled: |
5000/200 (3MAX): |
313 |
.Pp |
.Pp |
314 |
.Dl "gxemul -E dec -e 3max -b -d netbsddisk.img" |
.Dl "gxemul -e 3max -d nbsd_pmax.img" |
315 |
.Pp |
.Pp |
316 |
netbsddisk.img should be a raw disk image containing a bootable |
nbsd_pmax.img should be a raw disk image containing a bootable |
317 |
NetBSD/pmax filesystem. |
NetBSD/pmax filesystem. |
318 |
.Pp |
.Pp |
319 |
The following command will start an emulation session based on settings in |
The following command will start an emulation session based on settings in |
337 |
There are many bugs. Some of the known bugs are listed in the BUGS |
There are many bugs. Some of the known bugs are listed in the BUGS |
338 |
file in the |
file in the |
339 |
.Nm |
.Nm |
340 |
source distribution, some are indirectly mentioned in the TODO file. |
source distribution, some are indirectly mentioned in the TODO file, |
341 |
|
and some are mentioned in the source code itself. |
342 |
|
.Pp |
343 |
|
The binary translation subsystem is really terrible, but it is less |
344 |
|
terrible than running without it. |
345 |
.Pp |
.Pp |
346 |
There is no new bintrans system in this release (0.3.1), so you will |
Userland (syscall-only) emulation doesn't really work yet. |
|
need to add |
|
|
.Fl b |
|
|
to select the old bintrans system, if you want speed. |
|
347 |
.Pp |
.Pp |
348 |
.Nm |
.Nm |
349 |
does not simulate individual pipe-line stages or penalties caused by |
does not simulate individual pipe-line stages or penalties caused by |
350 |
branch-prediction misses, so it cannot be used for accurate performance |
branch-prediction misses or cache misses, so it cannot be used for |
351 |
measurement. |
accurate performance measurement. |
352 |
|
.Pp |
353 |
|
.Nm |
354 |
|
is not timing-accurate. |
355 |
.Sh AUTHOR |
.Sh AUTHOR |
356 |
Anders Gavare <anders@gavare.se> |
Anders Gavare <anders@gavare.se> |
357 |
.Pp |
.Pp |