/[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

Annotation of /trunk/doc/experiments.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12 - (hide annotations)
Mon Oct 8 16:18:38 2007 UTC (16 years, 6 months ago) by dpavlin
File MIME type: text/html
File size: 43624 byte(s)
++ trunk/HISTORY	(local)
$Id: HISTORY,v 1.905 2005/08/16 09:16:24 debug Exp $
20050628	Continuing the work on the ARM translation engine. end_of_page
		works. Experimenting with load/store translation caches
		(virtual -> physical -> host).
20050629	More ARM stuff (memory access translation cache, mostly). This
		might break a lot of stuff elsewhere, probably some MIPS-
		related translation things.
20050630	Many load/stores are now automatically generated and included
		into cpu_arm_instr.c; 1024 functions in total (!).
		Fixes based on feedback from Alec Voropay: only print 8 hex
		digits instead of 16 in some cases when emulating 32-bit
		machines; similar 8 vs 16 digit fix for breakpoint addresses;
		4Kc has 16 TLB entries, not 48; the MIPS config select1
		register is now printed with "reg ,0".
		Also changing many other occurances of 16 vs 8 digit output.
		Adding cache associativity fields to mips_cpu_types.h; updating
		some other cache fields; making the output of
		mips_cpu_dumpinfo() look nicer.
		Generalizing the bintrans stuff for device accesses to also
		work with the new translation system. (This might also break
		some MIPS things.)
		Adding multi-load/store instructions to the ARM disassembler
		and the translator, and some optimizations of various kinds.
20050701	Adding a simple dev_disk (it can read/write sectors from
		disk images).
20050712	Adding dev_ether (a simple ethernet send/receive device).
		Debugger command "ninstrs" for toggling show_nr_of_instructions
		during runtime.
		Removing the framebuffer logo.
20050713	Continuing on dev_ether.
		Adding a dummy cpu_alpha (again).
20050714	More work on cpu_alpha.
20050715	More work on cpu_alpha. Many instructions work, enough to run
		a simple framebuffer fill test (similar to the ARM test).
20050716	More Alpha stuff.
20050717	Minor updates (Alpha stuff).
20050718	Minor updates (Alpha stuff).
20050719	Generalizing some Alpha instructions.
20050720	More Alpha-related updates.
20050721	Continuing on cpu_alpha. Importing rpb.h from NetBSD/alpha.
20050722	Alpha-related updates: userland stuff (Hello World using
		write() compiled statically for FreeBSD/Alpha runs fine), and
		more instructions are now implemented.
20050723	Fixing ldq_u and stq_u.
		Adding more instructions (conditional moves, masks, extracts,
		shifts).
20050724	More FreeBSD/Alpha userland stuff, and adding some more
		instructions (inserts).
20050725	Continuing on the Alpha stuff. (Adding dummy ldt/stt.)
		Adding a -A command line option to turn off alignment checks
		in some cases (for translated code).
		Trying to remove the old bintrans code which updated the pc
		and nr_of_executed_instructions for every instruction.
20050726	Making another attempt att removing the pc/nr of instructions
		code. This time it worked, huge performance increase for
		artificial test code, but performance loss for real-world
		code :-( so I'm scrapping that code for now.
		Tiny performance increase on Alpha (by using ret instead of
		jmp, to play nice with the Alpha's branch prediction) for the
		old MIPS bintrans backend.
20050727	Various minor fixes and cleanups.
20050728	Switching from a 2-level virtual to host/physical translation
		system for ARM emulation, to a 1-level translation.
		Trying to switch from 2-level to 1-level for the MIPS bintrans
		system as well (Alpha only, so far), but there is at least one
		problem: caches and/or how they work with device mappings.
20050730	Doing the 2-level to 1-level conversion for the i386 backend.
		The cache/device bug is still there for R2K/3K :(
		Various other minor updates (Malta etc).
		The mc146818 clock now updates the UIP bit in a way which works
		better with Linux for at least sgimips and Malta emulation.
		Beginning the work on refactoring the dyntrans system.
20050731	Continuing the dyntrans refactoring.
		Fixing a small but serious host alignment bug in memory_rw.
		Adding support for big-endian load/stores to the i386 bintrans
		backend.
		Another minor i386 bintrans backend update: stores from the
		zero register are now one (or two) loads shorter.
		The slt and sltu instructions were incorrectly implemented for
		the i386 backend; only using them for 32-bit mode for now.
20050801	Continuing the dyntrans refactoring.
		Cleanup of the ns16550 serial controller (removing unnecessary
		code).
		Bugfix (memory corruption bug) in dev_gt, and a patch/hack from
		Alec Voropay for Linux/Malta.
20050802	More cleanup/refactoring of the dyntrans subsystem: adding
		phys_page pointers to the lookup tables, for quick jumps
		between translated pages.
		Better fix for the ns16550 device (but still no real FIFO
		functionality).
		Converting cpu_ppc to the new dyntrans system. This means that
		I will have to start from scratch with implementing each
		instruction, and figure out how to implement dual 64/32-bit
		modes etc.
		Removing the URISC CPU family, because it was useless.
20050803	When selecting a machine type, the main type can now be omitted
		if the subtype name is unique. (I.e. -E can be omitted.)
		Fixing a dyntrans/device update bug. (Writes to offset 0 of
		a device could sometimes go unnoticed.)
		Adding an experimental "instruction combination" hack for
		ARM for memset-like byte fill loops.
20050804	Minor progress on cpu_alpha and related things.
		Finally fixing the MIPS dmult/dmultu bugs.
		Fixing some minor TODOs.
20050805	Generalizing the 8259 PIC. It now also works with Cobalt
		and evbmips emulation, in addition to the x86 hack.
		Finally converting the ns16550 device to use devinit.
		Continuing the work on the dyntrans system. Thinking about
		how to add breakpoints.
20050806	More dyntrans updates. Breakpoints seem to work now.
20050807	Minor updates: cpu_alpha and related things; removing
		dev_malta (as it isn't used any more).
		Dyntrans: working on general "show trace tree" support.
		The trace tree stuff now works with both the old MIPS code and
		with newer dyntrans modes. :)
		Continuing on Alpha-related stuff (trying to get *BSD to boot
		a bit further, adding more instructions, etc).
20050808	Adding a dummy IA64 cpu family, and continuing the refactoring
		of the dyntrans system.
		Removing the regression test stuff, because it was more or
		less useless.
		Adding loadlinked/storeconditional type instructions to the
		Alpha emulation. (Needed for Linux/alpha. Not very well tested
		yet.)
20050809	The function call trace tree now prints a per-function nr of
		arguments. (Semi-meaningless, since that data isn't read yet
		from the ELFs; some hardcoded symbols such as memcpy() and
		strlen() work fine, though.)
		More dyntrans refactoring; taking out more of the things that
		are common to all cpu families.
20050810	Working on adding support for "dual mode" for PPC dyntrans
		(i.e. both 64-bit and 32-bit modes).
		(Re)adding some simple PPC instructions.
20050811	Adding a dummy M68K cpu family. The dyntrans system isn't ready
		for variable-length ISAs yet, so it's completely bogus so far.
		Re-adding more PPC instructions.
		Adding a hack to src/file.c which allows OpenBSD/mac68k a.out
		kernels to be loaded.
		Beginning to add PPC loads/stores. So far they only work in
		32-bit mode.
20050812	The configure file option "add_remote" now accepts symbolic
		host names, in addition to numeric IPv4 addresses.
		Re-adding more PPC instructions.
20050814	Continuing to port back more PPC instructions.
		Found and fixed the cache/device write-update bug for 32-bit
		MIPS bintrans. :-)
		Triggered a really weird and annoying bug in Compaq's C
		compiler; ccc sometimes outputs code which loads from an
		address _before_ checking whether the pointer was NULL or not.
		(I'm not sure how to handle this problem.)
20050815	Removing all of the old x86 instruction execution code; adding
		a new (dummy) dyntrans module for x86.
		Taking the first steps to extend the dyntrans system to support
		variable-length instructions.
		Slowly preparing for the next release.
20050816	Adding a dummy SPARC cpu module.
		Minor updates (documentation etc) for the release.

==============  RELEASE 0.3.5  ==============


1 dpavlin 12 <html><head><title>Gavare's eXperimental Emulator:&nbsp;&nbsp;&nbsp;Experimenting with GXemul</title>
2     <meta name="robots" content="noarchive,nofollow,noindex"></head>
3 dpavlin 4 <body bgcolor="#f8f8f8" text="#000000" link="#4040f0" vlink="#404040" alink="#ff0000">
4     <table border=0 width=100% bgcolor="#d0d0d0"><tr>
5     <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">
7 dpavlin 12 <b>Gavare's eXperimental Emulator:&nbsp;&nbsp;&nbsp;</b></font>
8 dpavlin 4 <font color="#000000" size="6"><b>Experimenting with GXemul</b>
9     </font></td></tr></table></td></tr></table><p>
10 dpavlin 2
11     <!--
12    
13 dpavlin 12 $Id: experiments.html,v 1.89 2005/08/09 18:29:20 debug Exp $
14 dpavlin 2
15     Copyright (C) 2003-2005 Anders Gavare. All rights reserved.
16    
17     Redistribution and use in source and binary forms, with or without
18     modification, are permitted provided that the following conditions are met:
19    
20     1. Redistributions of source code must retain the above copyright
21     notice, this list of conditions and the following disclaimer.
22     2. Redistributions in binary form must reproduce the above copyright
23     notice, this list of conditions and the following disclaimer in the
24     documentation and/or other materials provided with the distribution.
25     3. The name of the author may not be used to endorse or promote products
26     derived from this software without specific prior written permission.
27    
28     THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
29     ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31     ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
32     FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33     DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34     OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36     LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37     OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38     SUCH DAMAGE.
39    
40     -->
41    
42     <a href="./">Back to the index</a>
43    
44     <p><br>
45     <h2>Experimenting with GXemul</h2>
46    
47     <p>
48     <ul>
49     <li><a href="#hello">Hello world</a>
50     <li><a href="#expdevices">Experimental devices</a>
51     <li><a href="#experiments">Experiments with other kernels and guest OSes</a>
52     </ul>
53    
54    
55    
56    
57    
58    
59     <p><br>
60     <a name="hello"></a>
61     <h3>Hello world:</h3>
62    
63     You might want to use the emulator to develop programs on your own,
64     not just run precompiled kernels such as NetBSD. To get started, I recommend
65     that you do two things:
66    
67     <p>
68     <ul>
69     <li>Build and install a cross-compiler for MIPS.
70     <li>Compile this hello world program, and run it in the emulator.
71     </ul>
72    
73     <p>
74     <table border="0"><tr><td width="40">&nbsp;</td><td>
75     <pre>
76     <font color=#f00000>/* Hello world for GXemul */
77    
78     /* Note: The cast to a signed int causes the address to be sign-extended
79     correctly to 0xffffffffb00000xx when compiled in 64-bit mode */
80     </font><font color=#a0a0a0>#define PUTCHAR_ADDRESS ((signed int)0xb0000000)
81     #define HALT_ADDRESS ((signed int)0xb0000010)
82    
83     </font><font color=#c000c0>void </font><font color=#000000><a name="printchar">printchar</a>(</font><font color=#c000c0>char </font><font color=#000000>ch)
84     {
85     *((</font><font color=#c000c0>volatile unsigned char </font><font color=#000000>*) PUTCHAR_ADDRESS) = ch;
86     }
87    
88     </font><font color=#c000c0>void </font><font color=#000000><a name="halt">halt</a>(</font><font color=#c000c0>void</font><font color=#000000>)
89     {
90     *((</font><font color=#c000c0>volatile unsigned char </font><font color=#000000>*) HALT_ADDRESS) = 0;
91     }
92    
93     </font><font color=#c000c0>void </font><font color=#000000><a name="printstr">printstr</a>(</font><font color=#c000c0>char </font><font color=#000000>*s)
94     {
95     </font><font color=#c000c0>while </font><font color=#000000>(*s)
96     printchar(*s++);
97     }
98    
99     </font><font color=#c000c0>void </font><font color=#000000>f(</font><font color=#c000c0>void</font><font color=#000000>)
100     {
101     printstr(</font><font color=#00c000>"Hello world\n"</font><font color=#000000>);
102     halt();
103     }
104     </font></pre>
105     </td></tr></table>
106    
107 dpavlin 10 <p>(This hello world program is available here as well:
108     <a href="hello_mips.c"><tt>hello_mips.c</tt></a>)
109 dpavlin 6
110 dpavlin 10 <p>I recommend that you build a GCC cross compiler for the
111 dpavlin 2 <b>mips64-unknown-elf</b> target, and install it. Other compilers could
112     work too, but GCC is good because of its portability. Then try to compile
113 dpavlin 10 and link the hello world program:
114 dpavlin 2 <pre>
115     $ <b>mips64-unknown-elf-gcc -O2 hello_mips.c -mips4 -mabi=64 -c</b>
116     $ <b>mips64-unknown-elf-ld -Ttext 0xa800000000030000 -e f hello_mips.o -o hello_mips --oformat=elf64-bigmips</b>
117     $ <b>file hello_mips</b>
118     hello_mips: ELF 64-bit MSB mips-4 executable, MIPS R3000_BE, version 1 (SYSV), statically linked, not stripped
119     $ <b>gxemul -q -E testmips hello_mips</b>
120     Hello world
121    
122     $ <b>mips64-unknown-elf-gcc -O2 hello_mips.c -c</b>
123     $ <b>mips64-unknown-elf-ld -Ttext 0x80030000 -e f hello_mips.o -o hello_mips</b>
124     $ <b>file hello_mips</b>
125     hello_mips: ELF 32-bit MSB mips-3 executable, MIPS R3000_BE, version 1 (SYSV), statically linked, not stripped
126     $ <b>gxemul -q -E testmips hello_mips</b>
127     Hello world
128     </pre>
129    
130     <p>
131     As you can see above, a GCC configured for mips64-unknown-elf can produce
132     both 64-bit and 32-bit binaries. If you don't want to run the entire
133     Hello World program, but want to single-step through the execution to
134     learn more about how MIPS programs run, then add -V to the command line:
135    
136     <p>
137     <pre>
138     $ <b>gxemul -V -E testmips hello_mips</b>
139     ..
140     GXemul&gt; <b>r</b>
141     cpu0: pc = a800000000030078 <f>
142     cpu0: hi = 0000000000000000 lo = 0000000000000000
143     cpu0: zr = 0000000000000000 at = 0000000000000000
144     cpu0: v0 = 0000000000000000 v1 = 0000000000000000
145     ..
146     cpu0: gp = a8000000000780c0 sp = ffffffffa0007f00
147     cpu0: fp = 0000000000000000 ra = 0000000000000000
148     GXemul&gt; <b>s 15</b>
149     &lt;f&gt;
150     a800000000030078: 67bdfff0 daddiu sp,sp,-16
151     a80000000003007c: 3c04a800 lui a0,0xa800
152     a800000000030080: 3c010003 lui at,0x3
153     a800000000030084: 64840000 daddiu a0,a0,0
154     a800000000030088: 642100b8 daddiu at,at,184
155     a80000000003008c: 0004203c dsll32 a0,a0,0
156     a800000000030090: 0081202d daddu a0,a0,at
157     a800000000030094: ffbf0000 sd ra,0(sp) [0xffffffffa0007ef0, data=0x0000000000000000]
158     a800000000030098: 0c00c00a jal 0xa800000000030028 &lt;printstr&gt;
159     a80000000003009c: 00000000 (d) nop
160     &lt;printstr("Hello world\n",0,0,0,..)&gt;
161     &lt;printstr&gt;
162     a800000000030028: 67bdfff0 daddiu sp,sp,-16
163     a80000000003002c: ffb00000 sd s0,0(sp) [0xffffffffa0007ee0, data=0x0000000000000000]
164     a800000000030030: ffbf0008 sd ra,8(sp) [0xffffffffa0007ee8, data=0xa8000000000300a0]
165     a800000000030034: 90820000 lbu v0,0(a0) [0xa8000000000300b8 = $LC0, data=0x48]
166     a800000000030038: 00021600 sll v0,v0,24
167     GXemul&gt; <b>print v0</b>
168     v0 = 0x0000000048000000
169 dpavlin 12 GXemul&gt; <b>_</b>
170 dpavlin 2 </pre>
171    
172 dpavlin 12 <p>The syntax of the single-step debugger shouldn't be too hard to grasp.
173     Type "<tt>s</tt>" to single-step one instruction. For some commands (e.g.
174     the single-step command), just pressing enter on a blank line will cause
175     the last command to be repeated. Type "<tt>quit</tt>" to quit.
176 dpavlin 2
177     <p>
178     Hopefully this is enough to get you inspired. :-)
179    
180    
181    
182    
183    
184    
185     <p><br>
186     <a name="expdevices"></a>
187     <h3>Experimental devices:</h3>
188    
189 dpavlin 6 The emulator has several modes where it doesn't emulate any real machine.
190     It can either run in "bare" mode, where no devices are included by default
191     (just the CPU), or in a "test" mode where some simple devices are
192     emulated.
193    
194 dpavlin 12 <p>The test machines (<tt>testmips</tt>, <tt>testppc</tt>, etc) have the
195     following experimental devices:
196 dpavlin 2
197     <p>
198     <center><table border="0" width="80%">
199    
200     <tr>
201     <td align="left" valign="top" width="200">
202 dpavlin 8 <b><tt>cons</tt>:</b>
203 dpavlin 12 <p>A simple console device, for writing
204     characters to the controlling terminal
205     and receiving keypresses.
206 dpavlin 8 <p>Source code:&nbsp;&nbsp;<font color="#0000f0"><tt>src/devices/dev_cons.c</tt></font>
207 dpavlin 2 <br>Default physical address:&nbsp&nbsp;<font color="#0000f0">0x10000000</font>
208     </td>
209     <td align="left" valign="top" width="25">&nbsp;</td>
210     <td align="left" valign="top">
211     <table border="0">
212     <tr>
213     <td align="left" valign="top"><i><u>Offset:</u></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
214     <td align="left" valign="top"><i><u>Effect:</u></i></td>
215     </tr>
216     <tr>
217 dpavlin 12 <td align="left" valign="top"><tt>0x00</tt></td>
218 dpavlin 2 <td align="left" valign="top">
219 dpavlin 12 Read: <b><tt>getchar()</tt></b> (non-blocking; returns
220     <tt>0</tt> if no char was available)<br>
221 dpavlin 8 Write: <b><tt>putchar(ch)</tt></b></td>
222 dpavlin 2 </tr>
223     <tr>
224 dpavlin 12 <td align="left" valign="top"><tt>0x10</tt></td>
225 dpavlin 8 <td align="left" valign="top">Read or write: <b><tt>halt()</tt></b><br>
226 dpavlin 2 (Useful for exiting the emulator.)</td>
227     </tr>
228     </table>
229     </td>
230     </tr>
231    
232     <tr height="15">
233     <td height="15">&nbsp;</td>
234     </tr>
235    
236     <tr>
237     <td align="left" valign="top">
238 dpavlin 8 <b><tt>mp</tt>:</b>
239 dpavlin 2 <p>This device controls the behaviour of CPUs in an emulated
240     multi-processor system.
241 dpavlin 8 <p>Source code:&nbsp;&nbsp;<font color="#0000f0"><tt>src/devices/dev_mp.c</tt></font>
242 dpavlin 2 <br>Default physical address:&nbsp&nbsp;<font color="#0000f0">0x11000000</font>
243     </td>
244     <td></td>
245     <td align="left" valign="top">
246     <table border="0">
247     <tr>
248     <td align="left" valign="top"><i><u>Offset:</u></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
249     <td align="left" valign="top"><i><u>Effect:</u></i></td>
250     </tr>
251     <tr>
252 dpavlin 12 <td align="left" valign="top"><tt>0x0000</tt></td>
253 dpavlin 8 <td align="left" valign="top">Read: <b><tt>whoami()</tt></b>.
254 dpavlin 2 Returns the id of the CPU doing the read.</td>
255     </tr>
256     <tr>
257 dpavlin 12 <td align="left" valign="top"><tt>0x0010</tt></td>
258 dpavlin 8 <td align="left" valign="top">Read: <b><tt>ncpus()</tt></b>.
259 dpavlin 2 Returns the number of CPUs in the system.</td>
260     </tr>
261     <tr>
262 dpavlin 12 <td align="left" valign="top"><tt>0x0020</tt></td>
263 dpavlin 8 <td align="left" valign="top">Write: <b><tt>startupcpu(i)</tt></b>.
264 dpavlin 2 Starts CPU i. It begins execution at the address
265     set by a write to startupaddr (see below).</td>
266     </tr>
267     <tr>
268 dpavlin 12 <td align="left" valign="top"><tt>0x0030</tt></td>
269 dpavlin 8 <td align="left" valign="top">Write: <b><tt>startupaddr(addr)</tt></b>.
270 dpavlin 2 Sets the starting address for CPUs.</td>
271     </tr>
272     <tr>
273 dpavlin 12 <td align="left" valign="top"><tt>0x0040</tt></td>
274 dpavlin 8 <td align="left" valign="top">Write: <b><tt>pause_addr(addr)</tt></b>.
275 dpavlin 2 Sets the pause address. (TODO: This is not
276     used anymore?)</td>
277     </tr>
278     <tr>
279 dpavlin 12 <td align="left" valign="top"><tt>0x0050</tt></td>
280 dpavlin 8 <td align="left" valign="top">Write: <b><tt>pause_cpu(i)</tt></b>.
281 dpavlin 2 Stops all CPUs <i>except</i> CPU i.</td>
282     </tr>
283     <tr>
284 dpavlin 12 <td align="left" valign="top"><tt>0x0060</tt></td>
285 dpavlin 8 <td align="left" valign="top">Write: <b><tt>unpause_cpu(i)</tt></b>.
286 dpavlin 2 Unpauses all CPUs <i>except</i> CPU i.</td>
287     </tr>
288     <tr>
289 dpavlin 12 <td align="left" valign="top"><tt>0x0070</tt></td>
290 dpavlin 8 <td align="left" valign="top">Write: <b><tt>startupstack(addr)</tt></b>.
291 dpavlin 2 Sets the startup stack address. (CPUs started with
292     startupcpu() above will have their stack pointer
293     set to this value.)</td>
294     </tr>
295     <tr>
296 dpavlin 12 <td align="left" valign="top"><tt>0x0080</tt></td>
297 dpavlin 8 <td align="left" valign="top">Read: <b><tt>hardware_random()</tt></b>.
298 dpavlin 2 This produces a "random" number.</td>
299     </tr>
300     <tr>
301 dpavlin 12 <td align="left" valign="top"><tt>0x0090</tt></td>
302 dpavlin 8 <td align="left" valign="top">Read: <b><tt>memory()</tt></b>.
303 dpavlin 2 Returns the number of bytes of RAM in the system.</td>
304     </tr>
305 dpavlin 8 <tr>
306 dpavlin 12 <td align="left" valign="top"><tt>0x00a0</tt></td>
307 dpavlin 8 <td align="left" valign="top">Write: <b><tt>ipi_one((nr &lt;&lt; 16) + cpuid)</tt></b>.
308     Sends IPI <tt>nr</tt> to a specific CPU.</td>
309     </tr>
310     <tr>
311 dpavlin 12 <td align="left" valign="top"><tt>0x00b0</tt></td>
312 dpavlin 8 <td align="left" valign="top">Write: <b><tt>ipi_many((nr &lt;&lt; 16) + cpuid)</tt></b>.
313     Sends IPI <tt>nr</tt> to all CPUs <i>except</i>
314     the specified one.</td>
315     </tr>
316     <tr>
317 dpavlin 12 <td align="left" valign="top">0x00c0</tt></td>
318 dpavlin 8 <td align="left" valign="top">Read: <b><tt>ipi_read()</tt></b>.
319     Returns the next pending IPI. 0 is returned if there is no
320     pending IPI (so 0 shouldn't be used for valid IPIs).
321     Hardware int 6 is deasserted when the IPI queue is empty.
322     <br>Write: <b><tt>ipi_flush()</tt></b>.
323     Clears the IPI queue, discarding any pending IPIs.</td>
324     </tr>
325 dpavlin 2 </table>
326     </td>
327     </tr>
328    
329     <tr height="15">
330     <td height="15">&nbsp;</td>
331     </tr>
332    
333     <tr>
334     <td align="left" valign="top">
335 dpavlin 8 <b><tt>fb</tt>:</b>
336 dpavlin 2 <p>A simple linear framebuffer, for graphics output.
337     640 x 480 pixels, 3 bytes per pixel (red, green, blue, 8 bits each).
338 dpavlin 8 <p>Source code:&nbsp;&nbsp;<font color="#0000f0"><tt>src/devices/dev_fb.c</tt></font>
339 dpavlin 2 <br>Default physical address:&nbsp&nbsp;<font color="#0000f0">0x12000000</font>
340     </td>
341     <td></td>
342     <td align="left" valign="top">
343     <table border="0">
344     <tr>
345     <td align="left" valign="top"><i><u>Offset:</u></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
346     <td align="left" valign="top"><i><u>Effect:</u></i></td>
347     </tr>
348     <tr>
349 dpavlin 12 <td align="left" valign="top"><tt>0x00000-</tt><br><tt>0xe0fff</tt></td>
350 dpavlin 2 <td align="left" valign="top">Read: read pixel values.
351     <br>Write: write pixel values.</td>
352     </tr>
353     </table>
354     </td>
355     </tr>
356    
357 dpavlin 12 <tr height="15">
358     <td height="15">&nbsp;</td>
359     </tr>
360    
361     <tr>
362     <td align="left" valign="top">
363     <b><tt>disk</tt>:</b>
364     <p>Disk controller, which can read from and write
365     to disk images. It does not use interrupts; read and
366     write operations finish instantaneously.
367     <p>Source code:&nbsp;&nbsp;<font color="#0000f0"><tt>src/devices/dev_disk.c</tt></font>
368     <br>Default physical address:&nbsp&nbsp;<font color="#0000f0">0x13000000</font>
369     </td>
370     <td></td>
371     <td align="left" valign="top">
372     <table border="0">
373     <tr>
374     <td align="left" valign="top"><i><u>Offset:</u></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
375     <td align="left" valign="top"><i><u>Effect:</u></i></td>
376     </tr>
377     <tr>
378     <td align="left" valign="top"><tt>0x0000</tt></td>
379     <td align="left" valign="top">Write: Set the offset (in bytes) from the beginning
380     of the disk image. This offset will be used for the next read/write operation.</td>
381     </tr>
382     <tr>
383     <td align="left" valign="top"><tt>0x0010</tt></td>
384     <td align="left" valign="top">Write: Select the SCSI ID to be used in the next
385     read/write operation.</td>
386     </tr>
387     <tr>
388     <td align="left" valign="top"><tt>0x0020</tt></td>
389     <td align="left" valign="top">Write: Start a read or write operation.
390     (Writing <tt>0</tt> means a Read operation, a <tt>1</tt> means a
391     Write operation.)</td>
392     </tr>
393     <tr>
394     <td align="left" valign="top"><tt>0x0030</tt></td>
395     <td align="left" valign="top">Read: Get status of the last operation.
396     (Status 0 means failure, non-zero means success.)</td>
397     </tr>
398     <tr>
399     <td align="left" valign="top"><tt>0x4000-</tt><br><tt>0x41ff</tt>&nbsp;&nbsp;&nbsp;</td>
400     <td align="left" valign="top">Read/Write: 512 bytes data buffer.</td>
401     </tr>
402     </table>
403     </td>
404     </tr>
405    
406     <tr height="15">
407     <td height="15">&nbsp;</td>
408     </tr>
409    
410     <tr>
411     <td align="left" valign="top">
412     <b><tt>ether</tt>:</b>
413     <p>A simple ethernet controller, enough to send
414     and receive packets on a simulated network.
415     <p>Source code:&nbsp;&nbsp;<font color="#0000f0"><tt>src/devices/dev_ether.c</tt></font>
416     <br>Default physical address:&nbsp&nbsp;<font color="#0000f0">0x14000000</font>
417     </td>
418     <td></td>
419     <td align="left" valign="top">
420     <table border="0">
421     <tr>
422     <td align="left" valign="top"><i><u>Offset:</u></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
423     <td align="left" valign="top"><i><u>Effect:</u></i></td>
424     </tr>
425     <tr>
426     <td align="left" valign="top"><tt>0x0000-</tt><br><tt>0x3fff</tt></td>
427     <td align="left" valign="top">Read/write buffer for the packet to be sent/received.</td>
428     </tr>
429     <tr>
430     <td align="left" valign="top"><tt>0x4000</tt></td>
431     <td align="left" valign="top">Read: status word, one or more of these:
432     <br><tt>0x01</tt>&nbsp;=&nbsp;something was received (because of
433     the last command)
434     <br><tt>0x02</tt>&nbsp;=&nbsp;more packets are available
435     <br><i>NOTE:</i> Whenever the status word is non-zero,
436     an interrupt is asserted. Reading the status word
437     clears it, and deasserts the interrupt.</td>
438     </tr>
439     <tr>
440     <td align="left" valign="top"><tt>0x4010</tt></td>
441     <td align="left" valign="top">Read: get the Length of the received packet
442     <br>Write: set the Length of the next packet to transmit</td>
443     </tr>
444     <tr>
445     <td align="left" valign="top"><tt>0x4020</tt></td>
446     <td align="left" valign="top">Write: command:
447     <br><tt>0x00:</tt>&nbsp;receive a packet
448     <br><tt>0x01:</tt>&nbsp;send a packet</td>
449     </tr>
450     </table>
451     </td>
452     </tr>
453    
454 dpavlin 2 </table></center>
455    
456     <p>
457     While these devices may resemble real-world hardware, they are
458     intentionally made simpler to use. (An exception is the framebuffer;
459     some machines actually have simple linear framebuffers like this.)
460    
461 dpavlin 12 <p>If the physical address is <tt>0x10000000</tt>, then for MIPS that
462     means that it can be accessed at virtual address
463     <tt>0xffffffffb0000000</tt>. (Actually it can be accessed at
464     <tt>0xffffffff90000000</tt> too, but devices should usually be accessed in
465     a non-cached manner.)
466 dpavlin 2
467 dpavlin 12 <p> (When using the PPC test machine (<tt>testppc</tt>), the addresses are
468     <tt>0x10000000</tt>, <tt>0x11000000</tt> etc., so no need to add any
469     virtual displacement.)
470 dpavlin 2
471 dpavlin 12 <p>The <b><tt>mp</tt></b>, <b><tt>disk</tt></b>, and <b><tt>ether</tt></b>
472     devices are agnostic when it comes to word-length. For example, when
473     reading offset <tt>0x0000</tt> of the <b><tt>mp</tt></b>
474     device, you may use any kind of read (an 8-bit read will work just as well
475     as a 64-bit read, although the value will be truncated to 8 bits in the
476     first case). You can <i>not</i>, however, read one byte from <tt>0x0000</tt>
477     and one from <tt>0x0001</tt>, and combine the result. The read from
478     <tt>0x0001</tt> will be invalid.
479 dpavlin 2
480 dpavlin 8 <p>The <b><tt>cons</tt></b> device should be accessed using 8-bit reads
481 dpavlin 12 and writes. Doing a getchar() (ie reading from offset <tt>0x00</tt>)
482     returns <tt>0</tt> if no character was available.
483 dpavlin 2
484 dpavlin 8 <p>On MIPS, the <b><tt>cons</tt></b> device is hardwired to interrupt 2
485     (the lowest hardware interrupt). Whenever a character is available, the
486     interrupt is asserted. When there are no more available characters, the
487     interrupt is deasserted. (Remember that the interrupt has to be enabled in
488     the status register of the system coprocessor.)
489 dpavlin 2
490 dpavlin 12 <p>The <b><tt>ether</tt></b> device is hardwired to interrupt 3.
491 dpavlin 2
492 dpavlin 12 <p>The IPIs controlled by the <b><tt>mp</tt></b> device are hardwired to
493     interrupt 6. Whenever an IPI is "sent", interrupt 6 is asserted on the
494     target CPU(s), and the IPI number is added last in the IPI queue for that
495     CPU. It is then up to that CPU to read from offset <tt>0x00c0</tt>, to
496     figure out what kind of IPI it was.
497 dpavlin 2
498 dpavlin 12 <p>A simple tutorial on how to use the <tt>disk</tt> device, if not clear
499     from the description above, can be found here: <a
500     href="test_disk.c"><tt>test_disk.c</tt></a>
501 dpavlin 2
502    
503    
504 dpavlin 12
505    
506 dpavlin 2 <p><br>
507     <a name="experiments"></a>
508     <h3>Experiments with other kernels and guest OSes:</h3>
509    
510     <p>
511 dpavlin 6 Free Operating system kernels and other test programs can be
512     downloaded from various places on the Internet. Other kinds of software
513     (non-Free), if obsolete enough (such as Ultrix or Windows NT), can
514     sometimes be found in garbage containers, or perhaps be found for a cheap
515     price on ebay or at a flea market.
516 dpavlin 2
517     <p>
518     <font color="#ff0000">
519     NOTE: This is <i>not</i> a list of kernels that work in the emulator.
520 dpavlin 12 It is a list of kernels that I have experimented with.
521 dpavlin 2 </font>
522    
523     <p>
524     For more information about which of these that actually work, read the
525     <a href="intro.html#guestos">section in the Introduction chapter</a>
526     that lists guest operating systems. If a system is not listed there, it
527     probably doesn't work in GXemul.
528    
529     <p>
530     <ul>
531     <li>DECstation:
532     <ul>
533     <li><a href="http://www.netbsd.org/Ports/pmax/">NetBSD/pmax</a>:
534     <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>
535     <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>
536 dpavlin 12 <br>gunzip the files, and run the emulator with <b><tt>-e 3max -q -N -XY2</tt></b>
537 dpavlin 6 for a graphical framebuffer console. Remove <b><tt>-XY2</tt></b> and <b><tt>-N</tt></b> to use serial (stdin/stdout) console.
538 dpavlin 2 Read <a href="guestoses.html#netbsdinstall">this section</a> about how to install NetBSD/pmax onto a harddisk image.
539     <p>
540     <li><a href="http://www.openbsd.org/pmax.html">OpenBSD/pmax</a>:
541     <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>
542 dpavlin 12 <br>This is an old OpenBSD kernel in a.out format. Try <b><tt>-e 3max</tt></b>.
543 dpavlin 2 <br>Read <a href="guestoses.html#openbsdinstall">this section</a> about how to install OpenBSD/pmax onto a harddisk image.
544 dpavlin 6 It's a bit more complicated than installing NetBSD/pmax, but
545     it usually works.
546 dpavlin 2 <p>
547     <li>Linux for DECstation:
548     <br>Read <a href="guestoses.html#declinux">this section</a> about how to run a Debian Linux install kernel.
549     <br>Here are some older kernels (these don't support framebuffer, I think):
550     <a href="http://www.xs4all.nl/~vhouten/mipsel/kernels.html">http://www.xs4all.nl/~vhouten/mipsel/kernels.html</a>
551 dpavlin 6 <br>Note: Make sure you add <b><tt>-CR4400</tt></b> to the command line for
552 dpavlin 2 R4000 kernels, as Linux doesn't autodetect CPU type at runtime.
553 dpavlin 6 <br>Linux also doesn't detect automatically whether you are booting
554     in graphical or serial console mode, so you need to add
555     <tt><b>-o 'console=ttyS3'</b></tt> or similar for serial
556     console mode.
557 dpavlin 2 <p>
558 dpavlin 6 <li><a href="http://www.cs.berkeley.edu/projects/sprite/retrospective.html">Sprite</a>:
559 dpavlin 2 <br>The Unix Heritage Society (TUHS, <a href="http://www.tuhs.org">www.tuhs.org</a>)
560 dpavlin 6 has preserved a copy of a harddisk image for a DECstation
561     5000/200 (3MAX).
562 dpavlin 2 <br>Read <a href="guestoses.html#sprite">this section</a> for more information
563     about running this harddisk image in the emulator.
564     <p>
565     <li><a href="http://www-2.cs.cmu.edu/afs/cs/project/mach/public/www/mach.html">Mach</a>:
566 dpavlin 6 <br>Important! Run <b><tt>./configure --caches; make</tt></b>
567     <br>Also important: This is broken right now. :-(
568 dpavlin 2 <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>
569 dpavlin 6 <br><tt><b>tar xfvz pmax.tar.Z pmax_mach/special/mach.boot.MK83.STD+ANY</b></tt>
570 dpavlin 12 <br><tt><b>gxemul -e 3max -X pmax_mach/special/mach.boot.MK83.STD+ANY</b></tt>
571 dpavlin 2 </ul>
572     </li>
573    
574     <p>
575    
576     <li>SGI:
577     <ul>
578     <li><a href="http://www.netbsd.org/Ports/sgimips/">NetBSD/sgimips</a>:
579     <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>
580     <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>
581 dpavlin 12 <br>gunzip, and try running with <b><tt>-e ip32</tt></b>.
582 dpavlin 2 <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>
583     <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>
584 dpavlin 12 <br>gunzip, and try running with <b><tt>-e ip22</tt></b> (or <b><tt>ip24</tt></b> or <b><tt>ip20</tt></b>).
585 dpavlin 2 <p>
586     <li>Linux/SGI:
587     <br>Some kernels are available here: <a href="http://www.linux-mips.org/~glaurung/">http://www.linux-mips.org/~glaurung/</a>
588 dpavlin 12 <br>Try running with <b><tt>-e ip32 -X</tt></b> for a graphical framebuffer, or
589     <b><tt>-e ip32 -o 'console=ttyS0'</tt></b> for serial console.
590 dpavlin 6 <br>Adding <b><tt>-b</tt></b> (bintrans) might work sometimes.
591     <br>(You need to add <b><tt>-CR5000</tt></b> if you're trying to run
592     a kernel compiled for R5000, because Linux doesn't autodetect
593     the CPU type at runtime.)
594 dpavlin 2 <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>
595 dpavlin 12 <br>Try <b><tt>-e ip32 -X -CR5000 vmlinux64-2.6.8.1-IP32</tt></b>.
596 dpavlin 2 <br>And also some IP27 kernels:
597     <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>
598     and
599     <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>
600     (but unfortunately these lack symbols).
601 dpavlin 12 <br>Try the IP27 kernels with <b><tt>-e ip27 -t</tt></b>.
602 dpavlin 2 <p>
603     <li><a href="http://www.openbsd.org/sgi.html">OpenBSD/sgi</a>:
604 dpavlin 6 <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>
605     <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>.
606 dpavlin 12 <br>Try <b><tt>gxemul -e ip32 bsd.rd</tt></b>
607 dpavlin 2 <p>
608     <li><a href="http://www.freebsd.org/platforms/mips.html">FreeBSD/MIPS</a>:
609     I don't think public binary snapshots are available yet.
610     <p>
611     <li>arcdiag:
612     <br>The NetBSD people have also made available an "arcdiag" for SGI-IP22:
613     <br><a href="ftp://ftp.netbsd.org/pub/NetBSD/arch/sgimips/arcdiag.ip22">ftp://ftp.netbsd.org/pub/NetBSD/arch/sgimips/arcdiag.ip22</a>
614 dpavlin 12 <br>Try running <tt><b>gxemul -e ip22 -x arcdiag.ip22</b></tt>.
615 dpavlin 2 </ul>
616     </li>
617    
618     <p>
619    
620     <li>ARC:
621     <ul>
622     <li><a href="http://www.netbsd.org/Ports/arc/">NetBSD/arc</a>:
623     <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>
624     <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>
625 dpavlin 12 <br>gunzip, and try with <b><tt>-e rd94</tt></b>.
626 dpavlin 2 <br>(You may also try other ARC models.)
627     <br>Read <a href="guestoses.html#netbsdarcinstall">this section</a> about how
628 dpavlin 6 to install NetBSD/arc 1.6.2 onto a harddisk image.
629     <br>(NetBSD/arc 2.0 doesn't work with disk images yet in GXemul.)
630 dpavlin 2 <p>
631     <li><a href="http://www.openbsd.org/arc.html">OpenBSD/arc</a>:
632     <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>
633 dpavlin 12 <br>Try running with <b><tt>-X -e pica</tt></b> or <b><tt>-X -e tyne</tt></b>.
634 dpavlin 2 <br>Read <a href="guestoses.html#openbsdarcinstall">this section</a> about how
635     to install OpenBSD/arc onto a harddisk image.
636     <p>
637     <li>Linux:
638     <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>
639 dpavlin 12 <br>gunzip, and run with <b><tt>-v -J -X -N -e m700</tt></b> (Olivetti M700)
640 dpavlin 6 <br>(This probably doesn't work anymore.)
641 dpavlin 2 <p>
642     <li>Pandora:
643     <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>
644     <br>A generic test/diagnostics program for ARC-based machines.
645 dpavlin 12 <br>Run with <b><tt>-e r94 milo-0.27.1/pandora</tt></b>
646 dpavlin 2 <p>
647     <li>arcdiag:
648     <br>Precompiled binary:<a href="ftp://ftp.netbsd.org/pub/NetBSD/arch/arc/arcdiag">ftp://ftp.netbsd.org/pub/NetBSD/arch/arc/arcdiag</a>
649     <br>(alternative: <a href="http://www.sensi.org/~alec/mips/arcdiag">http://www.sensi.org/~alec/mips/arcdiag</a>)
650     <br>A generic test/diagnostics program for ARC-based machines.
651 dpavlin 12 <br>Run with <b><tt>-e pica arcdiag</tt></b> (or some other ARC mode).
652 dpavlin 2 <br>Example arcdiag output (from real machines):
653     <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)
654     <br><a href="http://www.sensi.org/~alec/mips/arcdiag.txt">http://www.sensi.org/~alec/mips/arcdiag.txt</a> (PICA-61)
655     <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)
656     <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)
657     <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)
658 dpavlin 6 <br>For some machines, such as <tt><b>-e pica</b></tt>, you can
659     add <b><tt>-X</tt></b> to boot with a graphical VGA-style
660     console. This however is probably a bit unstable and/or
661     broken right now.
662     <p>
663     <li>Windows NT:
664     <br>Put a "Windows NT 4.0 for MIPS" CDROM (or similar) into
665     your CDROM drive. (On FreeBSD systems, it is usually called
666     /dev/cd0c or similar. Change that to whatever the CDROM
667     is called on your system, or the name of a raw .iso image.)
668     <br>I have tried this with the Swedish version, but it might
669     work with other versions too.<pre>
670     $ <b><tt>dd if=/dev/zero of=winnt_test.img bs=1024 count=1 seek=999000</tt></b>
671 dpavlin 12 $ <b><tt>gxemul -X -e pica -d winnt_test.img -d bc6:/dev/cd0c -j MIPS\\ARCINST</tt></b>
672     $ <b><tt>gxemul -X -e pica -d winnt_test.img -d bc6:/dev/cd0c -j MIPS\\SETUPLDR</tt></b>
673 dpavlin 6 </pre> <br><tt>ARCINST</tt> tries to prepare the disk image for installation. (It <i>almost</i> works.)
674     <br><tt>SETUPLDR</tt> should load some drivers from the cdrom, but then it crashes with a bluescreen.
675 dpavlin 2 </ul>
676     </li>
677    
678     <p>
679    
680     <li>HPCmips:
681     <ul>
682     <li><a href="http://www.netbsd.org/Ports/hpcmips/">NetBSD/hpcmips</a>:
683     <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>
684 dpavlin 12 <br>Try <b><tt>gxemul -X -e mobilepro770 netbsd</tt></b>
685 dpavlin 2 <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>
686 dpavlin 12 <br>Try <b><tt>gxemul -X -e mobilepro770 netbsd-GENERIC</tt></b>
687 dpavlin 2 <p>
688     <li>Linux for BE300:
689     <br><a href="http://www.linux4.be/2004/linux4be20040908.zip">http://www.linux4.be/2004/linux4be20040908.zip</a>
690 dpavlin 12 <br>Try <b><tt>gxemul -X -e be300 vmlinux</tt></b>
691 dpavlin 2 <p>
692     <li>Linux for Agenda VR3:
693     <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>
694     <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>.
695     <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>)
696 dpavlin 12 <br>Try <b><tt>gxemul -X -e vr3 -x 0xbf200000:root1.2.6.cramfs 0xbf000000:0:0xbf0005e0:root1.2.6.kernel-8.00</tt></b>
697 dpavlin 2 <br>(or replace root1.2.6.cramfs with dream-1-noxip.cramfs)
698 dpavlin 6 <br>Remove <b><tt>-X</tt></b> to try with serial console instead of X, and
699     remove <b><tt>-b</tt></b> to try without (old) bintrans.
700     <br>Add <b><tt>-o 'init=/bin/sh'</tt></b> to boot into a single-user shell.
701     <br>Add <b><tt>-o 'init=/sbin/restore_defaults'</tt></b> to run
702     a <tt>/sbin/restore_defaults</tt> (attempt to initialize the
703     flash memory).
704 dpavlin 2 <p>
705     <li>Linux for MobilePro etc.:
706     <br><a href="http://pc1.peanuts.gr.jp/~kei/Hard-Float/Kernels/">http://pc1.peanuts.gr.jp/~kei/Hard-Float/Kernels/</a>
707     <br>Uncompress the archive to get a kernel, vmlinux-800 for example.
708 dpavlin 12 <br>Try <b><tt>./gxemul -X -o 'root=/dev/hda1' -d r:disk.img -d r:disk.img -e mobilepro800 vmlinux-800</tt></b>
709 dpavlin 2 <br>where disk.img is an ext2fs filesystem with contents from
710     <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>
711     <br>(Note the double disk arguments.)
712     <br>Note 2: This doesn't work yet.
713     <p>
714     <li><a href="http://www.disorder.ru/openbsd/be300/">OpenBSD/be300</a>:
715     <br><a href="http://www.disorder.ru/openbsd/be300/bsd.rd">http://www.disorder.ru/openbsd/be300/bsd.rd</a>
716 dpavlin 12 <br>Try <b><tt>gxemul -X -e be300 bsd.rd</tt></b>
717 dpavlin 10 <br>Note: bintrans might be buggy, so you can try with -B if you want to.
718 dpavlin 2 </ul>
719     </li>
720    
721     <p>
722    
723 dpavlin 6 <li>Cobalt:
724     <ul>
725     <li><a href="http://www.netbsd.org/Ports/cobalt/">NetBSD/cobalt</a>:
726     <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>
727     <br>gunzip, and run with <b><tt>-E cobalt</tt></b>
728     <br>(Or read <a href="guestoses.html#netbsdcobaltinstall">this
729     section</a> on how to install NetBSD/cobalt onto a harddisk image.)
730     <p>
731     <li>Linux:
732     <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>
733     <br>gunzip, and run with <b><tt>-E cobalt</tt></b>
734 dpavlin 12 <p>
735     <br><a href="http://dev.gentoo.org/~kumba/mips/cobalt/netboot/cobalt-netboot-20040428.img.gz">http://dev.gentoo.org/~kumba/mips/</a>
736     <br> <a href="http://dev.gentoo.org/~kumba/mips/cobalt/netboot/cobalt-netboot-20040428.img.gz">cobalt/netboot/cobalt-netboot-20040428.img.gz</a>
737     <br><b><tt>gxemul -E cobalt cobalt-netboot-20040428.img.gz</tt></b>
738 dpavlin 6 <p>
739     <li>CoLo:
740     <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>
741     <br><tt><b>tar zxvf colo-1.19.tar.gz colo-1.19/binaries/colo-rom-image.bin</b></tt>
742     <br><tt><b>gxemul -Q -Ecobalt -v 0xbfc00000:colo-1.19/binaries/colo-rom-image.bin</b></tt>
743     <br>(This doesn't work yet.)
744     </ul>
745     </li>
746    
747     <p>
748    
749 dpavlin 2 <li>Playstation 2:
750     <ul>
751     <li><a href="http://www.netbsd.org/Ports/playstation2/">NetBSD/playstation2</a>:
752     <br>NetBSD/playstation2 snapshot kernels are available here: (RAMDISK and GENERIC)
753     <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>
754     <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>
755 dpavlin 6 <br>Try running with <b><tt>-X -E playstation2</tt></b> (<b><tt>-X</tt></b> is required, for the framebuffer).
756 dpavlin 2
757     <p>
758     <li>Linux:
759     <br>A Linux kernel (2.2.21-pre1-xr7) is available from
760     <a href="http://playstation2-linux.com/projects/xrhino-kernel/">http://playstation2-linux.com/projects/xrhino-kernel/</a>
761 dpavlin 6 <br>Try running with <b><tt>-X -E playstation2</tt></b> (<b><tt>-X</tt></b> is required, for the framebuffer).
762 dpavlin 2 </ul>
763     </li>
764    
765 dpavlin 10 <p>
766    
767     <li>EVBMIPS:
768     <ul>
769     <li><a href="http://www.netbsd.org/Ports/evbmips/">NetBSD/evbmips</a>:
770     <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>
771 dpavlin 12 <br><b><tt>gxemul -e malta netbsd-MALTA</tt></b>
772 dpavlin 10 <br>The default CPU is a 5Kc (MIPS64). Add
773     <tt>-C 4Kc</tt> to use a MIPS32 CPU instead.
774     <br>(NetBSD/evbmips runs in 32-bit mode on MIPS64 anyway...)
775     <br>Read <a href="guestoses.html#netbsdevbmipsinstall">this
776     section</a> on how to install NetBSD/evbmips onto a harddisk image.
777     <br>or
778     <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>
779 dpavlin 12 <br><b><tt>gxemul -e pb1000 netbsd-PB1000</tt></b>
780 dpavlin 10 </ul>
781     </li>
782    
783 dpavlin 2 </ul>
784    
785     <p>
786 dpavlin 8 The following don't work at all, or just very very little.
787 dpavlin 2
788     <p>
789     <ul>
790     <li>Sony NeWS:
791     <ul>
792     <li><a href="http://www.netbsd.org/Ports/newsmips/">NetBSD/newsmips</a>:
793     <br>A NetBSD/newsmips kernel and corresponding symbols are
794     available here:
795     <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>
796     <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>
797 dpavlin 6 <br>Try running with <b><tt>-E sonynews</tt></b>.
798 dpavlin 2 <br>There's also a boot floppy available, but the emulator currently
799     doesn't support booting from it:
800     <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>
801     </ul>
802     </li>
803    
804     <p>
805    
806     <li><a href="http://www.meshcube.org/">MeshCube</a>:
807     <ul>
808     <li>Linux:
809     <br>A Linux kernel is available from
810     <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>
811 dpavlin 6 <br>(This is a Debian package, you can use <tt><b>ar</b></tt> and
812     <tt><b>tar</b></tt> to extract kernel.img from it.)
813     <br>Try running with <b><tt>-E meshcube 0x80800000:kernel.img</tt></b>.
814 dpavlin 2 </ul>
815     </li>
816    
817     <p>
818    
819     <li><a href="http://www.seattlewireless.net/index.cgi/NetgearWG602">NetGear WG602</a>:
820     <ul>
821     <li>Linux:
822     <br>A Linux kernel is available from
823     <a href="ftp://downloads.netgear.com/files/wg602_v1715.zip">ftp://downloads.netgear.com/files/wg602_v1715.zip</a>
824     <br>(Unzip wg602_v1715.zip to get WG602_V1715.img.)
825 dpavlin 6 <br>Try running with <b><tt>-E netgear 0xbfc80000:0x40:WG602_V1715.img</tt></b>.
826 dpavlin 2 <br>(It takes some time to decompress the kernel, so be patient.)
827 dpavlin 6 <br>(This doesn't really work yet.)
828 dpavlin 2 </ul>
829     </li>
830    
831 dpavlin 8 <p>
832 dpavlin 2
833     <li>Walnut (evbppc):
834     <ul>
835     <li><a href="http://www.netbsd.org/Ports/evbppc/">NetBSD/evbppc</a>:
836     <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>
837     <br>gunzip, and try the following:
838 dpavlin 6 <br><tt><b>gxemul -E walnut -v -t netbsd-INSTALL_WALNUT</b></tt>
839 dpavlin 2 </ul>
840     </li>
841    
842     <p>
843    
844     <li>Artesyn's PM/PPC board (pmppc):
845     <ul>
846     <li><a href="http://www.netbsd.org/Ports/pmppc/">NetBSD/pmppc</a>:
847     <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>
848     <br>gunzip, and try the following:
849 dpavlin 6 <br><tt><b>gxemul -E pmppc netbsd-INSTALL</b></tt>
850 dpavlin 2 </ul>
851     </li>
852    
853     <p>
854    
855     <li>Motorola Sandpoint (sandpoint):
856     <ul>
857     <li><a href="http://www.netbsd.org/Ports/sandpoint/">NetBSD/sandpoint</a>:
858     <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>
859     <br>gunzip, and try the following:
860 dpavlin 6 <br><tt><b>gxemul -E sandpoint -v -t netbsd-INSTALL</b></tt>
861 dpavlin 2 </ul>
862     </li>
863    
864     <p>
865    
866     <li>PReP:
867     <ul>
868     <li><a href="http://www.netbsd.org/Ports/prep/">NetBSD/prep</a>:
869     <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>
870     <br>gunzip, and try the following:
871 dpavlin 6 <br><tt><b>gxemul -E prep -v -t netbsd-INSTALL</b></tt>
872 dpavlin 2 <p>
873     <li>Linux:
874     <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>
875 dpavlin 6 <br><tt><b>gxemul -E prep -v -t vmlinux</b></tt>
876 dpavlin 2 </ul>
877     </li>
878    
879     <p>
880    
881     <li>MacPPC:
882     <ul>
883     <li><a href="http://www.netbsd.org/Ports/macppc/">NetBSD/macppc</a>:
884     <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>
885 dpavlin 6 <br><tt><b>gxemul -E macppc -e g4 -t netbsd-INSTALL</b></tt>
886 dpavlin 2 <p>
887     <li><a href="http://www.openbsd.org/macppc.html">OpenBSD/macppc</a>:
888     <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>
889 dpavlin 6 <br><tt><b>gxemul -E macppc -e g4 -t bsd.rd</b></tt>
890 dpavlin 2 </ul>
891     </li>
892    
893     <p>
894    
895     <li>BeBox:
896     <ul>
897     <li><a href="http://www.netbsd.org/Ports/bebox/">NetBSD/bebox</a>:
898     <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>
899 dpavlin 6 <br><tt><b>tar xvzf kern.tgz</b></tt>
900     <br><tt><b>gxemul -E bebox netbsd</b></tt>
901 dpavlin 2 <p>
902     <li><a href="http://www.bebox.nu/os.php?s=os/linux/index">Linux/bebox</a>:
903     <br><a href="http://www.bebox.nu/files/linux/BeBox-scsi-980610.gz">http://www.bebox.nu/files/linux/BeBox-scsi-980610.gz</a>
904 dpavlin 6 <br><tt><b>gunzip BeBox-scsi-980610.gz</b></tt>
905     <br><tt><b>gxemul -E bebox 0x3100:0x400:BeBox-scsi-980610</b></tt>
906 dpavlin 2 </ul>
907     </li>
908    
909     <p>
910    
911     <li>SPARC64:
912     <ul>
913     <li><a href="http://www.netbsd.org/Ports/sparc64/">NetBSD/sparc64</a>:
914     <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>
915     <br>gunzip, and try the following:
916 dpavlin 6 <br><tt><b>gxemul -E ultra1 -v -i netbsd-INSTALL</b></tt>
917 dpavlin 2 <p>
918     <li><a href="http://www.openbsd.org/sparc64.html">OpenBSD/sparc64</a>:
919     <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>
920     <br>rename to bsd.rd.gz, gunzip, and try the following:
921 dpavlin 6 <br><tt><b>gxemul -E ultra1 -v -i bsd.rd</b></tt>
922 dpavlin 2 </ul>
923     </li>
924     </ul>
925    
926    
927    
928    
929    
930    
931    
932     </p>
933    
934     </body>
935     </html>

  ViewVC Help
Powered by ViewVC 1.1.26