/[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 32 - (show annotations)
Mon Oct 8 16:20:58 2007 UTC (16 years, 6 months ago) by dpavlin
File size: 17808 byte(s)
++ trunk/HISTORY	(local)
$Id: HISTORY,v 1.1421 2006/11/06 05:32:37 debug Exp $
20060816	Adding a framework for emulated/virtual timers (src/timer.c),
		using only setitimer().
		Rewriting the mc146818 to use the new timer framework.
20060817	Adding a call to gettimeofday() every now and then (once every
		second, at the moment) to resynch the timer if it drifts.
		Beginning to convert the ISA timer interrupt mechanism (8253
		and 8259) to use the new timer framework.
		Removing the -I command line option.
20060819	Adding the -I command line option again, with new semantics.
		Working on Footbridge timer interrupts; NetBSD/NetWinder and
		NetBSD/CATS now run at correct speed, but unfortunately with
		HUGE delays during bootup.
20060821	Some minor m68k updates. Adding the first instruction: nop. :)
		Minor Alpha emulation updates.
20060822	Adding a FreeBSD development specific YAMON environment
		variable ("khz") (as suggested by Bruce M. Simpson).
		Moving YAMON environment variable initialization from
		machine_evbmips.c into promemul/yamon.c, and adding some more
		variables.
		Continuing on the LCA PCI bus controller (for Alpha machines).
20060823	Continuing on the timer stuff: experimenting with MIPS count/
		compare interrupts connected to the timer framework.
20060825	Adding bogus SCSI commands 0x51 (SCSICDROM_READ_DISCINFO) and
		0x52 (SCSICDROM_READ_TRACKINFO) to the SCSI emulation layer,
		to allow NetBSD/pmax 4.0_BETA to be installed from CDROM.
		Minor updates to the LCA PCI controller.
20060827	Implementing a CHIP8 cpu mode, and a corresponding CHIP8
		machine, for fun. Disassembly support for all instructions,
		and most of the common instructions have been implemented: mvi,
		mov_imm, add_imm, jmp, rand, cls, sprite, skeq_imm, jsr,
		skne_imm, bcd, rts, ldr, str, mov, or, and, xor, add, sub,
		font, ssound, sdelay, gdelay, bogus skup/skpr, skeq, skne.
20060828	Beginning to convert the CHIP8 cpu in the CHIP8 machine to a
		(more correct) RCA 180x cpu. (Disassembly for all 1802
		instructions has been implemented, but no execution yet, and
		no 1805 extended instructions.)
20060829	Minor Alpha emulation updates.
20060830	Beginning to experiment a little with PCI IDE for SGI O2.
		Fixing the cursor key mappings for MobilePro 770 emulation.
		Fixing the LK201 warning caused by recent NetBSD/pmax.
		The MIPS R41xx standby, suspend, and hibernate instructions now
		behave like the RM52xx/MIPS32/MIPS64 wait instruction.
		Fixing dev_wdc so it calculates correct (64-bit) offsets before
		giving them to diskimage_access().
20060831	Continuing on Alpha emulation (OSF1 PALcode).
20060901	Minor Alpha updates; beginning on virtual memory pagetables.
		Removed the limit for max nr of devices (in preparation for
		allowing devices' base addresses to be changed during runtime).
		Adding a hack for MIPS [d]mfc0 select 0 (except the count
		register), so that the coproc register is simply copied.
		The MIPS suspend instruction now exits the emulator, instead
		of being treated as a wait instruction (this causes NetBSD/
		hpcmips to get correct 'halt' behavior).
		The VR41xx RTC now returns correct time.
		Connecting the VR41xx timer to the timer framework (fixed at
		128 Hz, for now).
		Continuing on SPARC emulation, adding more instructions:
		restore, ba_xcc, ble. The rectangle drawing demo works :)
		Removing the last traces of the old ENABLE_CACHE_EMULATION
		MIPS stuff (not usable with dyntrans anyway).
20060902	Splitting up src/net.c into several smaller files in its own
		subdirectory (src/net/).
20060903	Cleanup of the files in src/net/, to make them less ugly.
20060904	Continuing on the 'settings' subsystem.
		Minor progress on the SPARC emulation mode.
20060905	Cleanup of various things, and connecting the settings
		infrastructure to various subsystems (emul, machine, cpu, etc).
		Changing the lk201 mouse update routine to not rely on any
		emulated hardware framebuffer cursor coordinates, but instead
		always do (semi-usable) relative movements.
20060906	Continuing on the lk201 mouse stuff. Mouse behaviour with
		multiple framebuffers (which was working in Ultrix) is now
		semi-broken (but it still works, in a way).
		Moving the documentation about networking into its own file
		(networking.html), and refreshing it a bit. Adding an example
		of how to use ethernet frame direct-access (udp_snoop).
20060907	Continuing on the settings infrastructure.
20060908	Minor updates to SH emulation: for 32-bit emulation: delay
		slots and the 'jsr @Rn' instruction. I'm putting 64-bit SH5 on
		ice, for now.
20060909-10	Implementing some more 32-bit SH instructions. Removing the
		64-bit mode completely. Enough has now been implemented to run
		the rectangle drawing demo. :-)
20060912	Adding more SH instructions.
20060916	Continuing on SH emulation (some more instructions: div0u,
		div1, rotcl/rotcr, more mov instructions, dt, braf, sets, sett,
		tst_imm, dmuls.l, subc, ldc_rm_vbr, movt, clrt, clrs, clrmac).
		Continuing on the settings subsystem (beginning on reading/
		writing settings, removing bugs, and connecting more cpus to
		the framework).
20060919	More work on SH emulation; adding an ldc banked instruction,
		and attaching a 640x480 framebuffer to the Dreamcast machine
		mode (NetBSD/dreamcast prints the NetBSD copyright banner :-),
		and then panics).
20060920	Continuing on the settings subsystem.
20060921	Fixing the Footbridge timer stuff so that NetBSD/cats and
		NetBSD/netwinder boot up without the delays.
20060922	Temporarily hardcoding MIPS timer interrupt to 100 Hz. With
		'wait' support disabled, NetBSD/malta and Linux/malta run at
		correct speed.
20060923	Connecting dev_gt to the timer framework, so that NetBSD/cobalt
		runs at correct speed.
		Moving SH4-specific memory mapped registers into its own
		device (dev_sh4.c).
		Running with -N now prints "idling" instead of bogus nr of
		instrs/second (which isn't valid anyway) while idling.
20060924	Algor emulation should now run at correct speed.
		Adding disassembly support for some MIPS64 revision 2
		instructions: ext, dext, dextm, dextu.
20060926	The timer framework now works also when the MIPS wait
		instruction is used.
20060928	Re-implementing checks for coprocessor availability for MIPS
		cop0 instructions. (Thanks to Carl van Schaik for noticing the
		lack of cop0 availability checks.)
20060929	Implementing an instruction combination hack which treats
		NetBSD/pmax' idle loop as a wait-like instruction.
20060930	The ENTRYHI_R_MASK was missing in (at least) memory_mips_v2p.c,
		causing TLB lookups to sometimes succeed when they should have
		failed. (A big thank you to Juli Mallett for noticing the
		problem.)
		Adding disassembly support for more MIPS64 revision 2 opcodes
		(seb, seh, wsbh, jalr.hb, jr.hb, synci, ins, dins, dinsu,
		dinsm, dsbh, dshd, ror, dror, rorv, drorv, dror32). Also
		implementing seb, seh, dsbh, dshd, and wsbh.
		Implementing an instruction combination hack for Linux/pmax'
		idle loop, similar to the NetBSD/pmax case.
20061001	Changing the NetBSD/sgimips install instructions to extract
		files from an iso image, instead of downloading them via ftp.
20061002	More-than-31-bit userland addresses in memory_mips_v2p.c were
		not actually working; applying a fix from Carl van Schaik to
		enable them to work + making some other updates (adding kuseg
		support).
		Fixing hpcmips (vr41xx) timer initialization.
		Experimenting with O(n)->O(1) reduction in the MIPS TLB lookup
		loop. Seems to work both for R3000 and non-R3000.
20061003	Continuing a little on SH emulation (adding more control
		registers; mini-cleanup of memory_sh.c).
20061004	Beginning on a dev_rtc, a clock/timer device for the test
		machines; also adding a demo, and some documentation.
		Fixing a bug in SH "mov.w @(disp,pc),Rn" (the result wasn't
		sign-extended), and adding the addc and ldtlb instructions.
20061005	Contining on SH emulation: virtual to physical address
		translation, and a skeleton exception mechanism.
20061006	Adding more SH instructions (various loads and stores, rte,
		negc, muls.w, various privileged register-move instructions).
20061007	More SH instructions: various move instructions, trapa, div0s,
		float, fdiv, ftrc.
		Continuing on dev_rtc; removing the rtc demo.
20061008	Adding a dummy Dreamcast PROM module. (Homebrew Dreamcast
		programs using KOS libs need this.)
		Adding more SH instructions: "stc vbr,rn", rotl, rotr, fsca,
		fmul, fadd, various floating-point moves, etc. A 256-byte
		demo for Dreamcast runs :-)
20061012	Adding the SH "lds Rm,pr" and bsr instructions.
20061013	More SH instructions: "sts fpscr,rn", tas.b, and some more
		floating point instructions, cmp/str, and more moves.
		Adding a dummy dev_pvr (Dreamcast graphics controller).
20061014	Generalizing the expression evaluator (used in the built-in
		debugger) to support parentheses and +-*/%^&|.
20061015	Removing the experimental tlb index hint code in
		mips_memory_v2p.c, since it didn't really have any effect.
20061017	Minor SH updates; adding the "sts pr,Rn", fcmp/gt, fneg,
		frchg, and some other instructions. Fixing missing sign-
		extension in an 8-bit load instruction.
20061019	Adding a simple dev_dreamcast_rtc.
		Implementing memory-mapped access to the SH ITLB/UTLB arrays.
20061021	Continuing on various SH and Dreamcast things: sh4 timers,
		debug messages for dev_pvr, fixing some virtual address
		translation bugs, adding the bsrf instruction.
		The NetBSD/dreamcast GENERIC_MD kernel now reaches userland :)
		Adding a dummy dev_dreamcast_asic.c (not really useful yet).
		Implementing simple support for Store Queues.
		Beginning on the PVR Tile Accelerator.
20061022	Generalizing the PVR framebuffer to support off-screen drawing,
		multiple bit-depths, etc. (A small speed penalty, but most
		likely worth it.)
		Adding more SH instructions (mulu.w, fcmp/eq, fsub, fmac,
		fschg, and some more); correcting bugs in "fsca" and "float".
20061024	Adding the SH ftrv (matrix * vector) instruction. Marcus
		Comstedt's "tatest" example runs :) (wireframe only).
		Correcting disassembly for SH floating point instructions that
		use the xd* registers.
		Adding the SH fsts instruction.
		In memory_device_dyntrans_access(), only the currently used
		range is now invalidated, and not the entire device range.
20061025	Adding a dummy AVR32 cpu mode skeleton.
20061026	Various Dreamcast updates; beginning on a Maple bus controller.
20061027	Continuing on the Maple bus. A bogus Controller, Keyboard, and
		Mouse can now be detected by NetBSD and KOS homebrew programs.
		Cleaning up the SH4 Timer Management Unit, and beginning on
		SH4 interrupts.
		Implementing the Dreamcast SYSASIC.
20061028	Continuing on the SYSASIC.
		Adding the SH fsqrt instruction.
		memory_sh.c now actually scans the ITLB.
		Fixing a bug in dev_sh4.c, related to associative writes into
		the memory-mapped UTLB array. NetBSD/dreamcast now reaches
		userland stably, and prints the "Terminal type?" message :-]
		Implementing enough of the Dreamcast keyboard to make NetBSD
		accept it for input.
		Enabling SuperH for stable (non-development) builds.
		Adding NetBSD/dreamcast to the documentation, although it
		doesn't support root-on-nfs yet.
20061029	Changing usleep(1) calls in the debugger to to usleep(10000)
		(according to Brian Foley, this makes GXemul run better on
		MacOS X).
		Making the Maple "Controller" do something (enough to barely
		interact with dcircus.elf).
20061030-31	Some progress on the PVR. More test programs start running (but
		with strange output).
		Various other SH4-related updates.
20061102	Various Dreamcast and SH4 updates; more KOS demos run now.
20061104	Adding a skeleton dev_mb8696x.c (the Dreamcast's LAN adapter).
20061105	Continuing on the MB8696x; NetBSD/dreamcast detects it as mbe0.
		Testing for the release.

==============  RELEASE 0.4.3  ==============


1 .\" $Id: gxemul.1,v 1.76 2006/11/04 06:40:20 debug Exp $
2 .\"
3 .\" Copyright (C) 2004-2006 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 NOVEMBER 2006
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 .\" TODO: Reenable this once userland emulation works:
46 .\" .Nm
47 .\" .Op userland, other, and general options
48 .\" .Ar file Op Ar args ...
49 .Sh DESCRIPTION
50 .Nm
51 is an experimental instruction-level machine emulator. Several
52 emulation modes are available. In some modes, processors and surrounding
53 hardware components are emulated well enough to let unmodified operating
54 systems (e.g. NetBSD) run inside the emulator as if they were running on a
55 real machine.
56 .Pp
57 Processors (ARM, MIPS, PowerPC, SuperH) are emulated using dynamic translation.
58 However, unlike some other dynamically translating emulators, GXemul does
59 not currently generate native code, only a "runnable intermediate
60 representation", and will thus run on any host architecture, without the
61 need to implement per-architecture backends.
62 .Pp
63 The emulator can be invoked in the following ways:
64 .Pp
65 1. When emulating a complete machine, configuration options can be entered
66 directly on the command line.
67 .Pp
68 2. Options can be read from a configuration file.
69 .\" .Pp
70 .\" 3. When emulating a userland environment (syscall-only emulation, not
71 .\" emulating complete machines), then the program name and its argument
72 .\" should be given on the command line. (This mode doesn't really work yet,
73 .\" and is disabled for stable release builds.)
74 .Pp
75 The easiest way to use the emulator is to supply settings directly on the
76 command line. The most important thing you need to supply is the
77 file argument. This is the name of a binary file (an ELF, a.out, COFF/ECOFF,
78 SREC, or a raw binary image) which you wish to run in the emulator. This file
79 might be an operating system kernel, or perhaps a ROM image file.
80 .Pp
81 If more than one filename is supplied, all files are loaded into memory,
82 and the entry point (if available) is taken from the last file.
83 .Pp
84 Apart from the name of a binary file, it is also necessary to select
85 which specific emulation mode to use. For example, a MIPS-based machine
86 from DEC (a DECstation) is very different from a MIPS-based machine
87 from SGI. Use
88 .Nm
89 .Fl H
90 to get a list of available emulation modes.
91 .Pp
92 There are two exceptions to the normal invocation usage mentioned above.
93 The first is for DECstation emulation: if you have a bootable
94 DECstation harddisk or CDROM image, then just supplying the diskimage via
95 the
96 .Fl d
97 option is sufficient. (The filename of the kernel can then be
98 skipped, as the emulator runs the bootblocks from the diskimage directly and
99 doesn't need the kernel as a separate file.)
100 The second is if you supply an ISO9660 CDROM disk image. You may then use
101 the
102 .Fl j
103 option to indicate which file on the CDROM filesystem that should be
104 loaded into emulated memory.
105 .Pp
106 Gzipped kernels are automatically unzipped, by calling the external gunzip
107 program, both when specifying a gzipped file directly on the command line
108 and when loading such a file using the
109 .Fl j
110 option.
111 .Pp
112 Machine selection options:
113 .Bl -tag -width Ds
114 .It Fl E Ar t
115 Try to emulate machine type
116 .Ar "t".
117 This option is not always needed, if the
118 .Fl e
119 option uniquely selects a machine.
120 (Use
121 .Fl H
122 to get a list of types.)
123 .It Fl e Ar st
124 Try to emulate machine subtype
125 .Ar "st".
126 Use this together with
127 .Fl E .
128 (This option is not always needed, if a machine type has no subtypes.)
129 .El
130 .Pp
131 Other options:
132 .Bl -tag -width Ds
133 .It Fl C Ar x
134 Try to emulate a specific CPU type,
135 .Ar "x".
136 This overrides the default CPU type for the machine being emulated.
137 (Use
138 .Fl H
139 to get a list of available CPU types.)
140 .It Fl d Ar [modifiers:]filename
141 Add
142 .Ar filename
143 as a disk image. By adding one or more modifier characters and then a
144 colon (":") as a prefix to
145 .Ar filename,
146 you can modify the way the disk image is treated. Available modifiers are:
147 .Bl -tag -width Ds
148 .It b
149 Specifies that this is a boot device.
150 .It c
151 CD-ROM.
152 .It d
153 DISK (this is the default).
154 .It f
155 FLOPPY.
156 .It gH;S;
157 Override the default geometry; use H heads and S sectors-per-track.
158 (The number of cylinders is calculated automatically.)
159 .It i
160 IDE. (This is the default for most machine types.)
161 .It r
162 Read-only (don't allow changes to be written to the file).
163 .It s
164 SCSI.
165 .It t
166 Tape.
167 .It 0-7
168 Force a specific ID number.
169 .El
170 .Pp
171 For SCSI devices, the ID number is the SCSI ID. For IDE harddisks, the ID
172 number has the following meaning:
173 .Bl -tag -width Ds
174 .It 0
175 Primary master.
176 .It 1
177 Primary slave.
178 .It 2
179 Secondary master.
180 .It 3
181 Secondary slave.
182 .El
183 .Pp
184 Unless otherwise specified, filenames ending with ".iso" or ".cdr" are
185 assumed to be CDROM images. Most others are assumed to be disks. Depending
186 on which machine is being emulated, the default for disks can be either
187 SCSI or IDE. Some disk images that are very small are assumed to be floppy
188 disks. (If you are not happy with the way a disk image is detected, then
189 you need to use explicit prefixes to force a specific type.)
190 .Pp
191 For floppies, the gH;S; prefix is ignored. Instead, the number of
192 heads and cylinders are assumed to be 2 and 80, respectively, and the
193 number of sectors per track is calculated automatically. (This works for
194 720KB, 1.2MB, 1.44MB, and 2.88MB floppies.)
195 .It Fl G Ar port
196 Pause at startup, and listen to TCP port
197 .Ar port
198 for incoming remote GDB connections. The emulator starts up in paused
199 mode, and it is up to the remote GDB instance to start the session.
200 .It Fl I Ar hz
201 Set the main CPUs frequency to
202 .Ar hz
203 Hz. This option does not work for all emulated machine modes. It affects
204 the way count/compare interrupts are faked to simulate emulated time =
205 real world time. If the guest operating system relies on RTC interrupts
206 instead of count/compare interrupts, then this option has no effect.
207 .Pp
208 Setting the frequency to zero disables automatic synchronization of
209 emulated time vs real world time, and the count/compare system runs at a
210 fixed rate.
211 .It Fl i
212 Enable instruction trace, i.e. display disassembly of each instruction as
213 it is being executed.
214 .It Fl J
215 Disable instruction combinations in the dynamic translator.
216 .It Fl j Ar n
217 Set the name of the kernel to
218 .Ar "n".
219 When booting from an ISO9660 filesystem, the emulator will try to boot
220 using this file. (In some emulation modes, eg. DECstation, this name is passed
221 along to the boot program. Useful names are "bsd" for OpenBSD/pmax,
222 "vmunix" for Ultrix, or "vmsprite" for Sprite.)
223 .It Fl M Ar m
224 Emulate
225 .Ar m
226 MBs of physical RAM. This overrides the default amount of RAM for the
227 selected machine type.
228 .It Fl N
229 Display the number of executed instructions per second on average, at
230 regular intervals.
231 .It Fl n Ar nr
232 Set the number of processors in the machine, for SMP experiments.
233 .Pp
234 Note 1: The emulator allocates quite a lot of virtual memory for
235 per-CPU translation tables. On 64-bit hosts, this is normally not a
236 problem. On 32-bit hosts, this can use up all available virtual userspace
237 memory. The solution is to either run the emulator on a 64-bit host,
238 or limit the number of emulated CPUs to a reasonably low number.
239 .Pp
240 Note 2: SMP simulation is not working very well yet; multiple processors
241 are simulated, but synchronization between the processors does not map
242 very well to how real-world SMP systems work.
243 .It Fl O
244 Force a "netboot" (tftp instead of disk), even when a disk image is
245 present (for DECstation, SGI, and ARC emulation).
246 .It Fl o Ar arg
247 Set the boot argument (mostly useful for DEC, ARC, or SGI emulation).
248 Default
249 .Ar arg
250 for DEC is "-a", for ARC/SGI it is "-aN", and for CATS it is "-A".
251 .It Fl p Ar pc
252 Add a breakpoint.
253 .Ar pc
254 can be a symbol, or a numeric value. (Remember to use the "0x" prefix for
255 hexadecimal values.)
256 .It Fl Q
257 Disable the built-in (software-only) PROM emulation. This option is useful
258 for experimenting with running raw ROM images from real machines. The default
259 behaviour of the emulator is to "fake" certain PROM calls used by guest
260 operating systems (e.g. NetBSD), so that no real PROM image is needed.
261 .It Fl R
262 Use a random bootstrap cpu, instead of CPU nr 0. (This option is only
263 meaningful together with the
264 .Fl n
265 option.)
266 .It Fl r
267 Dump register contents for every executed instruction.
268 .It Fl S
269 Initialize emulated RAM to random data, instead of zeroes. This option
270 is useful when trying to trigger bugs in a program that occur because the
271 program assumed that uninitialized memory contains zeros. (Use with
272 care.)
273 .It Fl s Ar flags:filename
274 Gather statistics based on the current emulated program counter value,
275 while the program executes. The statistics is actually just a raw dump of
276 all program counter values in sequence, suitable for post-analysis with
277 separate tools. Output is appended to
278 .Ar filename.
279 .Pp
280 The
281 .Ar flags
282 should include one or more of the following type specifiers:
283 .Bl -tag -width Ds
284 .It v
285 Virtual. This means that the program counter value is used.
286 .It p
287 Physical. This means that the physical address of where the program
288 is actually running is used.
289 .It i
290 Instruction call. This type of statistics gathering is practically only
291 useful during development of the emulator itself. The output is a list of
292 addresses of instruction call functions (ic->f), which after some
293 post-processing can be used as a basis for deciding when to implement
294 instruction combinations.
295 .El
296 .Pp
297 The
298 .Ar flags
299 may also include the following optional modifiers:
300 .Bl -tag -width Ds
301 .It d
302 Disabled at startup.
303 .It o
304 Overwrite the file, instead of appending to it.
305 .El
306 .Pp
307 .\" Statistics gathering can be enabled/disabled at runtime by using the
308 .\" "TODO" debugger command.
309 .\" .Pp
310 When gathering instruction statistics using the
311 .Fl s
312 option, instruction combinations are always disabled (i.e.
313 an implicit
314 .Fl J
315 is added to the command line).
316 .Pp
317 If a value is missing (e.g. the end-of-page slot does not really have a
318 known physical address), it is written out as just a dash ("-").
319 .It Fl t
320 Show a trace tree of all function calls being made.
321 .It Fl U
322 Enable slow_serial_interrupts_hack_for_linux.
323 .It Fl X
324 Use X11. This option enables graphical framebuffers.
325 .It Fl x
326 Open up new xterms for emulated serial ports. The default behaviour is to
327 open up xterms when using configuration files, or if X11 is enabled. When
328 starting up a simple emulation session with settings directly on the
329 command line, and neither
330 .Fl X
331 nor
332 .Fl x
333 is used, then all output is confined to the terminal that
334 .Nm
335 started in.
336 .It Fl Y Ar n
337 Scale down framebuffer windows by
338 .Ar n
339 x
340 .Ar n
341 times. This option is useful when emulating a very large framebuffer, and
342 the actual display is of lower resolution. If
343 .Ar n
344 is negative, then there will be no scaledown, but emulation of certain
345 graphic controllers will be scaled up
346 by
347 .Ar -n
348 times instead. E.g. Using
349 .Ar -2
350 with VGA text mode emulation will result in 80x25 character cells rendered
351 in a 1280x800 window, instead of the normal resolution of 640x400.
352 .It Fl Z Ar n
353 Set the number of graphics cards, for emulating a dual-head or tripple-head
354 environment. (Only for DECstation emulation so far.)
355 .It Fl z Ar disp
356 Add
357 .Ar disp
358 as an X11 display to use for framebuffers.
359 .El
360 .Pp
361 .\" Userland options:
362 .\" .Bl -tag -width Ds
363 .\" .It Fl u Ar emul-mode
364 .\" Userland-only (syscall) emulation. (Use
365 .\" .Fl H
366 .\" to get a list of available emulation modes.) Some (but not all) of the
367 .\" options listed under Other options above can also be used with
368 .\" userland emulation.
369 .\" .El
370 .\" .Pp
371 General options:
372 .Bl -tag -width Ds
373 .It Fl c Ar cmd
374 Add
375 .Ar cmd
376 as a command to run before starting the simulation. A similar effect can
377 be achieved by using the
378 .Fl V
379 option, and entering the commands manually.
380 .It Fl D
381 Causes the emulator to skip a call to srandom(). This leads to somewhat
382 more deterministic behaviour than running without this option.
383 However, if the emulated machine has clocks or timer interrupt sources,
384 or if user interaction is taking place (e.g. keyboard input at irregular
385 intervals), then this option is meaningless.
386 .It Fl H
387 Display a list of available CPU types, machine types, and userland
388 emulation modes. (Most of these don't work. Please read the documentation
389 included in the
390 .Nm
391 distribution for details on which modes that actually work. Userland
392 emulation is not included in stable release builds, since it doesn't work
393 yet.)
394 .It Fl h
395 Display a list of all available command line options.
396 .It Fl K
397 Force the single-step debugger to be entered at the end of a simulation.
398 .It Fl q
399 Quiet mode; this suppresses startup messages.
400 .\".It Fl s
401 .\"For MIPS emulation: Show opcode usage statistics after the simulation.
402 .\"For non-MIPS emulation (i.e. using dyntrans): Save statistics to a file
403 .\"at regular intervals of which physical addresses that were executed.
404 .It Fl V
405 Start up in the single-step debugger, paused.
406 .It Fl v
407 Increase verbosity (show more debug messages). This option can be used
408 multiple times.
409 .El
410 .Pp
411 Configuration file startup:
412 .Bl -tag -width Ds
413 .It @ Ar configfile
414 Start an emulation based on the contents of
415 .Ar "configfile".
416 .El
417 .Pp
418 For more information, please read the documentation in the doc/
419 subdirectory of the
420 .Nm
421 distribution.
422 .Sh EXAMPLES
423 The following command will start NetBSD/pmax on an emulated DECstation
424 5000/200 (3MAX):
425 .Pp
426 .Dl "gxemul -e 3max -d nbsd_pmax.img"
427 .Pp
428 nbsd_pmax.img should be a raw disk image containing a bootable
429 NetBSD/pmax filesystem.
430 .Pp
431 The following command will start an emulation session based on settings in
432 the configuration file "mysession". The -v option tells gxemul to be
433 verbose.
434 .Pp
435 .Dl "gxemul -v @mysession"
436 .Pp
437 If you have compiled the small Hello World program mentioned in the
438 .Nm
439 documentation, the following command will start up an
440 emulated test machine in "paused" mode:
441 .Pp
442 .Dl "gxemul -E testmips -V hello_mips"
443 .Pp
444 Paused mode means that you enter the interactive single-step debugger
445 directly at startup, instead of launching the Hello World program.
446 .Pp
447 The paused mode is also what should be used when running "unknown" files
448 for the first time in the emulator. E.g. if you have a binary which you
449 think is some kind of MIPS ROM image, then you can try the following:
450 .Pp
451 .Dl "gxemul -vv -E baremips -V 0xbfc00000:image.raw"
452 .Pp
453 You can then use the single-stepping functionality of the built-in
454 debugger to run the code in the ROM image, to see how it behaves. Based on
455 that, you can deduce what machine type it was actually from (the
456 baremips machine is not a real machine), and perhaps try again with
457 another emulation mode.
458 .Pp
459 In general, however, real ROM images require much more emulation detail
460 than GXemul provides, so they can usually not run.
461 .Pp
462 Please read the documentation for more details.
463 .Sh BUGS
464 There are many bugs. Some of the known bugs are mentioned in the TODO
465 file in the
466 .Nm
467 source distribution, some are marked as TODO in the source code itself.
468 .Pp
469 Userland (syscall-only) emulation, i.e. running a userland binary directly
470 without simulating an entire machine, doesn't really work yet.
471 .Pp
472 The documentation sometimes only reflects the way things worked with
473 the old MIPS emulation mode (prior to 0.4.0), and it is incorrect when
474 applied to current releases.
475 .Pp
476 .Nm
477 is in general not cycle-accurate; it does not simulate individual
478 pipe-line stages or penalties caused by branch-prediction misses or
479 cache misses, so it cannot be used for accurate simulation of any actual
480 real-world processor.
481 .Pp
482 .Nm
483 is in general not timing-accurate. Some emulation modes
484 (DECstation, CATS, NetWinder, MobilePro (hpcmips), Malta (evbmips),
485 Cobalt, Algor, and Dreamcast) try to make the guest
486 operating system's clock run at the same speed as the host clock.
487 However, the number of instructions executed per clock tick can
488 obviously vary, depending on the current CPU load on the host.
489 .Sh AUTHOR
490 GXemul is Copyright (C) 2003-2006 Anders Gavare <anders@gavare.se>
491 .Pp
492 See http://gavare.se/gxemul/ for more information. For other Copyright
493 messages, see the corresponding parts of the source code and/or
494 documentation.

  ViewVC Help
Powered by ViewVC 1.1.26