/[gxemul]/trunk/doc/intro.html
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/doc/intro.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 12 by dpavlin, Mon Oct 8 16:18:38 2007 UTC revision 40 by dpavlin, Mon Oct 8 16:22:11 2007 UTC
# Line 4  Line 4 
4  <table border=0 width=100% bgcolor="#d0d0d0"><tr>  <table border=0 width=100% bgcolor="#d0d0d0"><tr>
5  <td width=100% align=center valign=center><table border=0 width=100%><tr>  <td width=100% align=center valign=center><table border=0 width=100%><tr>
6  <td align="left" valign=center bgcolor="#d0efff"><font color="#6060e0" size="6">  <td align="left" valign=center bgcolor="#d0efff"><font color="#6060e0" size="6">
7  <b>Gavare's eXperimental Emulator:&nbsp;&nbsp;&nbsp;</b></font>  <b>Gavare's eXperimental Emulator:</b></font><br>
8  <font color="#000000" size="6"><b>Introduction</b>  <font color="#000000" size="6"><b>Introduction</b>
9  </font></td></tr></table></td></tr></table><p>  </font></td></tr></table></td></tr></table><p>
10    
11  <!--  <!--
12    
13  $Id: intro.html,v 1.61 2005/08/16 05:15:24 debug Exp $  $Id: intro.html,v 1.110 2007/04/28 00:12:03 debug Exp $
14    
15  Copyright (C) 2003-2005  Anders Gavare.  All rights reserved.  Copyright (C) 2003-2007  Anders Gavare.  All rights reserved.
16    
17  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
18  modification, are permitted provided that the following conditions are met:  modification, are permitted provided that the following conditions are met:
# Line 45  SUCH DAMAGE. Line 45  SUCH DAMAGE.
45  <h2>Introduction</h2>  <h2>Introduction</h2>
46    
47  <p>  <p>
48    <table border="0" width="99%"><tr><td valign="top" align="left">
49  <ul>  <ul>
50    <li><a href="#overview">Overview</a>    <li><a href="#overview">Overview</a>
51    <li><a href="#free">Is GXemul Free software?</a>    <li><a href="#free">Is GXemul Free software?</a>
52    <li><a href="#build">How to compile/build the emulator</a>    <li><a href="#build">How to compile/build the emulator</a>
53    <li><a href="#run">How to run the emulator</a>    <li><a href="#run">How to run the emulator</a>
54    <li><a href="#cpus">Which CPU types does GXemul emulate?</a>    <li><a href="#cpus">Which processor architectures does GXemul emulate?</a>
55      <li><a href="#hosts">Which host architectures are supported?</a>
56    <li><a href="#accuracy">Emulation accuracy</a>    <li><a href="#accuracy">Emulation accuracy</a>
57    <li><a href="#emulmodes">Which machines does GXemul emulate?</a>    <li><a href="#emulmodes">Which machines does GXemul emulate?</a>
   <li><a href="#guestos">Which guest OSes are possible to run in GXemul?</a>  
58  </ul>  </ul>
59    </td><td valign="center" align="center">
60    <a href="20050317-example.png"><img src="20050317-example_small.png"></a>
61    <p>NetBSD/pmax 1.6.2 with X11<br>running in GXemul</td></tr></table>
62    
63    
64    
# Line 64  SUCH DAMAGE. Line 67  SUCH DAMAGE.
67  <a name="overview"></a>  <a name="overview"></a>
68  <h3>Overview:</h3>  <h3>Overview:</h3>
69    
70  GXemul is an experimental instruction-level machine emulator. It can be  GXemul is an experimental instruction-level machine emulator. Several
71  used to run binary code for MIPS-based machines, regardless of host  emulation modes are available. In some modes, processors and surrounding
72  platform. Several emulation modes are available. For some modes,  hardware components are emulated well enough to let unmodified operating
73  processors and surrounding hardware components are emulated well enough to  systems (e.g. NetBSD) run as if they were running on a real machine.
74  let unmodified operating systems run as if they were running on a real  
75  machine.  <p>Devices and processors are not simulated with 100% accuracy. They are
76    only ``faked'' well enough to allow guest operating systems to run without
77  <p>(Non-MIPS emulation modes are also under development, but so far none  complaining too much. Still, the emulator could be of interest for
78  of those modes has reached the completeness required to run unmodified  academic research and experiments, such as when learning how to write
 operating systems.)  
   
 <p>Devices and CPUs are not simulated with 100% accuracy. They are only  
 ``faked'' well enough to make operating systems (e.g. NetBSD) run without  
 complaining too much. Still, the emulator could be of interest for  
 academic research and experiments, such as when learning how to write  
79  operating system code.  operating system code.
80    
81  <p>The emulator is written in C, does not depend on external libraries  <p>The emulator is written in C, does not depend on third-party libraries,
82  (except X11, but that is optional), and should compile and run on most  and should compile and run on most 64-bit and 32-bit Unix-like systems.
 Unix-like systems. If it doesn't, then that is a bug.  
83    
84  <p>The emulator contains code which tries to emulate the workings of CPUs  <p>The emulator contains code which tries to emulate the workings of CPUs
85  and surrounding hardware found in real machines, but it does not contain  and surrounding hardware found in real machines, but it does not contain
# Line 98  even actual ROM images. A couple of diff Line 94  even actual ROM images. A couple of diff
94    
95  <p>If you do not have a kernel as a separate file, but you have a bootable  <p>If you do not have a kernel as a separate file, but you have a bootable
96  disk image, then it is sometimes possible to boot directly from that  disk image, then it is sometimes possible to boot directly from that
97  image. (This works for example with DECstation emulation, or when booting  image. (This works for example with DECstation emulation, Dreamcast
98  from ISO9660 CDROM images.)  emulation, or when booting from generic ISO9660 CDROM images if the
99    kernel is included in the image as a plain file.)
100    
101    <p>Thanks to (in no specific order) Joachim Buss, Olivier Houchard, Juli
102    Mallett, Juan Romero Pardines, Carl van Schaik, Alec Voropay, Göran
103    Weinholt, Alexander Yurchenko, and everyone else who has provided me with
104    feedback.
105    
106    
107    
# Line 136  without source code. You need to check a Line 137  without source code. You need to check a
137  The "easiest way out" if you plan to redistribute code from GXemul is, of  The "easiest way out" if you plan to redistribute code from GXemul is, of
138  course, to let it remain open source and simply supply the source code.  course, to let it remain open source and simply supply the source code.
139    
140  <p>(If a stable release of GXemul is packaged into binary form, and it is  <p>In case you want to reuse parts of GXemul, but you need to do that
141  obvious which version of GXemul was used to build the package, then it can  under a different license (e.g. the GPL), then contact me and I might
142  be argued that the source code is available, just not in that specific  re-license/dual-license files on a case-by-case basis.
 package. Common sense should be used in this case, and not pedanticism.)  
   
   
143    
144    
145    
# Line 157  Uncompress the .tar.gz distribution file Line 155  Uncompress the .tar.gz distribution file
155          $ <b>make</b>          $ <b>make</b>
156  </pre>  </pre>
157    
158  <p>This should work on most Unix-like systems. If it doesn't, then  <p>This should work on most Unix-like systems. GXemul does not require any
159  mail me a bug report.  specific libraries to build, however, if you build on a system which does
160    not have X11 libraries installed, some functionality will be lost.
161    
162  <p>The emulator's performance is highly dependent on both runtime settings  <p>The emulator's performance is highly dependent on both runtime settings
163  and on compiler settings, so you might want to experiment with different  and on compiler settings, so you might want to experiment with different
164  CC and CFLAGS environment variable values. For example, on a modern PC,  CC and CFLAGS environment variable values. For example, on an AMD Athlon
165  you could try the following:  host, you might want to try setting <tt>CFLAGS</tt> to <tt>-march=athlon</tt>
166  <p><pre>  before running <tt>configure</tt>.
         $ <b>CFLAGS="-mcpu=pentium4 -O3" ./configure</b>  
         $ <b>make</b>  
 </pre>  
167    
168    
169    
# Line 218  their original meaning in those xterm wi Line 214  their original meaning in those xterm wi
214    
215  <p><br>  <p><br>
216  <a name="cpus"></a>  <a name="cpus"></a>
217  <h3>Which CPU types does GXemul emulate?</h3>  <h3>Which processor architectures does GXemul emulate?</h3>
218    
219  <h4>MIPS:</h4>  The architectures that are emulated well enough to let at least one
220    guest operating system run (per architecture) are ARM, MIPS, PowerPC,
221    and SuperH.
222    
223    <p>Please read the page about <a href="guestoses.html">guest operating
224    systems</a> for more information about the machines and operating systems
225    that can be considered "working" in the emulator.
226    
 Emulation of R4000, which is a 64-bit CPU, was my initial goal.  
 R2000/R3000-like CPUs (32-bit), R1x000, and generic MIPS32/MIPS64-style  
 CPUs are also emulated, and are hopefully almost as stable as the R4000  
 emulation.  
227    
 <p>I have written an experimental dynamic binary translation subsystem.  
 This gives higher total performance than interpreting one instruction at a  
 time and executing it. (If you wish to disable bintrans, add <b>-B</b> to  
 the command line.)  
228    
229    
 <h4>Other CPU types:</h4>  
230    
 Some other CPU architectures can also be partially emulated. These are not  
 working well enough yet to run guest operating systems.  
231    
232    <p><br>
233    <a name="hosts"></a>
234    <h3>Which host architectures are supported?</h3>
235    
236    GXemul should compile and run on any modern host architecture (64-bit or
237    32-bit word-length).
238    
239    <p>Note: The <a href="translation.html">dynamic translation</a> engine
240    does <i>not</i> require backends for native code generation to be written
241    for each individual host architecture; the intermediate representation
242    that the dyntrans system uses can be executed on any host architecture.
243    
244    
245    
# Line 248  working well enough yet to run guest ope Line 250  working well enough yet to run guest ope
250  <h3>Emulation accuracy:</h3>  <h3>Emulation accuracy:</h3>
251    
252  GXemul is an instruction-level emulator; things that would happen in  GXemul is an instruction-level emulator; things that would happen in
253  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 (e.g. pipe-line
254  stalls or out-of-order execution). Still, instruction-level accuracy seems  stalls or out-of-order execution). Still, instruction-level accuracy seems
255  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
256  emulator.  emulator.
257    
258  <p>Caches are by default not emulated. In some cases, the existance of  <p>The existance of instruction and data caches is "faked" to let
259  caches is "faked" to let operating systems think that they are there.  operating systems think that they are there, but for all practical
260  (There is some old code for R2000/R3000 caches, but it has probably  purposes, these caches are non-working.
261  suffered from bitrot by now.)  
262    <p>The emulator is in general <i>not</i> timing-accurate, neither at the
263  <p>The emulator is <i>not</i> timing-accurate. It can be run in a  instruction level nor on any higher level. An attempt is made to let
264  "deterministic" mode, <tt><b>-D</b></tt>. The meaning of deterministic is  emulated clocks run at the same speed as the host (i.e. an emulated timer
265  simply that running two emulations with the same settings will result in  running at 100 Hz will interrupt around 100 times per real second), but
266  identical runs. Obviously, this requires that no user interaction is  since the host speed may vary, e.g. because of other running processes,
267  taking place, and that clock speeds are fixed with the <tt><b>-I</b></tt>  there is no guarantee as to how many instructions will be executed in
268  option. (Deterministic in this case does <i>not</i> mean that the  each of these 100 Hz cycles.
269  emulation will be identical to some actual real-world machine.)  
270    <p>If the host is very slow, the emulated clocks might even lag behind
271    the real-world clock.
272    
273    
274    
275    
# Line 279  are emulated well enough to run at least Line 284  are emulated well enough to run at least
284    
285  <p>  <p>
286  <ul>  <ul>
287    <li><b>DECstation 5000/200</b>&nbsp;&nbsp;("3max")    <li><b><u>ARM</u></b>
288          <br>Serial controller (including keyboard and mouse), ethernet,    <ul>
289          SCSI, and graphical framebuffers.      <li><b>CATS</b> (<a href="guestoses.html#netbsdcatsinstall">NetBSD/cats</a>,
290    <p>          <a href="guestoses.html#openbsdcatsinstall">OpenBSD/cats</a>)
291    <li><b>Acer Pica-61</b>&nbsp;&nbsp;(an ARC machine)      <li><b>IQ80321</b> (<a href="guestoses.html#netbsdevbarminstall">NetBSD/evbarm</a>)
292          <br>Serial controller, "VGA" text console, and SCSI.      <li><b>NetWinder</b> (<a href="guestoses.html#netbsdnetwinderinstall">NetBSD/netwinder</a>)
293      </ul>
294    <p>    <p>
295    <li><b>NEC MobilePro 770, 780, 800, and 880</b>&nbsp;&nbsp;(HPCmips machines)    <li><b><u>MIPS</u></b>
296          <br>Framebuffer, keyboard, and a PCMCIA IDE controller.    <ul>
297        <li><b>DECstation 5000/200</b> (<a href="guestoses.html#netbsdpmaxinstall">NetBSD/pmax</a>,
298            <a href="guestoses.html#openbsdpmaxinstall">OpenBSD/pmax</a>,
299            <a href="guestoses.html#ultrixinstall">Ultrix</a>,
300            <a href="guestoses.html#declinux">Linux/DECstation</a>,
301            <a href="guestoses.html#sprite">Sprite</a>)
302        <li><b>Acer Pica-61</b> (<a href="guestoses.html#netbsdarcinstall">NetBSD/arc</a>)
303        <li><b>NEC MobilePro 770, 780, 800, 880</b> (<a href="guestoses.html#netbsdhpcmipsinstall">NetBSD/hpcmips</a>)
304        <li><b>Cobalt</b> (<a href="guestoses.html#netbsdcobaltinstall">NetBSD/cobalt</a>)
305        <li><b>Malta</b> (<a href="guestoses.html#netbsdevbmipsinstall">NetBSD/evbmips</a>, Linux/Malta <font color="#0000e0">(<super>*1</super>)</font>)
306        <li><b>Algorithmics P5064</b> (<a href="guestoses.html#netbsdalgorinstall">NetBSD/algor</a>)
307        <li><b>SGI O2 (aka IP32)</b> <font color="#0000e0">(<super>*2</super>)</font>
308            (<a href="guestoses.html#netbsdsgimips">NetBSD/sgi</a>)
309      </ul>
310    <p>    <p>
311    <li><b>Cobalt</b>    <li><b><u>PowerPC</u></b>
312          <br>Serial controller and PCI IDE.    <ul>
313        <li><b>IBM 6050/6070 (PReP, PowerPC Reference Platform)</b> (<a href="guestoses.html#netbsdprepinstall">NetBSD/prep</a>)
314        <li><b>MacPPC (generic "G4" Macintosh)</b> (<a href="guestoses.html#netbsdmacppcinstall">NetBSD/macppc</a>)
315      </ul>
316    <p>    <p>
317    <li><b>Malta (evbmips)</b>    <li><b><u>SuperH</u></b>
318          <br>Serial controller and PCI IDE.    <ul>
319    <p>      <li><b>Sega Dreamcast</b> (<a href="dreamcast.html#netbsd_generic_md">NetBSD/dreamcast</a>, <a href="dreamcast.html#linux_live_cd">Linux/dreamcast</a>)
320    <li><b>SGI O2 ("IP32")</b>      <li><b>Landisk</b> (<a href="guestoses.html#openbsdlandiskinstall">OpenBSD/landisk</a>)
321          <br>Serial controller and ethernet.&nbsp;&nbsp;<small>(Enough for    </ul>
         root-on-nfs, but not for disk boot.)</small>  
322  </ul>  </ul>
323    
324    <p>
325    <small><font color="#0000e0">(<super>*1</super>)</font> =
326    Linux/Malta may be run as a guest OS, however I have not yet found any stable
327    URL to pre-compiled Linux/Malta kernels. Thus, Linux/Malta emulation is not
328    tested for every release of the emulator; sometimes it works, sometimes
329    it doesn't.</small>
330    
331    <br><small><font color="#0000e0">(<super>*2</super>)</font> =
332    SGI O2 emulation is enough for root-on-nfs, but not for disk boot.</small>
333    
334    
335  <p>There is code in GXemul for emulation of many other machine types; the  <p>There is code in GXemul for emulation of many other machine types; the
336  degree to which these work range from almost being able to run a complete  degree to which these work range from almost being able to run a complete
337  OS, to almost completely unsupported (perhaps just enough support to  OS, to almost completely unsupported (perhaps just enough support to
# Line 314  such as: Line 346  such as:
346    <li>a console I/O device (putchar() and getchar()...)    <li>a console I/O device (putchar() and getchar()...)
347    <li>an inter-processor communication device, for SMP experiments    <li>an inter-processor communication device, for SMP experiments
348    <li>a very simple linear framebuffer device (for graphics output)    <li>a very simple linear framebuffer device (for graphics output)
349    <li>a simple SCSI disk controller    <li>a simple disk controller
350    <li>a simple ethernet controller    <li>a simple ethernet controller
351      <li>a real-time clock device
352  </ul>  </ul>
353    
354  <p>This mode is useful if you wish to run experimental code, but do not  <p>This mode is useful if you wish to run experimental code, but do not
# Line 330  href="experiments.html#expdevices">here< Line 363  href="experiments.html#expdevices">here<
363    
364    
365    
   
 <p><br>  
 <a name="guestos"></a>  
 <h3>Which guest OSes are possible to run in GXemul?</h3>  
   
 This table lists the guest OSes that run well enough to be considered  
 working in the emulator. They can boot from a harddisk image and be  
 interacted with similar to a real machine.  
   
 <p>  
 <center><table border="0">  
         <tr>  
           <td width="10"></td>  
           <td align="center"><a href="20050317-example.png"><img src="20050317-example_small.png"></a></td>  
           <td width="15"></td>  
           <td><a href="http://www.netbsd.org/Ports/pmax/">NetBSD/pmax</a>  
                 <br>DECstation 5000/200</td>  
           <td width="30"></td>  
           <td align="center"><a href="20041024-netbsd-arc-installed.gif"><img src="20041024-netbsd-arc-installed_small.gif"></a></td>  
           <td width="15"></td>  
           <td><a href="http://www.netbsd.org/Ports/arc/">NetBSD/arc</a>  
                 <br>Acer Pica-61</td>  
   
         </tr>  
   
         <tr><td height="10"></td></tr>  
   
         <tr>  
           <td></td>  
           <td align="center"><a href="openbsd-pmax-20040710.png"><img src="openbsd-pmax-20040710_small.png"></a></td>  
           <td></td>  
           <td><a href="http://www.openbsd.org/pmax.html">OpenBSD/pmax</a>  
                 <br>DECstation 5000/200</td>  
           <td></td>  
           <td align="center"><a href="20041024-openbsd-arc-installed.gif"><img src="20041024-openbsd-arc-installed_small.gif"></a></td>  
           <td></td>  
           <td><a href="http://www.openbsd.org/arc.html">OpenBSD/arc</a>  
                 <br>Acer Pica-61</td>  
         </tr>  
   
         <tr><td height="10"></td></tr>  
   
         <tr>  
           <td></td>  
           <td align="center"><a href="ultrix4.5-20040706.png"><img src="ultrix4.5-20040706_small.gif"></a></td>  
           <td></td>  
           <td>Ultrix/RISC<br>DECstation 5000/200</td>  
           <td></td>  
           <td align="center"><a href="20041213-debian_4.png"><img src="20041213-debian_4_small.gif"></a></td>  
           <td></td>  
           <td><a href="http://www.debian.org/">Debian&nbsp;GNU/Linux</a>&nbsp;<super>*</super>  
                 <br>DECstation 5000/200</td>  
         </tr>  
   
         <tr><td height="10"></td></tr>  
   
         <tr>  
           <td></td>  
           <td align="center"><a href="sprite-20040711.png"><img src="sprite-20040711_small.png"></a></td>  
           <td></td>  
           <td><a href="http://www.cs.berkeley.edu/projects/sprite/retrospective.html">Sprite</a>  
                 <br>DECstation 5000/200</td>  
           <td></td>  
           <td align="center"><a href="20041129-redhat_mips.png"><img src="20041129-redhat_mips_small.png"></a></td>  
           <td></td>  
           <td>Redhat&nbsp;Linux&nbsp;<super>*</super>  
                 <br>DECstation 5000/200</td>  
         </tr>  
   
         <tr><td height="10"></td></tr>  
   
         <tr>  
           <td></td>  
           <td align="center"><a href="20050427-netbsd-hpcmips-2.png"><img src="20050427-netbsd-hpcmips-2_small.png"></a></td>  
           <td></td>  
           <td><a href="http://www.netbsd.org/Ports/hpcmips/">NetBSD/hpcmips</a>  
                 <br>NEC MobilePro 770, 780, 800, 880</td>  
           <td></td>  
           <td align="center"><a href="20050413-netbsd-cobalt.png"><img src="20050413-netbsd-cobalt_small.png"></a></td>  
           <td></td>  
           <td><a href="http://www.netbsd.org/Ports/cobalt/">NetBSD/cobalt</a>  
                 <br>Cobalt</td>  
         </tr>  
   
         <tr><td height="10"></td></tr>  
   
         <tr>  
           <td></td>  
           <td align="center"><a href="20050626-netbsd-sgimips-netboot.png"><img src="20050626-netbsd-sgimips-netboot_small.png"></a></td>  
           <td></td>  
           <td><a href="http://www.netbsd.org/Ports/sgimips/">NetBSD/sgimips</a>  
                 <br>SGI O2 ("IP32")</td>  
           <td></td>  
           <td align="center"><a href="20050622-netbsd-evbmips-malta.png"><img src="20050622-netbsd-evbmips-malta_small.png"></a></td>  
           <td></td>  
           <td><a href="http://www.netbsd.org/Ports/evbmips/">NetBSD/evbmips</a>  
                 <br>5Kc (and 4Kc) Malta<br>evaluation boards</td>  
           <td></td>  
         </tr>  
   
 </table></center>  
   
   
 <p><br>  
   
 <super>*</super> Although Linux runs under DECstation emulation, the  
 default 2.4.27 kernel in Debian GNU/Linux does not support keyboards on  
 the 5000/200 (the specific DECstation model being emulated), so when the  
 login prompt is reached you cannot interact with the system. Kaj-Michael  
 Lang has compiled and made available a newer kernel from the current  
 mips-linux development tree. You can find it here: <a  
 href="http://home.tal.org/~milang/o2/kernels/">http://home.tal.org/~milang/o2/kernels</a>/<a  
 href="http://home.tal.org/~milang/o2/kernels/vmlinux-2.4.29-rc2-r3k-mipsel-decstation">vmlinux-2.4.29-rc2-r3k-mipsel-decstation</a>  
 This newer kernel supports keyboard input, but it does not have Debian's  
 ethernet patches, so you will not be able to use keyboard/framebuffer  
 <i>and</i> networking at the same time.  
   
   
366  </body>  </body>
367  </html>  </html>

Legend:
Removed from v.12  
changed lines
  Added in v.40

  ViewVC Help
Powered by ViewVC 1.1.26