/[gxemul]/trunk/doc/experiments.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/experiments.html

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

revision 10 by dpavlin, Mon Oct 8 16:18:27 2007 UTC revision 22 by dpavlin, Mon Oct 8 16:19:37 2007 UTC
# Line 1  Line 1 
1  <html>  <html><head><title>Gavare's eXperimental Emulator:&nbsp;&nbsp;&nbsp;Experimenting with GXemul</title>
2  <head><title>GXemul documentation: Experimenting with GXemul</title>  <meta name="robots" content="noarchive,nofollow,noindex"></head>
 <meta name="robots" content="noarchive,nofollow,noindex">  
 </head>  
3  <body bgcolor="#f8f8f8" text="#000000" link="#4040f0" vlink="#404040" alink="#ff0000">  <body bgcolor="#f8f8f8" text="#000000" link="#4040f0" vlink="#404040" alink="#ff0000">
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>GXemul documentation:</b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <b>Gavare's eXperimental Emulator:</b></font><br>
8  <font color="#000000" size="6"><b>Experimenting with GXemul</b>  <font color="#000000" size="6"><b>Experimenting with GXemul</b>
9  </font></td></tr></table></td></tr></table><p>  </font></td></tr></table></td></tr></table><p>
10    
11  <!--  <!--
12    
13  $Id: experiments.html,v 1.76 2005/06/24 09:33:32 debug Exp $  $Id: experiments.html,v 1.96 2006/02/18 13:15:20 debug Exp $
14    
15  Copyright (C) 2003-2005  Anders Gavare.  All rights reserved.  Copyright (C) 2003-2006  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 50  SUCH DAMAGE. Line 48  SUCH DAMAGE.
48  <ul>  <ul>
49    <li><a href="#hello">Hello world</a>    <li><a href="#hello">Hello world</a>
50    <li><a href="#expdevices">Experimental devices</a>    <li><a href="#expdevices">Experimental devices</a>
   <li><a href="#experiments">Experiments with other kernels and guest OSes</a>  
51  </ul>  </ul>
52    
53    
# Line 168  learn more about how MIPS programs run, Line 165  learn more about how MIPS programs run,
165          a800000000030038: 00021600      sll     v0,v0,24          a800000000030038: 00021600      sll     v0,v0,24
166          GXemul&gt; <b>print v0</b>          GXemul&gt; <b>print v0</b>
167          v0 = 0x0000000048000000          v0 = 0x0000000048000000
168          GXemul&gt; <b><blink>_</blink></b>          GXemul&gt; <b>_</b>
169  </pre>  </pre>
170    
171  <p>  <p>The syntax of the single-step debugger shouldn't be too hard to grasp.
172  The syntax of the single-step debugger shouldn't be too hard to grasp.  Type "<tt>s</tt>" to single-step one instruction. For some commands (e.g.
173  Type 's' to single-step one instruction. Just pressing enter after that  the single-step command), just pressing enter on a blank line will cause
174  will repeat the 's' command. Type 'quit' to quit.  the last command to be repeated. Type "<tt>quit</tt>" to quit.
175    
176  <p>  <p>
177  Hopefully this is enough to get you inspired. :-)  Hopefully this is enough to get you inspired. :-)
178    
179    
180    
 <p><br>  
 <h4>Hello World for GXemul's PPC mode</h4>  
   
 GXemul also has an experimental PowerPC emulation mode.  
 <a href="hello_ppc.c"><tt>hello_ppc.c</tt></a> is similar to  
 <tt>hello_mips.c</tt>, but should be compiled and run as follows:  
 <p>  
 <pre>  
         $ <b>ppc-unknown-elf-gcc -O2 hello_ppc.c -c</b>  
         $ <b>ppc-unknown-elf-ld -e f hello_ppc.o -o hello_ppc</b>  
         $ <b>file hello_ppc</b>  
         hello_ppc: ELF 32-bit MSB executable, PowerPC or cisco 4500,  
           version 1 (SYSV), statically linked, not stripped  
         $ <b>gxemul -q -E testppc hello_ppc</b>  
         Hello world  
 </pre>  
   
 <p>  
 [&nbsp;2005-02-18: I haven't yet been able to build a GCC for ppc64 (only the  
 binutils toolchain), because the gcc sources seem to include Linux header files  
 that aren't present on my FreeBSD system. 32-bit PPC works ok, though.&nbsp;]  
   
   
   
181    
182    
183    
# Line 217  It can either run in "bare" mode, where Line 190  It can either run in "bare" mode, where
190  (just the CPU), or in a "test" mode where some simple devices are  (just the CPU), or in a "test" mode where some simple devices are
191  emulated.  emulated.
192    
193  <p>  <p>The test machines (<tt>testmips</tt>, <tt>testppc</tt>, etc) have the
194  The <tt>testmips</tt> machine has the following experimental devices:  following experimental devices:
195    
196  <p>  <p>
197  <center><table border="0" width="80%">  <center><table border="0" width="80%">
198    
199    <tr>    <tr>
200      <td align="left" valign="top" width="200">      <td align="left" valign="top" width="200">
201          <b><tt>cons</tt>:</b>          <a name="expdevices_cons"><b><tt>cons</tt>:</b></a>
202          <p>This is a simple console device, for writing          <p>A simple console device, for writing
203          characters to the controlling terminal.          characters to the controlling terminal
204            and receiving keypresses.
205          <p>Source code:&nbsp;&nbsp;<font color="#0000f0"><tt>src/devices/dev_cons.c</tt></font>          <p>Source code:&nbsp;&nbsp;<font color="#0000f0"><tt>src/devices/dev_cons.c</tt></font>
206          <br>Default physical address:&nbsp&nbsp;<font color="#0000f0">0x10000000</font>          <br>Default physical address:&nbsp&nbsp;<font color="#0000f0">0x10000000</font>
207      </td>      </td>
# Line 239  The <tt>testmips</tt> machine has the fo Line 213  The <tt>testmips</tt> machine has the fo
213              <td align="left" valign="top"><i><u>Effect:</u></i></td>              <td align="left" valign="top"><i><u>Effect:</u></i></td>
214            </tr>            </tr>
215            <tr>            <tr>
216              <td align="left" valign="top">0x0000</td>              <td align="left" valign="top"><tt>0x00</tt></td>
217              <td align="left" valign="top">              <td align="left" valign="top">
218                  Read: <b><tt>getchar()</tt></b> (non-blocking)<br>                  Read: <b><tt>getchar()</tt></b> (non-blocking; returns
219                    <tt>0</tt> if no char was available)<br>
220                  Write: <b><tt>putchar(ch)</tt></b></td>                  Write: <b><tt>putchar(ch)</tt></b></td>
221            </tr>            </tr>
222            <tr>            <tr>
223              <td align="left" valign="top">0x0010</td>              <td align="left" valign="top"><tt>0x10</tt></td>
224              <td align="left" valign="top">Read or write: <b><tt>halt()</tt></b><br>              <td align="left" valign="top">Read or write: <b><tt>halt()</tt></b><br>
225                  (Useful for exiting the emulator.)</td>                  (Useful for exiting the emulator.)</td>
226            </tr>            </tr>
# Line 259  The <tt>testmips</tt> machine has the fo Line 234  The <tt>testmips</tt> machine has the fo
234    
235    <tr>    <tr>
236      <td align="left" valign="top">      <td align="left" valign="top">
237          <b><tt>mp</tt>:</b>          <a name="expdevices_mp"><b><tt>mp</tt>:</b></a>
238          <p>This device controls the behaviour of CPUs in an emulated          <p>This device controls the behaviour of CPUs in an emulated
239          multi-processor system.          multi-processor system.
240          <p>Source code:&nbsp;&nbsp;<font color="#0000f0"><tt>src/devices/dev_mp.c</tt></font>          <p>Source code:&nbsp;&nbsp;<font color="#0000f0"><tt>src/devices/dev_mp.c</tt></font>
# Line 273  The <tt>testmips</tt> machine has the fo Line 248  The <tt>testmips</tt> machine has the fo
248              <td align="left" valign="top"><i><u>Effect:</u></i></td>              <td align="left" valign="top"><i><u>Effect:</u></i></td>
249            </tr>            </tr>
250            <tr>            <tr>
251              <td align="left" valign="top">0x0000</td>              <td align="left" valign="top"><tt>0x0000</tt></td>
252              <td align="left" valign="top">Read: <b><tt>whoami()</tt></b>.              <td align="left" valign="top">Read: <b><tt>whoami()</tt></b>.
253                  Returns the id of the CPU doing the read.</td>                  Returns the id of the CPU doing the read.</td>
254            </tr>            </tr>
255            <tr>            <tr>
256              <td align="left" valign="top">0x0010</td>              <td align="left" valign="top"><tt>0x0010</tt></td>
257              <td align="left" valign="top">Read: <b><tt>ncpus()</tt></b>.              <td align="left" valign="top">Read: <b><tt>ncpus()</tt></b>.
258                  Returns the number of CPUs in the system.</td>                  Returns the number of CPUs in the system.</td>
259            </tr>            </tr>
260            <tr>            <tr>
261              <td align="left" valign="top">0x0020</td>              <td align="left" valign="top"><tt>0x0020</tt></td>
262              <td align="left" valign="top">Write: <b><tt>startupcpu(i)</tt></b>.              <td align="left" valign="top">Write: <b><tt>startupcpu(i)</tt></b>.
263                  Starts CPU i. It begins execution at the address                  Starts CPU i. It begins execution at the address
264                  set by a write to startupaddr (see below).</td>                  set by a write to startupaddr (see below).</td>
265            </tr>            </tr>
266            <tr>            <tr>
267              <td align="left" valign="top">0x0030</td>              <td align="left" valign="top"><tt>0x0030</tt></td>
268              <td align="left" valign="top">Write: <b><tt>startupaddr(addr)</tt></b>.              <td align="left" valign="top">Write: <b><tt>startupaddr(addr)</tt></b>.
269                  Sets the starting address for CPUs.</td>                  Sets the starting address for CPUs.</td>
270            </tr>            </tr>
271            <tr>            <tr>
272              <td align="left" valign="top">0x0040</td>              <td align="left" valign="top"><tt>0x0040</tt></td>
273              <td align="left" valign="top">Write: <b><tt>pause_addr(addr)</tt></b>.              <td align="left" valign="top">Write: <b><tt>pause_addr(addr)</tt></b>.
274                  Sets the pause address. (TODO: This is not                  Sets the pause address. (TODO: This is not
275                  used anymore?)</td>                  used anymore?)</td>
276            </tr>            </tr>
277            <tr>            <tr>
278              <td align="left" valign="top">0x0050</td>              <td align="left" valign="top"><tt>0x0050</tt></td>
279              <td align="left" valign="top">Write: <b><tt>pause_cpu(i)</tt></b>.              <td align="left" valign="top">Write: <b><tt>pause_cpu(i)</tt></b>.
280                  Stops all CPUs <i>except</i> CPU i.</td>                  Stops all CPUs <i>except</i> CPU i.</td>
281            </tr>            </tr>
282            <tr>            <tr>
283              <td align="left" valign="top">0x0060</td>              <td align="left" valign="top"><tt>0x0060</tt></td>
284              <td align="left" valign="top">Write: <b><tt>unpause_cpu(i)</tt></b>.              <td align="left" valign="top">Write: <b><tt>unpause_cpu(i)</tt></b>.
285                  Unpauses all CPUs <i>except</i> CPU i.</td>                  Unpauses all CPUs <i>except</i> CPU i.</td>
286            </tr>            </tr>
287            <tr>            <tr>
288              <td align="left" valign="top">0x0070</td>              <td align="left" valign="top"><tt>0x0070</tt></td>
289              <td align="left" valign="top">Write: <b><tt>startupstack(addr)</tt></b>.              <td align="left" valign="top">Write: <b><tt>startupstack(addr)</tt></b>.
290                  Sets the startup stack address. (CPUs started with                  Sets the startup stack address. (CPUs started with
291                  startupcpu() above will have their stack pointer                  startupcpu() above will have their stack pointer
292                  set to this value.)</td>                  set to this value.)</td>
293            </tr>            </tr>
294            <tr>            <tr>
295              <td align="left" valign="top">0x0080</td>              <td align="left" valign="top"><tt>0x0080</tt></td>
296              <td align="left" valign="top">Read: <b><tt>hardware_random()</tt></b>.              <td align="left" valign="top">Read: <b><tt>hardware_random()</tt></b>.
297                  This produces a "random" number.</td>                  This produces a "random" number.</td>
298            </tr>            </tr>
299            <tr>            <tr>
300              <td align="left" valign="top">0x0090</td>              <td align="left" valign="top"><tt>0x0090</tt></td>
301              <td align="left" valign="top">Read: <b><tt>memory()</tt></b>.              <td align="left" valign="top">Read: <b><tt>memory()</tt></b>.
302                  Returns the number of bytes of RAM in the system.</td>                  Returns the number of bytes of RAM in the system.</td>
303            </tr>            </tr>
304            <tr>            <tr>
305              <td align="left" valign="top">0x00a0</td>              <td align="left" valign="top"><tt>0x00a0</tt></td>
306              <td align="left" valign="top">Write: <b><tt>ipi_one((nr &lt;&lt; 16) + cpuid)</tt></b>.              <td align="left" valign="top">Write: <b><tt>ipi_one((nr &lt;&lt; 16) + cpuid)</tt></b>.
307                  Sends IPI <tt>nr</tt> to a specific CPU.</td>                  Sends IPI <tt>nr</tt> to a specific CPU.</td>
308            </tr>            </tr>
309            <tr>            <tr>
310              <td align="left" valign="top">0x00b0</td>              <td align="left" valign="top"><tt>0x00b0</tt></td>
311              <td align="left" valign="top">Write: <b><tt>ipi_many((nr &lt;&lt; 16) + cpuid)</tt></b>.              <td align="left" valign="top">Write: <b><tt>ipi_many((nr &lt;&lt; 16) + cpuid)</tt></b>.
312                  Sends IPI <tt>nr</tt> to all CPUs <i>except</i>                  Sends IPI <tt>nr</tt> to all CPUs <i>except</i>
313                  the specified one.</td>                  the specified one.</td>
314            </tr>            </tr>
315            <tr>            <tr>
316              <td align="left" valign="top">0x00c0</td>              <td align="left" valign="top">0x00c0</tt></td>
317              <td align="left" valign="top">Read: <b><tt>ipi_read()</tt></b>.              <td align="left" valign="top">Read: <b><tt>ipi_read()</tt></b>.
318                  Returns the next pending IPI. 0 is returned if there is no                  Returns the next pending IPI. 0 is returned if there is no
319                  pending IPI (so 0 shouldn't be used for valid IPIs).                  pending IPI (so 0 shouldn't be used for valid IPIs).
# Line 346  The <tt>testmips</tt> machine has the fo Line 321  The <tt>testmips</tt> machine has the fo
321              <br>Write: <b><tt>ipi_flush()</tt></b>.              <br>Write: <b><tt>ipi_flush()</tt></b>.
322                  Clears the IPI queue, discarding any pending IPIs.</td>                  Clears the IPI queue, discarding any pending IPIs.</td>
323            </tr>            </tr>
324              <tr>
325                <td align="left" valign="top">0x00d0</tt></td>
326                <td align="left" valign="top">Read: <b><tt>ncycles()</tt></b>.
327                    Returns approximately the number of cycles executed.
328                    Note: this value is not updated for every instruction,
329                    so it cannot be used for small measurements.</td>
330              </tr>
331          </table>          </table>
332      </td>      </td>
333    </tr>    </tr>
# Line 356  The <tt>testmips</tt> machine has the fo Line 338  The <tt>testmips</tt> machine has the fo
338    
339    <tr>    <tr>
340      <td align="left" valign="top">      <td align="left" valign="top">
341          <b><tt>fb</tt>:</b>          <a name="expdevices_fb"><b><tt>fb</tt>:</b></a>
342          <p>A simple linear framebuffer, for graphics output.          <p>A simple linear framebuffer, for graphics output.
343          640 x 480 pixels, 3 bytes per pixel (red, green, blue, 8 bits each).          640 x 480 pixels, 3 bytes per pixel (red, green, blue, 8 bits each).
344          <p>Source code:&nbsp;&nbsp;<font color="#0000f0"><tt>src/devices/dev_fb.c</tt></font>          <p>Source code:&nbsp;&nbsp;<font color="#0000f0"><tt>src/devices/dev_fb.c</tt></font>
# Line 370  The <tt>testmips</tt> machine has the fo Line 352  The <tt>testmips</tt> machine has the fo
352              <td align="left" valign="top"><i><u>Effect:</u></i></td>              <td align="left" valign="top"><i><u>Effect:</u></i></td>
353            </tr>            </tr>
354            <tr>            <tr>
355              <td align="left" valign="top">...</td>              <td align="left" valign="top"><tt>0x00000-</tt><br><tt>0xe0fff</tt></td>
356              <td align="left" valign="top">Read: read pixel values.              <td align="left" valign="top">Read: read pixel values.
357                  <br>Write: write pixel values.</td>                  <br>Write: write pixel values.</td>
358            </tr>            </tr>
# Line 378  The <tt>testmips</tt> machine has the fo Line 360  The <tt>testmips</tt> machine has the fo
360      </td>      </td>
361    </tr>    </tr>
362    
363      <tr height="15">
364        <td height="15">&nbsp;</td>
365      </tr>
366    
367      <tr>
368        <td align="left" valign="top">
369            <a name="expdevices_disk"><b><tt>disk</tt>:</b></a>
370            <p>Disk controller, which can read from and write
371            to disk images. It does not use interrupts; read and
372            write operations finish instantaneously.
373            <p>Source code:&nbsp;&nbsp;<font color="#0000f0"><tt>src/devices/dev_disk.c</tt></font>
374            <br>Default physical address:&nbsp&nbsp;<font color="#0000f0">0x13000000</font>
375        </td>
376        <td></td>
377        <td align="left" valign="top">
378            <table border="0">
379              <tr>
380                <td align="left" valign="top"><i><u>Offset:</u></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
381                <td align="left" valign="top"><i><u>Effect:</u></i></td>
382              </tr>
383              <tr>
384                <td align="left" valign="top"><tt>0x0000</tt></td>
385                <td align="left" valign="top">Write: Set the offset (in bytes) from the beginning
386                    of the disk image. This offset will be used for the next read/write operation.</td>
387              </tr>
388              <tr>
389                <td align="left" valign="top"><tt>0x0010</tt></td>
390                <td align="left" valign="top">Write: Select the SCSI ID to be used in the next
391                    read/write operation.</td>
392              </tr>
393              <tr>
394                <td align="left" valign="top"><tt>0x0020</tt></td>
395                <td align="left" valign="top">Write: Start a read or write operation.
396                    (Writing <tt>0</tt> means a Read operation, a <tt>1</tt> means a
397                    Write operation.)</td>
398              </tr>
399              <tr>
400                <td align="left" valign="top"><tt>0x0030</tt></td>
401                <td align="left" valign="top">Read: Get status of the last operation.
402                    (Status 0 means failure, non-zero means success.)</td>
403              </tr>
404              <tr>
405                <td align="left" valign="top"><tt>0x4000-</tt><br><tt>0x41ff</tt>&nbsp;&nbsp;&nbsp;</td>
406                <td align="left" valign="top">Read/Write: 512 bytes data buffer.</td>
407              </tr>
408            </table>
409        </td>
410      </tr>
411    
412      <tr height="15">
413        <td height="15">&nbsp;</td>
414      </tr>
415    
416      <tr>
417        <td align="left" valign="top">
418            <a name="expdevices_ether"><b><tt>ether</tt>:</b></a>
419            <p>A simple ethernet controller, enough to send
420            and receive packets on a simulated network.
421            <p>Source code:&nbsp;&nbsp;<font color="#0000f0"><tt>src/devices/dev_ether.c</tt></font>
422            <br>Default physical address:&nbsp&nbsp;<font color="#0000f0">0x14000000</font>
423        </td>
424        <td></td>
425        <td align="left" valign="top">
426            <table border="0">
427              <tr>
428                <td align="left" valign="top"><i><u>Offset:</u></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
429                <td align="left" valign="top"><i><u>Effect:</u></i></td>
430              </tr>
431              <tr>
432                <td align="left" valign="top"><tt>0x0000-</tt><br><tt>0x3fff</tt></td>
433                <td align="left" valign="top">Read/write buffer for the packet to be sent/received.</td>
434              </tr>
435              <tr>
436                <td align="left" valign="top"><tt>0x4000</tt></td>
437                <td align="left" valign="top">Read: status word, one or more of these:
438                    <br><tt>0x01</tt>&nbsp;=&nbsp;something was received (because of
439                    the last command)
440                    <br><tt>0x02</tt>&nbsp;=&nbsp;more packets are available
441                    <br><i>NOTE:</i> Whenever the status word is non-zero,
442                            an interrupt is asserted. Reading the status word
443                            clears it, and deasserts the interrupt.</td>
444              </tr>
445              <tr>
446                <td align="left" valign="top"><tt>0x4010</tt></td>
447                <td align="left" valign="top">Read: get the Length of the received packet
448                    <br>Write: set the Length of the next packet to transmit</td>
449              </tr>
450              <tr>
451                <td align="left" valign="top"><tt>0x4020</tt></td>
452                <td align="left" valign="top">Write: command:
453                    <br><tt>0x00:</tt>&nbsp;receive a packet
454                    <br><tt>0x01:</tt>&nbsp;send a packet</td>
455              </tr>
456            </table>
457        </td>
458      </tr>
459    
460  </table></center>  </table></center>
461    
462  <p>  <p>
# Line 385  While these devices may resemble real-wo Line 464  While these devices may resemble real-wo
464  intentionally made simpler to use. (An exception is the framebuffer;  intentionally made simpler to use. (An exception is the framebuffer;
465  some machines actually have simple linear framebuffers like this.)  some machines actually have simple linear framebuffers like this.)
466    
467  <p>  <p>If the physical address is <tt>0x10000000</tt>, then for MIPS that
468  If the physical address is 0x10000000, then for MIPS that means that it  means that it can be accessed at virtual address
469  can be accessed at virtual address 0xffffffffb0000000. (Actually it can be  <tt>0xffffffffb0000000</tt>. (Actually it can be accessed at
470  accessed at 0xffffffff90000000 too, but devices should usually be accessed  <tt>0xffffffff90000000</tt> too, but devices should usually be accessed in
471  in a non-cached manner.)  a non-cached manner.)
472    
473  <p>  <p> (When using the PPC test machine (<tt>testppc</tt>), the addresses are
474  (When using the PPC test machine (<tt>testppc</tt>), the addresses are  <tt>0x10000000</tt>, <tt>0x11000000</tt> etc., so no need to add any
475  0x10000000, 0x11000000 etc., so no need to add any virtual displacement.)  virtual displacement.)
476    
477  <p>The <b><tt>mp</tt></b> device is agnostic when it comes to word-length.  <p>The <b><tt>mp</tt></b>, <b><tt>disk</tt></b>, and <b><tt>ether</tt></b>
478  For example, when reading offset 0x0000 of the <b><tt>mp</tt></b> device,  devices are agnostic when it comes to word-length. For example, when
479  you may use any kind of read (an 8-bit read will work just as well as a  reading offset <tt>0x0000</tt> of the <b><tt>mp</tt></b>
480  64-bit read, although the value will be truncated to 8 bits in the first  device, you may use any kind of read (an 8-bit read will work just as well
481  case).  as a 64-bit read, although the value will be truncated to 8 bits in the
482    first case). You can <i>not</i>, however, read one byte from <tt>0x0000</tt>
483    and one from <tt>0x0001</tt>, and combine the result. The read from
484    <tt>0x0001</tt> will be invalid.
485    
486  <p>The <b><tt>cons</tt></b> device should be accessed using 8-bit reads  <p>The <b><tt>cons</tt></b> device should be accessed using 8-bit reads
487  and writes. Doing a getchar() (ie reading from offset 0x0000) returns 0x00  and writes. Doing a getchar() (ie reading from offset <tt>0x00</tt>)  
488  if no character was available.  returns <tt>0</tt> if no character was available.
489    
490  <p>On MIPS, the <b><tt>cons</tt></b> device is hardwired to interrupt 2  <p>On MIPS, the <b><tt>cons</tt></b> device is hardwired to interrupt 2
491  (the lowest hardware interrupt). Whenever a character is available, the  (the lowest hardware interrupt). Whenever a character is available, the
# Line 411  interrupt is asserted. When there are no Line 493  interrupt is asserted. When there are no
493  interrupt is deasserted. (Remember that the interrupt has to be enabled in  interrupt is deasserted. (Remember that the interrupt has to be enabled in
494  the status register of the system coprocessor.)  the status register of the system coprocessor.)
495    
496  <p>The IPIs controlled by the <b><tt>mp</tt></b> device are hardwired to  <p>The <b><tt>ether</tt></b> device is hardwired to interrupt 3.
 interrupt 6. Whenever an IPI is "sent", interrupt 6 is asserted on the  
 target CPU(s), and the IPI number is added last in the IPI queue for that  
 CPU. It is then up to that CPU to read from offset 0x00c0, to figure out  
 what kind of IPI it was.  
   
   
   
   
   
 <p><br>  
 <a name="experiments"></a>  
 <h3>Experiments with other kernels and guest OSes:</h3>  
   
 <p>  
 Free Operating system kernels and other test programs can be  
 downloaded from various places on the Internet. Other kinds of software  
 (non-Free), if obsolete enough (such as Ultrix or Windows NT), can  
 sometimes be found in garbage containers, or perhaps be found for a cheap  
 price on ebay or at a flea market.  
   
 <p>  
 <font color="#ff0000">  
 NOTE: This is <i>not</i> a list of kernels that work in the emulator.  
 It is a list of kernels that I experiment with.  
 </font>  
   
 <p>  
 For more information about which of these that actually work, read the  
 <a href="intro.html#guestos">section in the Introduction chapter</a>  
 that lists guest operating systems. If a system is not listed there, it  
 probably doesn't work in GXemul.  
   
 <p>  
 <ul>  
   <li>DECstation:  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/pmax/">NetBSD/pmax</a>:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/pmax/binary/kernel/netbsd-INSTALL.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/pmax/binary/kernel/netbsd-INSTALL.gz</a>  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/pmax/binary/kernel/netbsd-INSTALL.symbols.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/pmax/binary/kernel/netbsd-INSTALL.symbols.gz</a>  
         <br>gunzip the files, and run the emulator with <b><tt>-E dec -e 3max -q -N -XY2</tt></b>  
         for a graphical framebuffer console. Remove <b><tt>-XY2</tt></b> and <b><tt>-N</tt></b> to use serial (stdin/stdout) console.  
         Read <a href="guestoses.html#netbsdinstall">this section</a> about how to install NetBSD/pmax onto a harddisk image.  
       <p>  
       <li><a href="http://www.openbsd.org/pmax.html">OpenBSD/pmax</a>:  
         <br><a href="ftp://ftp.se.openbsd.org/pub/OpenBSD/2.8/pmax/bsd">ftp://ftp.se.openbsd.org/pub/OpenBSD/2.8/pmax/bsd</a>  
         <br>This is an old OpenBSD kernel in a.out format. Try <b><tt>-E dec -e 3max</tt></b>.  
         <br>Read <a href="guestoses.html#openbsdinstall">this section</a> about how to install OpenBSD/pmax onto a harddisk image.  
         It's a bit more complicated than installing NetBSD/pmax, but  
         it usually works.  
       <p>  
       <li>Linux for DECstation:  
         <br>Read <a href="guestoses.html#declinux">this section</a> about how to run a Debian Linux install kernel.  
         <br>Here are some older kernels (these don't support framebuffer, I think):  
                 <a href="http://www.xs4all.nl/~vhouten/mipsel/kernels.html">http://www.xs4all.nl/~vhouten/mipsel/kernels.html</a>  
         <br>Note: Make sure you add <b><tt>-CR4400</tt></b> to the command line for  
                 R4000 kernels, as Linux doesn't autodetect CPU type at runtime.  
         <br>Linux also doesn't detect automatically whether you are booting  
                 in graphical or serial console mode, so you need to add  
                 <tt><b>-o 'console=ttyS3'</b></tt> or similar for serial  
                 console mode.  
       <p>  
       <li><a href="http://www.cs.berkeley.edu/projects/sprite/retrospective.html">Sprite</a>:  
         <br>The Unix Heritage Society (TUHS, <a href="http://www.tuhs.org">www.tuhs.org</a>)  
                 has preserved a copy of a harddisk image for a DECstation  
                 5000/200 (3MAX).  
         <br>Read <a href="guestoses.html#sprite">this section</a> for more information  
                 about running this harddisk image in the emulator.  
       <p>  
       <li><a href="http://www-2.cs.cmu.edu/afs/cs/project/mach/public/www/mach.html">Mach</a>:  
         <br>Important! Run <b><tt>./configure --caches; make</tt></b>  
         <br>Also important: This is broken right now. :-(  
         <br>Download <a href="http://lost-contact.mit.edu/afs/athena/user/d/a/daveg/Info/Links/Mach/src/release/">http://lost-contact.mit.edu/afs/athena/user/d/a/daveg/Info/Links/Mach/src/release</a>/<a href="http://lost-contact.mit.edu/afs/athena/user/d/a/daveg/Info/Links/Mach/src/release/pmax.tar.Z">pmax.tar.Z</a>  
         <br><tt><b>tar xfvz pmax.tar.Z pmax_mach/special/mach.boot.MK83.STD+ANY</b></tt>  
         <br><tt><b>gxemul -E dec -e 3max -X pmax_mach/special/mach.boot.MK83.STD+ANY</b></tt>  
     </ul>  
   </li>  
   
   <p>  
   
   <li>SGI:  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/sgimips/">NetBSD/sgimips</a>:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/sgimips/binary/kernel/netbsd-INSTALL32_IP3x.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/sgimips/binary/kernel/netbsd-INSTALL32_IP3x.gz</a>  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/sgimips/binary/kernel/netbsd-INSTALL32_IP3x.symbols.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/sgimips/binary/kernel/netbsd-INSTALL32_IP3x.symbols.gz</a>  
         <br>gunzip, and try running with <b><tt>-E sgi -e ip32</tt></b>.  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.gz</a>  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.symbols.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.symbols.gz</a>  
         <br>gunzip, and try running with <b><tt>-E sgi -e ip22</tt></b> (or <b><tt>ip24</tt></b> or <b><tt>ip20</tt></b>).  
       <p>  
       <li>Linux/SGI:  
         <br>Some kernels are available here: <a href="http://www.linux-mips.org/~glaurung/">http://www.linux-mips.org/~glaurung/</a>  
         <br>Try running with <b><tt>-E sgi -e ip32 -X</tt></b> for a graphical framebuffer, or  
                 <b><tt>-E sgi -e ip32 -o 'console=ttyS0'</tt></b> for serial console.  
         <br>Adding <b><tt>-b</tt></b> (bintrans) might work sometimes.  
         <br>(You need to add <b><tt>-CR5000</tt></b> if you're trying to run  
                 a kernel compiled for R5000, because Linux doesn't autodetect  
                 the CPU type at runtime.)  
         <br>Also: <a href="http://www.tal.org/~milang/o2/kernels/">http://www.tal.org/~milang/o2/kernels</a>/<a href="http://home.tal.org/~milang/o2/kernels/vmlinux64-2.6.8.1-IP32">vmlinux64-2.6.8.1-IP32</a>  
         <br>Try <b><tt>-E sgi -e ip32 -X -CR5000 vmlinux64-2.6.8.1-IP32</tt></b>.  
         <br>And also some IP27 kernels:  
                 <a href="http://www.total-knowledge.com/progs/mips/kernels/vmlinux.ip27-20040428">http://www.total-knowledge.com/progs/mips/kernels/vmlinux.ip27-20040428</a>  
                 and  
                 <a href="http://www.total-knowledge.com/progs/mips/kernels/vmlinux.ip27-20040528.bz2">http://www.total-knowledge.com/progs/mips/kernels/vmlinux.ip27-20040528.bz2</a>  
                 (but unfortunately these lack symbols).  
         <br>Try the IP27 kernels with <b><tt>-E sgi -e ip27 -t</tt></b>.  
       <p>  
       <li><a href="http://www.openbsd.org/sgi.html">OpenBSD/sgi</a>:  
         <br><a href="ftp://ftp.openbsd.org/pub/OpenBSD/3.7/sgi/bsd.rd">ftp://ftp.openbsd.org/pub/OpenBSD/3.7/sgi/bsd.rd</a>  
         <br>More recent snapshots can be found at <a href="ftp://ftp.OpenBSD.org/pub/OpenBSD/snapshots/sgi/">ftp://ftp.OpenBSD.org/pub/OpenBSD/snapshots/sgi/</a>.  
         <br>Try <b><tt>gxemul -E sgi -e ip32 bsd.rd</tt></b>  
       <p>  
       <li><a href="http://www.freebsd.org/platforms/mips.html">FreeBSD/MIPS</a>:  
                 I don't think public binary snapshots are available yet.  
       <p>  
       <li>arcdiag:  
         <br>The NetBSD people have also made available an "arcdiag" for SGI-IP22:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/arch/sgimips/arcdiag.ip22">ftp://ftp.netbsd.org/pub/NetBSD/arch/sgimips/arcdiag.ip22</a>  
         <br>Try running <tt><b>gxemul -E sgi -e ip22 -x arcdiag.ip22</b></tt>.  
     </ul>  
   </li>  
   
   <p>  
   
   <li>ARC:  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/arc/">NetBSD/arc</a>:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/arc/binary/kernel/netbsd-RAMDISK.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/arc/binary/kernel/netbsd-RAMDISK.gz</a>  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/arc/binary/kernel/netbsd-RAMDISK.symbols.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/arc/binary/kernel/netbsd-RAMDISK.symbols.gz</a>  
         <br>gunzip, and try with <b><tt>-E arc -e rd94</tt></b>.  
         <br>(You may also try other ARC models.)  
         <br>Read <a href="guestoses.html#netbsdarcinstall">this section</a> about how  
                 to install NetBSD/arc 1.6.2 onto a harddisk image.  
         <br>(NetBSD/arc 2.0 doesn't work with disk images yet in GXemul.)  
       <p>  
       <li><a href="http://www.openbsd.org/arc.html">OpenBSD/arc</a>:  
         <br><a href="ftp://ftp.se.openbsd.org/pub/OpenBSD/2.3/arc/bsd.rd.elf">ftp://ftp.se.openbsd.org/pub/OpenBSD/2.3/arc/bsd.rd.elf</a>  
         <br>Try running with <b><tt>-X -E arc -e pica</tt></b> or <b><tt>-X -E arc -e tyne</tt></b>.  
         <br>Read <a href="guestoses.html#openbsdarcinstall">this section</a> about how  
                 to install OpenBSD/arc onto a harddisk image.  
       <p>  
       <li>Linux:  
         <br><a href="ftp://ftp.linux-mips.org/pub/linux/mips/mipsel-linux/boot/vmlinux-m700-2.1.131.gz">ftp://ftp.linux-mips.org/pub/linux/mips/mipsel-linux/boot/vmlinux-m700-2.1.131.gz</a>  
         <br>gunzip, and run with <b><tt>-v -J -X -N -E arc -e m700</tt></b> (Olivetti M700)  
         <br>(This probably doesn't work anymore.)  
       <p>  
       <li>Pandora:  
         <br><a href="ftp://ftp.linux-mips.org/pub/linux/mips/ancient/milo/">ftp://ftp.linux-mips.org/pub/linux/mips/ancient/milo</a>/<a href="ftp://ftp.linux-mips.org/pub/linux/mips/ancient/milo/milo-0.27.1.tar.gz">milo-0.27.1.tar.gz</a>  
         <br>A generic test/diagnostics program for ARC-based machines.  
         <br>Run with <b><tt>-E arc -e r94 milo-0.27.1/pandora</tt></b>  
       <p>  
       <li>arcdiag:  
         <br>Precompiled binary:<a href="ftp://ftp.netbsd.org/pub/NetBSD/arch/arc/arcdiag">ftp://ftp.netbsd.org/pub/NetBSD/arch/arc/arcdiag</a>  
         <br>(alternative: <a href="http://www.sensi.org/~alec/mips/arcdiag">http://www.sensi.org/~alec/mips/arcdiag</a>)  
         <br>A generic test/diagnostics program for ARC-based machines.  
         <br>Run with <b><tt>-E arc -e pica arcdiag</tt></b> (or some other ARC mode).  
         <br>Example arcdiag output (from real machines):  
         <br><a href="http://mail-index.netbsd.org/port-arc/2000/10/18/0001.html">http://mail-index.netbsd.org/port-arc/2000/10/18/0001.html</a> (Olivetti M700-10)  
         <br><a href="http://www.sensi.org/~alec/mips/arcdiag.txt">http://www.sensi.org/~alec/mips/arcdiag.txt</a> (PICA-61)  
         <br><a href="http://mail-index.netbsd.org/port-arc/2000/10/14/0000.html">http://mail-index.netbsd.org/port-arc/2000/10/14/0000.html</a> (Deskstation Tyne)  
         <br><a href="http://mail-index.netbsd.org/port-arc/2004/02/01/0001.html">http://mail-index.netbsd.org/port-arc/2004/02/01/0001.html</a> (NEC RISCserver 4200)  
         <br><a href="http://mirror.aarnet.edu.au/pub/NetBSD/misc/chs/arcdiag.out">http://mirror.aarnet.edu.au/pub/NetBSD/misc/chs/arcdiag.out</a> (NEC-R96)  
         <br>For some machines, such as <tt><b>-e pica</b></tt>, you can  
                 add <b><tt>-X</tt></b> to boot with a graphical VGA-style  
                 console. This however is probably a bit unstable and/or  
                 broken right now.  
       <p>  
       <li>Windows NT:  
         <br>Put a "Windows NT 4.0 for MIPS" CDROM (or similar) into  
                 your CDROM drive. (On FreeBSD systems, it is usually called  
                 /dev/cd0c or similar. Change that to whatever the CDROM  
                 is called on your system, or the name of a raw .iso image.)  
         <br>I have tried this with the Swedish version, but it might  
                 work with other versions too.<pre>  
         $ <b><tt>dd if=/dev/zero of=winnt_test.img bs=1024 count=1 seek=999000</tt></b>  
         $ <b><tt>gxemul -X -Earc -epica -d winnt_test.img -d bc6:/dev/cd0c -j MIPS\\ARCINST</tt></b>  
         $ <b><tt>gxemul -X -Earc -epica -d winnt_test.img -d bc6:/dev/cd0c -j MIPS\\SETUPLDR</tt></b>  
 </pre>  <br><tt>ARCINST</tt> tries to prepare the disk image for installation. (It <i>almost</i> works.)  
         <br><tt>SETUPLDR</tt> should load some drivers from the cdrom, but then it crashes with a bluescreen.  
     </ul>  
   </li>  
   
   <p>  
   
   <li>HPCmips:  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/hpcmips/">NetBSD/hpcmips</a>:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/hpcmips/installation/">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/hpcmips/installation</a>/<a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/hpcmips/installation/netbsd.gz">netbsd.gz</a>  
         <br>Try <b><tt>gxemul -X -E hpc -e mobilepro770 netbsd</tt></b>  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/hpcmips/binary/kernel/netbsd-GENERIC.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/hpcmips/binary/kernel/netbsd-GENERIC.gz</a>  
         <br>Try <b><tt>gxemul -X -E hpc -e mobilepro770 netbsd-GENERIC</tt></b>  
       <p>  
       <li>Linux for BE300:  
         <br><a href="http://www.linux4.be/2004/linux4be20040908.zip">http://www.linux4.be/2004/linux4be20040908.zip</a>  
         <br>Try <b><tt>gxemul -X -E hpc -e be300 vmlinux</tt></b>  
       <p>  
       <li>Linux for Agenda VR3:  
         <br>Download <a href="http://agenda-snow.sourceforge.net/kernel-old-versions/binary/">http://agenda-snow.sourceforge.net/kernel-old-versions/binary</a>/<a href="http://agenda-snow.sourceforge.net/kernel-old-versions/binary/root1.2.6.kernel-8.00">root1.2.6.kernel-8.00</a>  
         <br>and <a href="http://vr3.uid0.sk/cd/Software/VR3_Distributions/H2O/">http://vr3.uid0.sk/cd/Software/VR3_Distributions/H2O</a>/<a href="http://vr3.uid0.sk/cd/Software/VR3_Distributions/H2O/root1.2.6.cramfs">root1.2.6.cramfs</a>.  
         <br>(or <a href="http://www.ipsec.info/~www/agenda/dream-1-noxip.cramfs">http://www.ipsec.info/~www/agenda/dream-1-noxip.cramfs</a>)  
         <br>Try <b><tt>gxemul -X -E hpc -e vr3 -x 0xbf200000:root1.2.6.cramfs 0xbf000000:0:0xbf0005e0:root1.2.6.kernel-8.00</tt></b>  
         <br>(or replace root1.2.6.cramfs with dream-1-noxip.cramfs)  
         <br>Remove <b><tt>-X</tt></b> to try with serial console instead of X, and  
                 remove <b><tt>-b</tt></b> to try without (old) bintrans.  
         <br>Add <b><tt>-o 'init=/bin/sh'</tt></b> to boot into a single-user shell.  
         <br>Add <b><tt>-o 'init=/sbin/restore_defaults'</tt></b> to run  
                 a <tt>/sbin/restore_defaults</tt> (attempt to initialize the  
                 flash memory).  
       <p>  
       <li>Linux for MobilePro etc.:  
         <br><a href="http://pc1.peanuts.gr.jp/~kei/Hard-Float/Kernels/">http://pc1.peanuts.gr.jp/~kei/Hard-Float/Kernels/</a>  
         <br>Uncompress the archive to get a kernel, vmlinux-800 for example.  
         <br>Try <b><tt>./gxemul -X -o 'root=/dev/hda1' -d r:disk.img -d r:disk.img -Ehpc -e mobilepro800 vmlinux-800</tt></b>  
         <br>where disk.img is an ext2fs filesystem with contents from  
         <a href="http://pc1.peanuts.gr.jp/~kei/Hard-Float/Miniroots/miniroot-20010330.tar.bz2">http://pc1.peanuts.gr.jp/~kei/Hard-Float/Miniroots/miniroot-20010330.tar.bz2</a>  
         <br>(Note the double disk arguments.)  
         <br>Note 2: This doesn't work yet.  
       <p>  
       <li><a href="http://www.disorder.ru/openbsd/be300/">OpenBSD/be300</a>:  
         <br><a href="http://www.disorder.ru/openbsd/be300/bsd.rd">http://www.disorder.ru/openbsd/be300/bsd.rd</a>  
         <br>Try <b><tt>gxemul -X -E hpc -e be300 bsd.rd</tt></b>  
         <br>Note: bintrans might be buggy, so you can try with -B if you want to.  
     </ul>  
   </li>  
   
   <p>  
   
   <li>Cobalt:  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/cobalt/">NetBSD/cobalt</a>:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-1.6.2/cobalt/binary/kernel/netbsd-GENERIC.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-1.6.2/cobalt/binary/kernel/netbsd-GENERIC.gz</a>  
         <br>gunzip, and run with <b><tt>-E cobalt</tt></b>  
         <br>(Or read <a href="guestoses.html#netbsdcobaltinstall">this  
         section</a> on how to install NetBSD/cobalt onto a harddisk image.)  
       <p>  
       <li>Linux:  
         <br><a href="http://people.debian.org/~pm/mips-cobalt/nfsroot/vmlinux_raq-2800.gz">http://people.debian.org/~pm/mips-cobalt/nfsroot/vmlinux_raq-2800.gz</a>  
         <br>gunzip, and run with <b><tt>-E cobalt</tt></b>  
       <p>  
       <li>CoLo:  
         <br><a href="http://www.colonel-panic.org/cobalt-mips/colo/colo-1.19.tar.gz">http://www.colonel-panic.org/cobalt-mips/colo/colo-1.19.tar.gz</a>  
         <br><tt><b>tar zxvf colo-1.19.tar.gz colo-1.19/binaries/colo-rom-image.bin</b></tt>  
         <br><tt><b>gxemul -Q -Ecobalt -v 0xbfc00000:colo-1.19/binaries/colo-rom-image.bin</b></tt>  
         <br>(This doesn't work yet.)  
     </ul>  
   </li>  
   
   <p>  
   
   <li>Playstation 2:  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/playstation2/">NetBSD/playstation2</a>:  
         <br>NetBSD/playstation2 snapshot kernels are available here: (RAMDISK and GENERIC)  
         <br><a href="ftp://ftp.NetBSD.org/pub/NetBSD/arch/playstation2/snapshot/20020327/installation/netbsd.gz">ftp://ftp.NetBSD.org/pub/NetBSD/arch/playstation2/snapshot/20020327/installation/netbsd.gz</a>  
         <br><a href="ftp://ftp.NetBSD.org/pub/NetBSD/arch/playstation2/snapshot/20020327/binary/kernel/netbsd-GENERIC.gz">ftp://ftp.NetBSD.org/pub/NetBSD/arch/playstation2/snapshot/20020327/binary/kernel/netbsd-GENERIC.gz</a>  
         <br>Try running with <b><tt>-X -E playstation2</tt></b>  (<b><tt>-X</tt></b> is required, for the framebuffer).  
   
       <p>  
       <li>Linux:  
         <br>A Linux kernel (2.2.21-pre1-xr7) is available from  
         <a href="http://playstation2-linux.com/projects/xrhino-kernel/">http://playstation2-linux.com/projects/xrhino-kernel/</a>  
         <br>Try running with <b><tt>-X -E playstation2</tt></b>  (<b><tt>-X</tt></b> is required, for the framebuffer).  
     </ul>  
   </li>  
   
   <p>  
   
   <li>EVBMIPS:  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/evbmips/">NetBSD/evbmips</a>:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/evbmips-mipseb/binary/kernel/">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/evbmips-mipseb/binary/kernel</a>/<a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/evbmips-mipseb/binary/kernel/netbsd-MALTA.gz">netbsd-MALTA.gz</a>  
         <br><b><tt>gxemul -E evbmips -e malta netbsd-MALTA</tt></b>  
         <br>The default CPU is a 5Kc (MIPS64). Add  
                 <tt>-C 4Kc</tt> to use a MIPS32 CPU instead.  
         <br>(NetBSD/evbmips runs in 32-bit mode on MIPS64 anyway...)  
         <br>Read <a href="guestoses.html#netbsdevbmipsinstall">this  
         section</a> on how to install NetBSD/evbmips onto a harddisk image.  
         <br>or  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/evbmips-mipseb/binary/kernel/">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/evbmips-mipseb/binary/kernel</a>/<a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/evbmips-mipseb/binary/kernel/netbsd-PB1000.gz">netbsd-PB1000.gz</a>  
         <br><b><tt>gxemul -E evbmips -e pb1000 netbsd-PB1000</tt></b>  
     </ul>  
   </li>  
   
 </ul>  
   
 <p>  
 The following don't work at all, or just very very little.  
   
 <p>  
 <ul>  
   <li>Sony NeWS:  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/newsmips/">NetBSD/newsmips</a>:  
         <br>A NetBSD/newsmips kernel and corresponding symbols are  
                 available here:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/newsmips/binary/kernel/netbsd-INSTALL.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/newsmips/binary/kernel/netbsd-INSTALL.gz</a>  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/newsmips/binary/kernel/netbsd-INSTALL.symbols.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/newsmips/binary/kernel/netbsd-INSTALL.symbols.gz</a>  
         <br>Try running with <b><tt>-E sonynews</tt></b>.  
         <br>There's also a boot floppy available, but the emulator currently  
                 doesn't support booting from it:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-1.6/newsmips/installation/floppy/boot.fs">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-1.6/newsmips/installation/floppy/boot.fs</a>  
     </ul>  
   </li>  
   
   <p>  
   
   <li><a href="http://www.meshcube.org/">MeshCube</a>:  
     <ul>  
       <li>Linux:  
         <br>A Linux kernel is available from  
         <a href="http://www.meshcube.org/feed/stable/">http://www.meshcube.org/feed/stable</a>/<a href="http://www.meshcube.org/feed/stable/kernel-image-mtx_2.4.24-3_mipsel.ipk">kernel-image-mtx_2.4.24-3_mipsel.ipk</a>  
         <br>(This is a Debian package, you can use <tt><b>ar</b></tt> and  
                 <tt><b>tar</b></tt> to extract kernel.img from it.)  
         <br>Try running with <b><tt>-E meshcube 0x80800000:kernel.img</tt></b>.  
     </ul>  
   </li>  
   
   <p>  
   
   <li><a href="http://www.seattlewireless.net/index.cgi/NetgearWG602">NetGear WG602</a>:  
     <ul>  
       <li>Linux:  
         <br>A Linux kernel is available from  
         <a href="ftp://downloads.netgear.com/files/wg602_v1715.zip">ftp://downloads.netgear.com/files/wg602_v1715.zip</a>  
         <br>(Unzip wg602_v1715.zip to get WG602_V1715.img.)  
         <br>Try running with <b><tt>-E netgear 0xbfc80000:0x40:WG602_V1715.img</tt></b>.  
         <br>(It takes some time to decompress the kernel, so be patient.)  
         <br>(This doesn't really work yet.)  
     </ul>  
   </li>  
   
   <p>  
   
   <li>Walnut (evbppc):  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/evbppc/">NetBSD/evbppc</a>:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/evbppc/binary/kernel/netbsd-INSTALL_WALNUT.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/evbppc/binary/kernel/netbsd-INSTALL_WALNUT.gz</a>  
         <br>gunzip, and try the following:  
         <br><tt><b>gxemul -E walnut -v -t netbsd-INSTALL_WALNUT</b></tt>  
     </ul>  
   </li>  
   
   <p>  
   
   <li>Artesyn's PM/PPC board (pmppc):  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/pmppc/">NetBSD/pmppc</a>:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/pmppc/binary/kernel/netbsd-INSTALL.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/pmppc/binary/kernel/netbsd-INSTALL.gz</a>  
         <br>gunzip, and try the following:  
         <br><tt><b>gxemul -E pmppc netbsd-INSTALL</b></tt>  
     </ul>  
   </li>  
   
   <p>  
   
   <li>Motorola Sandpoint (sandpoint):  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/sandpoint/">NetBSD/sandpoint</a>:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/sandpoint/binary/kernel/netbsd-INSTALL.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/sandpoint/binary/kernel/netbsd-INSTALL.gz</a>  
         <br>gunzip, and try the following:  
         <br><tt><b>gxemul -E sandpoint -v -t netbsd-INSTALL</b></tt>  
     </ul>  
   </li>  
   
   <p>  
   
   <li>PReP:  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/prep/">NetBSD/prep</a>:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/prep/binary/kernel/netbsd-INSTALL.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/prep/binary/kernel/netbsd-INSTALL.gz</a>  
         <br>gunzip, and try the following:  
         <br><tt><b>gxemul -E prep -v -t netbsd-INSTALL</b></tt>  
       <p>  
       <li>Linux:  
         <br><a href="http://jocelyn.mayer.free.fr/qemu-ppc/linux_images/2.4.25-PPC/vmlinux">http://jocelyn.mayer.free.fr/qemu-ppc/linux_images/2.4.25-PPC/vmlinux</a>  
         <br><tt><b>gxemul -E prep -v -t vmlinux</b></tt>  
     </ul>  
   </li>  
   
   <p>  
   
   <li>MacPPC:  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/macppc/">NetBSD/macppc</a>:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/macppc/binary/kernel/">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/macppc/binary/kernel</a>/<a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/macppc/binary/kernel/netbsd-INSTALL.gz">netbsd-INSTALL.gz</a>  
         <br><tt><b>gxemul -E macppc -e g4 -t netbsd-INSTALL</b></tt>  
       <p>  
       <li><a href="http://www.openbsd.org/macppc.html">OpenBSD/macppc</a>:  
         <br><a href="ftp://ftp.openbsd.org/pub/OpenBSD/3.6/macppc/">ftp://ftp.openbsd.org/pub/OpenBSD/3.6/macppc</a>/<a href="ftp://ftp.openbsd.org/pub/OpenBSD/3.6/macppc/bsd.rd">bsd.rd</a>  
         <br><tt><b>gxemul -E macppc -e g4 -t bsd.rd</b></tt>  
     </ul>  
   </li>  
   
   <p>  
   
   <li>BeBox:  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/bebox/">NetBSD/bebox</a>:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/arch/bebox/snapshot/19981119/">ftp://ftp.netbsd.org/pub/NetBSD/arch/bebox/snapshot/19981119</a>/<a href="ftp://ftp.netbsd.org/pub/NetBSD/arch/bebox/snapshot/19981119/kern.tgz">kern.tgz</a>  
         <br><tt><b>tar xvzf kern.tgz</b></tt>  
         <br><tt><b>gxemul -E bebox netbsd</b></tt>  
       <p>  
       <li><a href="http://www.bebox.nu/os.php?s=os/linux/index">Linux/bebox</a>:  
         <br><a href="http://www.bebox.nu/files/linux/BeBox-scsi-980610.gz">http://www.bebox.nu/files/linux/BeBox-scsi-980610.gz</a>  
         <br><tt><b>gunzip BeBox-scsi-980610.gz</b></tt>  
         <br><tt><b>gxemul -E bebox 0x3100:0x400:BeBox-scsi-980610</b></tt>  
     </ul>  
   </li>  
   
   <p>  
   
   <li>SPARC64:  
     <ul>  
       <li><a href="http://www.netbsd.org/Ports/sparc64/">NetBSD/sparc64</a>:  
         <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/sparc64/binary/kernel/netbsd-INSTALL.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0/sparc64/binary/kernel/netbsd-INSTALL.gz</a>  
         <br>gunzip, and try the following:  
         <br><tt><b>gxemul -E ultra1 -v -i netbsd-INSTALL</b></tt>  
       <p>  
       <li><a href="http://www.openbsd.org/sparc64.html">OpenBSD/sparc64</a>:  
         <br><a href="ftp://ftp.openbsd.org/pub/OpenBSD/3.6/sparc64/bsd.rd">ftp://ftp.openbsd.org/pub/OpenBSD/3.6/sparc64/bsd.rd</a>  
         <br>rename to bsd.rd.gz, gunzip, and try the following:  
         <br><tt><b>gxemul -E ultra1 -v -i bsd.rd</b></tt>  
     </ul>  
   </li>  
 </ul>  
   
 <p>  
 The URISC emulation mode is just for fun. (Read  
 <a href="http://en.wikipedia.org/wiki/URISC">http://en.wikipedia.org/wiki/URISC</a>  
 for more info.)  
   
 <p>  
 <ul>  
   
   <li>URISC:  
     <ul>  
       <li>I've placed a small test program in the experiments directory.  
         <br>Start like this: <tt><b>gxemul -E testurisc 0:urisc_test.bin</b></tt>  
         <br>or, if you want to single-step:  
                 <b><tt>gxemul -V -E testurisc 0:urisc_test.bin</b></tt>  
         <br>2005-03-01: All outputed characters are printed twice. I'll  
         try to make a pseudo-device for outputing to "normal" devices  
         later.  
     </ul>  
   </li>  
   
 </ul>  
   
497    
498    <p>The IPIs controlled by the <b><tt>mp</tt></b> device are hardwired to
499    interrupt 6. Whenever an IPI is "sent", interrupt 6 is asserted on the
500    target CPU(s), and the IPI number is added last in the IPI queue for that
501    CPU. It is then up to that CPU to read from offset <tt>0x00c0</tt>, to
502    figure out what kind of IPI it was.
503    
504    <p>A simple tutorial on how to use the <tt>disk</tt> device, if not clear
505    from the description above, can be found here: <a
506    href="test_disk.c"><tt>test_disk.c</tt></a>
507    
508    
509    

Legend:
Removed from v.10  
changed lines
  Added in v.22

  ViewVC Help
Powered by ViewVC 1.1.26