File: machine_sgi_o2.html

package info (click to toggle)
gxemul 0.7.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,152 kB
  • sloc: ansic: 111,065; sh: 972; exp: 354; makefile: 118
file content (571 lines) | stat: -rw-r--r-- 20,850 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>GXemul: SGI O2 emulation</title>
  <meta name="robots" content="noarchive,nofollow,noindex">
</head>
<body style="font-family : sans-serif;">

<!-- 10 lines header.  -->

<h1>GXemul: SGI O2 emulation</h1>
<p>

<a href="./">Back to the index.</a>

<!--

Copyright (C) 2003-2021  Anders Gavare.  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
   derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

-->




<p>The SGI O2 emulation mode tries to emulate enough of the main MIPS
processor and other peripherals of a real
<a href="http://en.wikipedia.org/wiki/SGI_O2">SGI O2</a> machine, to be
able to boot guest OSes.

<p>
Emulated hardware:
<ul>
	<li>MIPS R10000 main CPU.
	<li>RAM: Up to 256 MB works well, up to 1 GB (max of what a real O2 can handle) works with OpenBSD/sgi (and possibly the raw PROM)
	<li>Interrupt controllers, etc.
	<li>Serial port
	<li>On-board O2 graphics; works well enough to run NetBSD/sgimips with X11.
	<li>PS/2 Keyboard and mouse
	<li>Ethernet, enough to (barely) run OpenBSD and NetBSD with root-on-nfs.
</ul>

<p>Things not yet emulated include: SCSI, audio/video boards, the VICE chipset, ...

<p>This page contains instructions for how to install and run:

<ul>
	<li><a href="#netbsdsgimips">NetBSD/sgimips</a>
	<li><a href="#openbsdsgiinstall">OpenBSD/sgi</a>
	<li><small><a href="#linuxforo2"><font color="red">Linux for O2</font></a> (not yet)</small>
	<li><small><a href="#IRIX"><font color="red">IRIX</font></a> (not yet)</small>
</ul>

<p>and also some hints on how to make a <a href="#prom">backup copy of the PROM</a> from your own O2 and run it in the emulator.




<p><br>
<a name="netbsdsgimips"></a>
<h3>NetBSD/sgimips:</h3>

<p>
<a href="20060623-netbsd-sgimips-3.0.png"><img src="20060623-netbsd-sgimips-3.0_small.png"></a>
<a href="20190612-netbsd-sgimips-1.png"><img src="20190612-netbsd-sgimips-1_small.png"></a>
<a href="20190612-netbsd-sgimips-2.png"><img src="20190612-netbsd-sgimips-2_small.png"></a>

<p><a href="http://www.netbsd.org/ports/sgimips/">NetBSD/sgimips</a> can run
in GXemul on an emulated SGI O2 (also known as IP32). The SCSI controller
is not emulated yet, so NetBSD needs to boot with root-on-NFS:

<p>
<ol>
  <li>First of all, an "<tt>nfs server</tt>" machine must be set up.
	This needs to have a 4000 MB <tt>/tftpboot</tt> partition.
	<a href="machine_decstation.html#netbsdpmaxinstall">Install NetBSD/pmax 8.0 from CDROM</a>.
	Do not configure the network and do not install any X11 packages on the
	nfs server, as they are not needed.
	<i>Don't forget to add the extra partition!</i>
  <p>

  <li>Download the files corresponding to a NetBSD/sgimips CD-ROM iso image, and the
	GENERIC and INSTALL kernels:<pre>
	<a href="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-8.0/sgimips/binary/kernel/netbsd-GENERIC32_IP3x.gz">ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-8.0/sgimips/binary/kernel/netbsd-GENERIC32_IP3x.gz</a>
	<a href="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-8.0/sgimips/binary/kernel/netbsd-INSTALL32_IP3x.gz">ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-8.0/sgimips/binary/kernel/netbsd-INSTALL32_IP3x.gz</a>

	wget -np -l 0 -r <a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-8.0/sgimips/binary/sets/">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-8.0/sgimips/binary/sets/</a>
	mkisofs -U -o sgimips.iso ftp.netbsd.org/pub/NetBSD/NetBSD-8.0

</pre>
  <li>Start the DECstation emulation:<pre>
	<b>gxemul -e 3max -d nbsd_pmax.img -d sgimips.iso</b>

</pre>Log in as root, configure the pmax machine as an NFS server,
	and extract the files from the sgimips CD-ROM image:
<p><table border="0"><tr><td><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td><pre>
<b>echo hostname=server &gt;&gt; /etc/rc.conf
echo ifconfig_le0=\"inet 10.0.0.2\" &gt;&gt; /etc/rc.conf
echo nameserver 10.0.0.254 &gt;&gt; /etc/resolv.conf
echo 10.0.0.254 &gt; /etc/mygate
echo /tftpboot -maproot=root 10.0.0.1 &gt; /etc/exports
echo rpcbind=YES &gt;&gt; /etc/rc.conf
echo nfs_server=YES &gt;&gt; /etc/rc.conf
echo mountd=YES &gt;&gt; /etc/rc.conf
echo bootparamd=YES &gt;&gt; /etc/rc.conf
printf "client root=10.0.0.2:/tftpboot \\\n swap=10.0.0.2:/tftpboot/swap\n" &gt; /etc/bootparams
echo "bootps dgram udp wait root /usr/sbin/bootpd bootpd -d 4 -h 10.0.0.2" &gt;&gt; /etc/inetd.conf
cat &gt;&gt; /etc/bootptab
client:\
        :ht=ether:\
        :ha=082030000010:\
        :sm=255.0.0.0:\
        :lg=10.0.0.254:\
        :ip=10.0.0.1:\
        :rp=/tftpboot:
</b>(press CTRL-D)
<b>echo "08:20:30:00:00:10 client" &gt; /etc/ethers
echo 10.0.0.1 client &gt; /etc/hosts

cd /tftpboot; mount /dev/cd0a /mnt
for a in /mnt/*/binary/sets/[bcegmtx]*.tgz; do echo $a; tar zxfp $a; done
echo 10.0.0.2:/tftpboot / nfs rw 0 0 &gt; /tftpboot/etc/fstab
echo rc_configured=YES &gt;&gt; /tftpboot/etc/rc.conf
echo 10.0.0.254 &gt;&gt; /tftpboot/etc/mygate
echo nameserver 10.0.0.254 &gt;&gt; /tftpboot/etc/resolv.conf
echo rc_configured=YES &gt;&gt; /tftpboot/etc/rc.conf
dd if=/dev/zero of=swap bs=1024 count=262144
cd /; umount /mnt; halt</b>
</pre></td></tr></table>
  <p>
  <li>Create a configuration file called <tt>config_client</tt>:
<table border="0"><tr><td><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td><pre>
<font color="#2020cf">!  Configuration file for running NetBSD/sgimips diskless with
!  a NetBSD/pmax machine as the nfs server.</font>

<b>net(
	add_remote("localhost:12444")   </b>! the server<b>
	local_port(12445)               </b>! the client<b>
)

machine(
	name("client machine")
	serial_nr(1)

        type("sgi")
        subtype("o2")
	use_x11(1)
	memory(256)

        load("netbsd-INSTALL32_IP3x.gz")</b>
        ! load("netbsd-GENERIC32_IP3x.gz")<b>
)
</b>
</pre></td></tr></table>
	... and another configuration file for the server,
	<tt>config_server</tt>:
<table border="0"><tr><td><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td><pre>
<b>net(
	local_port(12444)               </b>! the server<b>
	add_remote("localhost:12445")   </b>! the client<b>
)

machine(
	name("nfs server")
	serial_nr(2)

        type("dec")
        subtype("5000/200")

        disk("nbsd_pmax.img")
)
</b>
</pre></td></tr></table>
  <li>Boot the "<tt>nfs server</tt>" and the NetBSD/sgimips
	"<tt>client machine</tt>" as two separate emulator instances:<pre>
	in one xterm:
	<b>gxemul @config_server</b>

	and then, in another xterm:
	<b>gxemul @config_client</b>

</pre>
  <li>In the NetBSD/sgimips window, choose "<tt>x: Exit Install System</tt>"
	in the installer's main menu, and then type:<pre>
	<b>ifconfig mec0 10.0.0.1; route add default 10.0.0.254</b>
	<b>mount -v 10.0.0.2:/tftpboot /mnt</b>
	<b>cd /mnt/dev; ./MAKEDEV all; cd /; umount /mnt</b>
	<b>halt</b>
</pre>Then, once the client machine has halted, log in as <tt>root</tt>
	on the server machine and type <tt><b>reboot</b></tt>.
  <p>
  <li>Once everything has been set up correctly, change
	<tt>netbsd-INSTALL32_IP3x.gz</tt> in <tt>config_client</tt> to
	<tt>netbsd-GENERIC32_IP3x.gz</tt> (the GENERIC kernel).
</ol>

<p>You might want to log in as <tt>root</tt> on the server machine, and
run <tt>tcpdump -lnvv</tt> or similar, to see that what the client machine
actually does on the network.

<p>It should now be possible to boot NetBSD/sgimips using the NetBSD/pmax
nfs server, using the following commands: (NOTE! Execute these two 
commands in separate xterms!)<pre>
	<b>gxemul @config_server</b>
	<b>gxemul @config_client</b>
</pre>

<p>If/when asked for "<tt>root device:</tt>" etc. on the client machine, enter
the following values:<pre>
	root device: <b>mec0</b>
	dump device: 				<b>(leave blank)</b>
	file system (default generic): 		<b>(leave blank)</b>
	..
	init path (default /sbin/init):		<b>(leave blank)</b>
	Enter pathname of shell or RETURN for /bin/sh:	<b>(leave blank)</b>
	Terminal type? [unknown] <b>xterm</b>
	..
	# <b>exit</b>			(to leave the single-user shell)
</pre>

<p>Note: Netbooting like this is very slow, so you need a lot of patience.








<p><br>
<a name="openbsdsgiinstall"></a>
<h3>OpenBSD/sgi:</h3>

<p><a href="http://www.openbsd.org/sgi.html">OpenBSD/sgi</a>
can run in GXemul on an emulated O2 (SGI-IP32), with root on NFS.

<p><a href="https://www.openbsd.org/sgi.html">https://www.openbsd.org/sgi.html</a>
says <i>"The OpenBSD/sgi port was discontinued after the 6.7 release"</i>, but
it seems that 6.8 is available from the official FTP site anyway.

<p>
<a href="20050617-openbsd-sgi.png"><img src="20050617-openbsd-sgi_small.png"></a>
<a href="20181018-openbsd-sgi-o2.png"><img src="20181018-openbsd-sgi-o2-small.png"></a>
<a href="openbsd-sgi-x-20210220.png"><img src="openbsd-sgi-x-20210220-small.png"></a>

<p>GXemul does not yet emulate the AHC PCI SCSI controller in the O2,
so it needs to boot via the emulated network.
Another emulated machine must then be used as the nfs root server, and the emulated O2 machine must boot 
as a <a href="http://man.openbsd.org/diskless">diskless</a>
client. Performing this setup is quite time consuming, but necessary:

<p>
<ol>
  <li>First of all, the "<tt>nfs server</tt>" machine must be set up.
	<a href="machine_decstation.html#netbsdpmaxinstall">Install NetBSD/pmax 8.0 from CDROM</a>,
	perform a default install from CDROM without configuring the
	network, but add a 4000 MB <tt>/tftpboot</tt> partition when
	configuring the disk!
  <p>
  <li>On the host, download the OpenBSD distribution:
<p><table border="0"><tr><td><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td><pre>wget http://ftp.eu.openbsd.org/pub/OpenBSD/6.8/sgi/base68.tgz
wget http://ftp.eu.openbsd.org/pub/OpenBSD/6.8/sgi/comp68.tgz
wget http://ftp.eu.openbsd.org/pub/OpenBSD/6.8/sgi/xbase68.tgz
wget http://ftp.eu.openbsd.org/pub/OpenBSD/6.8/sgi/xfont68.tgz
wget http://ftp.eu.openbsd.org/pub/OpenBSD/6.8/sgi/xserv68.tgz
wget http://ftp.eu.openbsd.org/pub/OpenBSD/6.8/sgi/xshare68.tgz
</pre></td></tr></table>
  <li>Start the emulation of the DECstation NFS server using this command line:
<p><table border="0"><tr><td><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td><pre>gxemul -xe 3max -d nbsd_pmax.img -d base68.tgz -d comp68.tgz -d xbase68.tgz -d xfont68.tgz -d xserv68.tgz -d xshare68.tgz
</pre></td></tr></table>
and enter the following commands to configure the server for NFS serving and
extract the OpenBSD distribution:
<table border="0"><tr><td><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td><pre>
<b>echo hostname=server &gt;&gt; /etc/rc.conf
echo ifconfig_le0=\"inet 10.0.0.2\" &gt;&gt; /etc/rc.conf
echo nameserver 10.0.0.254 &gt;&gt; /etc/resolv.conf
echo 10.0.0.254 &gt; /etc/mygate
echo /tftpboot -maproot=root -alldirs 10.0.0.1 &gt; /etc/exports
echo rpcbind=YES &gt;&gt; /etc/rc.conf
echo nfs_server=YES &gt;&gt; /etc/rc.conf
echo mountd=YES &gt;&gt; /etc/rc.conf
echo bootparamd=YES &gt;&gt; /etc/rc.conf
printf "client root=10.0.0.2:/tftpboot swap=10.0.0.2:/tftpboot/swap\n" &gt; /etc/bootparams
echo "08:20:30:00:00:10 client" &gt; /etc/ethers
echo 10.0.0.1 client &gt; /etc/hosts

cd /tftpboot
tar xzf /dev/sd1c
tar xzf /dev/sd2c
tar xzf /dev/sd3c
tar xzf /dev/sd4c
tar xzf /dev/sd5c
tar xzf /dev/sd6c

tar zxfv var/sysmerge/etc.tgz
tar zxfv var/sysmerge/xetc.tgz

chmod 1777 tmp

dd if=/dev/zero of=swap bs=1024 count=262144

echo inet 10.0.0.1 > /tftpboot/etc/hostname.mec0
chmod 640 /tftpboot/etc/hostname.mec0
echo 10.0.0.254 > /tftpboot/etc/mygate
echo nameserver 10.0.0.254 > /tftpboot/etc/resolv.conf
echo 10.0.0.2:/tftpboot / nfs rw 0 0 > /tftpboot/etc/fstab
echo 10.0.0.2:/tftpboot/swap none swap sw,nfsmntpt=/swap >> /tftpboot/etc/fstab

halt</b>
</pre></td></tr></table>
  <li>Download the OpenBSD/sgi GENERIC and RAMDISK kernels:<pre>
	<a href="http://ftp.eu.openbsd.org/pub/OpenBSD/6.8/sgi/bsd.IP32">http://ftp.eu.openbsd.org/pub/OpenBSD/6.8/sgi/bsd.IP32</a>
	<a href="http://ftp.eu.openbsd.org/pub/OpenBSD/6.8/sgi/bsd.rd.IP32">http://ftp.eu.openbsd.org/pub/OpenBSD/6.8/sgi/bsd.rd.IP32</a>

</pre>
  <li>Create a configuration file called <tt>config_client</tt>:
<table border="0"><tr><td><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td><pre>
<font color="#2020cf">!  Configuration file for running OpenBSD/sgi diskless with
!  a NetBSD/pmax machine as the nfs server.
!
!  This config file is for the client.</font>

<b>net(
	add_remote("localhost:12444")   </b>! the server<b>
	local_port(12445)               </b>! the client<b>
)

machine(
	name("client machine")
	serial_nr(1)

        type("sgi")
        subtype("o2")
	use_x11(1)
	memory(1024)

        load("bsd.rd.IP32")
        ! load("bsd.IP32")
)
</b>
</pre></td></tr></table>
	... and another configuration file for the server,
	<tt>config_server</tt>:
<table border="0"><tr><td><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td><pre>
<b>net(
	local_port(12444)               </b>! the server<b>
	add_remote("localhost:12445")   </b>! the client<b>
)

machine(
	name("nfs server")
	serial_nr(2)

        type("dec")
        subtype("5000/200")

        disk("nbsd_pmax.img")
)
</b>
</pre></td></tr></table>
  <li>Boot the "<tt>nfs server</tt>" and the OpenBSD/sgi
	"<tt>client machine</tt>" as two separate emulator instances:<pre>
	in one xterm:
	<b>gxemul @config_server</b>

	and then, in another xterm:
	<b>gxemul @config_client</b>

</pre>
  <li>In the emulated OpenBSD/sgi client, type 's' for Shell and run these commands:
<table border="0"><tr><td><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td><pre>
<b>ifconfig mec0 10.0.0.1; route add default 10.0.0.254
mount -v 10.0.0.2:/tftpboot /mnt
cd /mnt/dev; ./MAKEDEV all; cd /; umount /mnt
reboot</b>
</pre></td></tr></table>
  <li>Change bsd.rd.IP32 to bsd.IP32 in the client configuration file.
  <li>Finally, run the client again:<pre>
	<b>gxemul @config_client</b>

</pre><p>If the root device is not auto-detected, enter <tt>mec0</tt>.

</ol>


<p>Log in as root, with empty password.
To start X11, type <tt>startx</tt>.
Note that the emulation is a bit slow, mostly due to having the file
system on NFS.





<p><br>
<a name="linuxforo2"></a>
<h3>Linux for O2</h3>

<p><font color="red">NOTE: This does not work yet. Some old kernels may work,
but I have not had the time to set up NFS netbooting so I don't know
whether that would really work, or trigger other bugs.</font>

<p>Some kernels (Linux 2.5 and 2.6) from the years 2002 - 2004 can be found here: <a href="https://www.linux-mips.org/~glaurung/">https://www.linux-mips.org/~glaurung/</a>
<br>Other kernels here: <a href="http://ftp.debian.org/debian/dists/Debian8.11/main/installer-mips/current/images/r5k-ip32/">Debian Linux for O2</a>

<p>Example with <a href="https://www.linux-mips.org/~glaurung/O2/linux-2.5.47/kernel/vmlinux64-r10k">https://www.linux-mips.org/~glaurung/O2/linux-2.5.47/kernel/vmlinux64-r10k</a> (launced using <tt>gxemul -X -e o2 vmlinux64-r10k</tt>):

<p>
<a href="20190715-sgi-o2-linux.png"><img src="20190715-sgi-o2-linux-small.png"></a>

<p>Another kernel to try could be:
<a 
href="http://mirrors.telepoint.bg/debian/dists/stretch/main/installer-mips/20150718/images/r5k-ip32/netboot-boot.img">http://mirrors.telepoint.bg/debian/dists/stretch/main/installer-mips/20150718/images/r5k-ip32/netboot-boot.img</a>






<p><br>
<a name="IRIX"></a>
<h3>Experimenting with booting IRIX from a real SGI O2</h3>

<p><font color="red">NOTE: This does not work yet. These instructions
are here mostly for me to know where to continue debugging, when
there is time.</font>

<p>Preliminary instruction for how to boot the kernel from your real O2:
<pre>
$ <b>gxemul -X -e o2 unix</b>
</pre>

<p>where <tt>unix</tt> is the IP32 kernel. If you do not want to use
the graphical framebuffer (<tt>-X</tt>), you can use lower-case <tt>-x</tt>
to just use an xterm instead.

<p>
<a href="20190526-irix-not-really-working-yet.png"><img src="20190526-irix-not-really-working-yet_small.png"></a>

<pre>
IRIX Release 6.5 IP32 Version 10151453 System V
Copyright 1987-2002 Silicon Graphics, Inc.
All Rights Reserved.

Total real memory  = 131072 kbytes
CPU Frequency = 134Mhz
1 CPU(s)

Free small K0 = 0x411 pages (adding 0xa4 pages)

QLFC: running as interrupt thread.
QLFC: using spinlocks.

PCI Configuration Report

keyboard on port 0, mouse on port 1
ec0: hardware ethernet address 08:20:30:00:00:10
919 buffers
PANIC: vfs_mountroot: no root found
[Press reset to restart the machine.]
</pre>

<p><font color="red">Right now, it does not work. There are several problems,
most importantly there is no way to get IRIX to find the root file system
from which to run; SCSI is not emulated, and the network emulation in
GXemul is not good enough for IRIX to accept it for root-on-nfs. Also,
attempting to use more than 256 MB of RAM fails.</font>






<p><br>
<a name="prom"></a>
<h3>Experimenting with a PROM from a real SGI O2</h3>

<p>Note: Normally, a dump of the PROM image from your real SGI O2 is <i>not</i> needed,
if what you want to do is to run guest operating systems in the emulator.

<p>Using a serial console hooked up to your O2, executing the PROM command
<pre>
&gt;&gt; <b>dump -b 0xBFC00000:0xBFC80000</b>
</pre>

<p>
will dump 512 KB of the PROM range. Make sure you capture all the output
into a file, and then convert the result into a raw binary. (If you don't have
time to write a converter tool yourself, there is an example converter in
the GXemul source code distribution: <tt>experiments/sgiprom_to_bin</tt>.)

<p>Assuming you have extracted the PROM from your real machine into a
file called <tt>prom</tt>, the following example shows how to start up the
emulator with that image:

<pre>
$ <b>gxemul -Q -X -e o2 0xbfc00000:prom</b>
</pre>

<p><tt>-Q</tt> turns off GXemul's built-in PROM emulation, allowing raw PROM images
to be used. <tt>-X</tt> is used to display the graphical framebuffer. (<tt>-X</tt> can be
omitted if only serial console is what you want.) And finally, <tt>-e o2</tt> selects
the O2 emulation mode. 0xbfc00000 is the standard ROM address for MIPS-based
systems.

<p>
<a href="sgi-o2-real.jpg"><img src="sgi-o2-real_small.jpg"></a>
 <a href="20180910-sgiip32prom-4.13.png"><img src="20180910-sgiip32prom-4.13.png" width=250></a>

<p>The photo on the left is from the real machine. The screenshot to the right
is from the emulator.

<p><font color="#ff0000">
NOTE: The SGI O2 PROM does some hardware tests during startup that do not
work in GXemul, in particular cache detection. So right now,
there is a hack/workaround which skips cache detection in an ugly way.
This has been verified to work with PROM versions 2.3, 4.13, and 4.18.
For other versions, it may need to be manually skipped.</font>

<p>With a IP32 PROM version 4.13 for example, if the hack is commented out,
the cache detection routine at 0xbfc05180 must be skipped:

<pre>
$ <b>gxemul -p 0xffffffffbfc05180 -X -Q -e o2 0xbfc00000:prom-4.13</b>

<i>...
when the breakpoint is hit, type:</i>

pc = ra
continue
</pre>

<p>If the 'console' variable in the PROM's environment variable section
was set to something starting with 'g', output will be graphical, otherwise
it will be to serial console.

<p>Note however that almost nothing works; <b>most importantly, SCSI is not
implemented for the SGI O2</b>, so the emulated machine will not be able
to boot from any kind of disk or CDROM. Audio
or video hardware is not emulated at all yet either.
Also, while the graphics emulation has been implemented well enough to run
NetBSD, OpenBSD, and perhaps also Linux, other things may not work.


<p><br>

</body>
</html>