13 |
|
|
14 |
<!-- |
<!-- |
15 |
|
|
16 |
$Id: intro.html,v 1.40 2005/04/27 15:22:17 debug Exp $ |
$Id: intro.html,v 1.46 2005/06/04 12:02:17 debug Exp $ |
17 |
|
|
18 |
Copyright (C) 2003-2005 Anders Gavare. All rights reserved. |
Copyright (C) 2003-2005 Anders Gavare. All rights reserved. |
19 |
|
|
52 |
<li><a href="#overview">Overview</a> |
<li><a href="#overview">Overview</a> |
53 |
<li><a href="#free">Is GXemul Free software?</a> |
<li><a href="#free">Is GXemul Free software?</a> |
54 |
<li><a href="#build">How to compile/build the emulator</a> |
<li><a href="#build">How to compile/build the emulator</a> |
55 |
|
<li><a href="#run">How to run the emulator</a> |
56 |
<li><a href="#cpus">Which CPU types does GXemul emulate?</a> |
<li><a href="#cpus">Which CPU types does GXemul emulate?</a> |
57 |
<li><a href="#accuracy">Emulation accuracy</a> |
<li><a href="#accuracy">Emulation accuracy</a> |
58 |
<li><a href="#emulmodes">Which machines does GXemul emulate?</a> |
<li><a href="#emulmodes">Which machines does GXemul emulate?</a> |
74 |
systems run as if they were running on a real machine. |
systems run as if they were running on a real machine. |
75 |
|
|
76 |
<p> |
<p> |
77 |
It is important to keep in mind that devices and CPUs are not simulated |
Devices and CPUs are not simulated with 100% accuracy. They are only |
78 |
with 100% accuracy. They are only "faked" well enough to make operating |
"faked" well enough to make operating systems (eg NetBSD) run without |
79 |
systems (eg NetBSD) run. Still, the emulator could be of interest for |
complaining too much. Still, the emulator could be of interest for |
80 |
academic research and experiments, such as when learning how to write |
academic research and experiments, such as when learning how to write |
81 |
operating system code. |
operating system code. |
82 |
|
|
83 |
<p> |
<p> |
86 |
systems. If it doesn't, then that is a bug. |
systems. If it doesn't, then that is a bug. |
87 |
(You do not need any MIPS compiler toolchain to build or use GXemul. |
(You do not need any MIPS compiler toolchain to build or use GXemul. |
88 |
If you need to compile MIPS binaries from sources, then of course you need |
If you need to compile MIPS binaries from sources, then of course you need |
89 |
such a toolchain, but that is completely separate from GXemul. There |
such a toolchain, but that is completely separate from GXemul.) |
|
is a <a href="technical.html#regtest">regression testing</a> framework, |
|
|
which requires that a GNU CC for mips64-unknown-elf or similar is available. |
|
|
For simply building and using the emulator, it is not required.) |
|
90 |
|
|
91 |
<p> |
<p> |
92 |
The emulator contains code which tries to emulate the workings of CPUs and |
The emulator contains code which tries to emulate the workings of CPUs and |
99 |
You can use pre-compiled kernels (for example NetBSD kernels, or Linux), |
You can use pre-compiled kernels (for example NetBSD kernels, or Linux), |
100 |
or other programs that are in binary format, and in some cases even actual |
or other programs that are in binary format, and in some cases even actual |
101 |
ROM images. A couple of different file formats are supported (ELF, a.out, |
ROM images. A couple of different file formats are supported (ELF, a.out, |
102 |
ECOFF, SREC, raw binaries). |
ECOFF, SREC, and raw binaries). |
103 |
|
|
104 |
|
<p> |
105 |
|
If you do not have a kernel as a separate file, but you have a bootable |
106 |
|
disk image, then it is sometimes possible to boot directly from that |
107 |
|
image. (This works for example with DECstation emulation, or when booting |
108 |
|
from ISO9660 CDROM images.) |
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
116 |
<a name="free"></a> |
<a name="free"></a> |
117 |
<h3>Is GXemul Free software?</h3> |
<h3>Is GXemul Free software?</h3> |
118 |
|
|
119 |
Yes. I have released GXemul under a Free license. |
Yes. I have released GXemul under a Free license. The code in GXemul is |
120 |
(For a definitions of the four freedoms associated with Free software, |
Copyrighted software, it is <i>not</i> public domain. (If this is |
121 |
please read <a href="http://www.gnu.org/philosophy/free-sw.html"> |
confusing to you, you might want to read up on the definitions of the |
122 |
http://www.gnu.org/philosophy/free-sw.html</a>.) |
four freedoms associated with Free software, <a |
123 |
|
href="http://www.gnu.org/philosophy/free-sw.html">http://www.gnu.org/philosophy/free-sw.html</a>.) |
|
<p> |
|
|
The code in GXemul is Copyrighted software, it is <i>not</i> public |
|
|
domain or anything like that. |
|
124 |
|
|
125 |
<p> |
<p> |
126 |
The code I have written is released under a 3-clause BSD-style license |
The code I have written is released under a 3-clause BSD-style license |
173 |
</pre> |
</pre> |
174 |
|
|
175 |
<p> |
<p> |
176 |
Run <b>./configure --help</b> to get a list of configure options. (The |
Run <b><tt>./configure --help</tt></b> to get a list of configure options. (The |
177 |
possible options differ between different releases and snapshots.) |
possible options differ between different releases and snapshots.) |
178 |
|
|
179 |
<p> |
|
180 |
|
|
181 |
|
|
182 |
|
|
183 |
|
|
184 |
|
<p><br> |
185 |
|
<a name="run"></a> |
186 |
|
<h3>How to run the emulator:</h3> |
187 |
|
|
188 |
Once you have built GXemul, running it should be rather straight-forward. |
Once you have built GXemul, running it should be rather straight-forward. |
189 |
|
Running <tt><b>gxemul</b></tt> without arguments (or with the |
190 |
|
<b><tt>-h</tt></b> or <b><tt>-H</tt></b> command line options) will |
191 |
|
display a help message. |
192 |
|
|
193 |
|
<p> |
194 |
|
To get some ideas about what is possible to run in the emulator, please |
195 |
|
read the section about <a href="guestoses.html">installing "guest" |
196 |
|
operating systems</a>. If you are interested in using the emulator to |
197 |
|
develop code on your own, then you should also read the section about |
198 |
|
<a href="experiments.html#hello">Hello World</a>. |
199 |
|
|
200 |
|
<p> |
201 |
To exit the emulator, type CTRL-C to enter the |
To exit the emulator, type CTRL-C to enter the |
202 |
single-step debugger, and then type <b>quit</b>. |
single-step debugger, and then type <tt><b>quit</b></tt>. |
203 |
|
|
204 |
<p> |
<p> |
205 |
If you are starting an emulation by entering settings directly on the |
If you are starting an emulation by entering settings directly on the |
206 |
command line, and you are not using the <b>-x</b> option, then all |
command line, and you are not using the <tt><b>-x</b></tt> option, then all |
207 |
terminal input and output will go to the main controlling terminal. |
terminal input and output will go to the main controlling terminal. |
208 |
CTRL-C is used to break into the debugger, so in order to send CTRL-C to |
CTRL-C is used to break into the debugger, so in order to send CTRL-C to |
209 |
the running (emulated) program, you may use CTRL-B. |
the running (emulated) program, you may use CTRL-B. |
210 |
|
(This should be a reasonable compromise to allow the emulator to be usable |
211 |
|
even on systems without X Windows.) |
212 |
|
|
213 |
<p> |
<p> |
214 |
(This is an ugly hack; there is no way to send an actual CTRL-B to the |
There is no way to send an actual CTRL-B to the emulated program, when |
215 |
emulated program, when typing in the main controlling terminal window. |
typing in the main controlling terminal window. The solution is to either |
216 |
The solution is to either use configuration files, or use <b>-x</b>. Both |
use <a href="configfiles.html">configuration files</a>, or use |
217 |
these solutions cause new xterms to be opened for each emulated serial |
<tt><b>-x</b></tt>. Both these solutions cause new xterms to be opened for |
218 |
port. CTRL-B and CTRL-C both have their original meaning in those |
each emulated serial port that is written to. CTRL-B and CTRL-C both have |
219 |
xterm windows.) |
their original meaning in those xterm windows. |
|
|
|
220 |
|
|
221 |
|
|
222 |
|
|
228 |
|
|
229 |
<h4>MIPS:</h4> |
<h4>MIPS:</h4> |
230 |
|
|
231 |
Emulation of R4000, which is a 64-bit CPU, was my initial goal. Right |
Emulation of R4000, which is a 64-bit CPU, was my initial goal. |
232 |
now, R2000/R3000-like CPUs are also emulated (32-bit), and emulation of |
R2000/R3000-like CPUs (32-bit), R1x000, and generic MIPS32/MIPS64-style |
233 |
R1x000 (at least the parts that are similar to R4000) is beginning to work |
CPUs are also emulated, and are hopefully almost as stable as the R4000 |
234 |
as expected. Code targeted for MIPS32 and MIPS64 also often work. |
emulation. |
235 |
|
|
236 |
<p> |
<p> |
237 |
I have written an experimental dynamic binary translation subsystem. |
I have written an experimental dynamic binary translation subsystem. |
240 |
the command line, but keep in mind that it is still experimental.) |
the command line, but keep in mind that it is still experimental.) |
241 |
|
|
242 |
|
|
|
|
|
243 |
<h4>URISC:</h4> |
<h4>URISC:</h4> |
244 |
|
|
245 |
I have implemented an <a href="http://en.wikipedia.org/wiki/URISC">URISC</a> |
I have implemented an <a href="http://en.wikipedia.org/wiki/URISC">URISC</a> |
250 |
performance.) |
performance.) |
251 |
|
|
252 |
|
|
253 |
|
<h4>POWER/PowerPC</h4> |
254 |
|
|
255 |
|
There is some code for 64-bit (and 32-bit) POWER/PowerPC emulation, enough |
256 |
|
to run "Hello World", but not enough to run complete operating systems. |
257 |
|
This mode isn't really working yet. |
258 |
|
|
259 |
|
|
260 |
<h4>Other CPU types:</h4> |
<h4>Other CPU types:</h4> |
261 |
|
|
262 |
There is some code for 64-bit (and 32-bit) POWER/PowerPC emulation too, |
Some other CPU architectures (such as x86) can also be partially emulated. |
263 |
but it only works for "Hello World" and similarly trivial programs. (There |
These are not enabled by default though, because of their unstable-ness. |
|
are some other CPU modes too, but they are working even less.) |
|
264 |
|
|
265 |
|
|
266 |
|
|
270 |
<a name="accuracy"></a> |
<a name="accuracy"></a> |
271 |
<h3>Emulation accuracy:</h3> |
<h3>Emulation accuracy:</h3> |
272 |
|
|
273 |
GXemul is an instruction-level simulator; things that would happen in |
GXemul is an instruction-level emulator; things that would happen in |
274 |
several steps within a real CPU are not taken into account (eg. pipe-line |
several steps within a real CPU are not taken into account (eg. pipe-line |
275 |
stages or out-of-order execution). Still, instruction-level accuracy seems |
stalls or out-of-order execution). Still, instruction-level accuracy seems |
276 |
to be enough to be able to run complete guest operating systems inside the |
to be enough to be able to run complete guest operating systems inside the |
277 |
emulator. |
emulator. |
278 |
|
|
279 |
|
<p> |
280 |
|
Caches are by default not emulated. In some cases, the existance of caches |
281 |
|
is "faked" to let operating systems think that they are there. (There is |
282 |
|
some old code for R2000/R3000 caches, but it has probably suffered from |
283 |
|
bitrot by now.) |
284 |
|
|
285 |
|
<p> |
286 |
|
The emulator is <i>not</i> timing-accurate. It can be run in a |
287 |
|
"deterministic" mode, <tt><b>-D</b></tt>. The meaning of deterministic is |
288 |
|
simply that running two emulations with the same settings will result in |
289 |
|
identical runs. Obviously, this requires that no user interaction is |
290 |
|
taking place, and that clock speeds are fixed with the <tt><b>-I</b></tt> |
291 |
|
option. (Deterministic in this case does <i>not</i> mean that the emulation |
292 |
|
will be identical to some actual real-world machine.) |
293 |
|
|
294 |
|
|
295 |
|
|
296 |
|
|
363 |
<center><table border="0"> |
<center><table border="0"> |
364 |
<tr> |
<tr> |
365 |
<td width="10"></td> |
<td width="10"></td> |
366 |
<td align="center"><a href="netbsd-pmax-20040630.png"><img src="netbsd-pmax-20040630_small.png"></a></td> |
<td align="center"><a href="20050317-example.png"><img src="20050317-example_small.png"></a></td> |
367 |
<td width="15"></td> |
<td width="15"></td> |
368 |
<td><a href="http://www.netbsd.org/Ports/pmax/">NetBSD/pmax</a> |
<td><a href="http://www.netbsd.org/Ports/pmax/">NetBSD/pmax</a> |
369 |
<br>DECstation 5000/200</td> |
<br>DECstation 5000/200</td> |