File: machine_evbmips.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 (296 lines) | stat: -rw-r--r-- 11,157 bytes parent folder | download | duplicates (3)
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>GXemul: EVBmips (Malta) emulation</title>
  <meta name="robots" content="noarchive,nofollow,noindex">
</head>
<body style="font-family : sans-serif;">

<!-- 10 lines header.  -->

<h1>GXemul: EVBmips (Malta) emulation</h1>
<p>

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

<!--

Copyright (C) 2006-2019  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 EVBmips mode emulates a Malta evaluation board with a 5Kc (MIPS64)
CPU, or optionally, a 4Kc (MIPS32) processor by adding <tt>-C 4Kc</tt>
to the command line.

<p>
<a href=#netbsdevbmipsinstall">NetBSD/evbmips</a> is the only guest OS
that can be considered working, but there are instructions on this page
for experimenting with <a href="#linux_malta">Linux/malta</a>
and <a href="#helenosmalta">HelenOS/malta</a> too.






<p><br>
<a name="netbsdevbmipsinstall"></a>
<h3>NetBSD/evbmips:</h3>

<p>
<a href="20060812-netbsd-malta-3.0.1.png"><img src="20060812-netbsd-malta-3.0.1_small.png"></a>

<p>One way to install the NetBSD/evbmips distribution onto a disk
image is to install the files using another (emulated) machine.

<p>
The following instructions will let you install NetBSD/evbmips onto a disk 
image, from an emulated DECstation 3MAX machine:

<p>
<ol>
  <li>Download a NetBSD/pmax (DECstation) install RAMDISK kernel:<pre>
	<a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-8.0/pmax/binary/kernel/netbsd-INSTALL.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-8.0/pmax/binary/kernel/netbsd-INSTALL.gz</a>
</pre>
  <p>
  <li>Create an empty harddisk image, which will be the disk image
	that you will install NetBSD onto:<pre>
	<b>dd if=/dev/zero of=nbsd_malta.img bs=1024 count=1 seek=4000000</b>

</pre>
  <li>Download the Malta kernel and the ISO image:<pre>
	<a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-8.0/evbmips-mipsel/binary/kernel/netbsd-MALTA.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-8.0/evbmips-mipsel/binary/kernel/netbsd-MALTA.gz</a>
	<a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-8.0/iso/NetBSD-8.0-evbmips-mipsel.iso">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-8.0/iso/NetBSD-8.0-evbmips-mipsel.iso</a>

</pre>
  <p>
  <li>Start the emulated DECstation machine like this:<pre>
	<b>gxemul -x -e 3max -d nbsd_malta.img -d NetBSD-8.0-evbmips-mipsel.iso netbsd-INSTALL.gz</b>

</pre>
  <li>At the <tt>Terminal type? [vt100]</tt> prompt, type <b>CTRL-C</b> and execute the following commands:
<p><table border="0"><tr><td><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td><pre>
<b>newfs /dev/sd0c
mount -t cd9660 /dev/cd0c /mnt
mkdir /mnt2; mount /dev/sd0c /mnt2
cd /mnt2; sh
for a in /mnt/*/binary/sets/[bcemt]*.tgz; do echo $a; tar zxfp $a; done
exit
cd dev; sh ./MAKEDEV all; cd ../etc
echo rc_configured=YES >> rc.conf
echo "/dev/wd0c / ffs rw 1 1" > fstab
cd /; umount /mnt; umount /mnt2; halt</b>
</pre></td></tr></table>
</ol>

<p>You should now be able to boot NetBSD/evbmips using this command:<pre>
	<b>gxemul -x -e malta -d nbsd_malta.img netbsd-MALTA.gz</b>
</pre>

<p>NOTE 1: There may be long delays during bootup, such as when NetBSD
	detects the clock. On my machine, I had to wait almost 3 minutes.

<p>NOTE 2: To select a 4Kc (MIPS32) CPU instead of the default 5Kc 
(MIPS64) CPU, add <tt><b>-C 4Kc</b></tt> to the command line.
There are at least two things that differ:<ol>
  <li>The dynamic translation core runs faster when emulating 32-bit
	processors, so <tt><b>-C 4Kc</b></tt> might make things go faster.
  <li>4Kc only has 16 TLB entries, whereas 5Kc has 48. This makes 4Kc
	emulation slower in general, because there are more TLB misses.
</ol>

<p>The installation instructions above create a filesystem
<i>without</i> a disklabel, so there is only one ffs partition and no
swap. You will need to enter the following things when booting with the
generic kernel:<pre>
	root device (default wd0a): <b>wd0c</b>
	dump device (default wd0b):		<i>(just press enter)</i>
	file system (default generic):		<i>(just press enter)</i>
	init path (default /sbin/init):		<i>(just press enter)</i>
</pre>

<p>There may be long delays also at this stage, before reaching the login
prompt. If it sleeps for too long after printing "Updating motd.", try
typing CTRL-C in the terminal window.

<p>The clock is wrong (showing the year 2119 instead of 2019),
and it goes too fast inside the emulator. If it hangs during
boot-up, before the login prompt has appeared, type CTRL-C in the xterm
window.

<p>NOTE 3: There <i>is</i> actually a kernel for Malta with the installer
ramdisk (<a href="ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-8.0/evbmips-mipsel/installation/netbsd-INSTALL_MALTA.gz">ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-8.0/evbmips-mipsel/installation/netbsd-INSTALL_MALTA.gz</a>), but there is a bug which causes
the second IDE channel to not be detected, so it is currently not possible to boot
with both the <tt>nbsd_malta.img</tt> disk image and the CD-ROM image at
the same time.




<p><br>
<a name="linux_malta"></a>
<h3>Linux/Malta (variant 1):</h3>

<p>The Malta emulation mode is best suited for running <a 
href="#netbsdevbmipsinstall">NetBSD/evbmips</a>, however, it is possible 
to experiment with Linux/Malta as well.

<p>The general idea behind Linux/Malta seems to be that the end user 
always compiles his/her own kernel, applies patches, downloads 
userland separately, etc. For that reason, Linux/Malta support in the 
emulator is not tested for every release (sometimes it works, sometimes it 
doesn't work), and these instructions are kind of "fuzzy".

<p><ol start="1">
  <li>Create an empty harddisk image, which will be the root disk
	that Linux/Malta will be installed onto:<pre>
	<b>dd if=/dev/zero of=linux.img bs=1024 count=1 seek=5000000</b>

</pre>
  <li>Download a MIPS root filesystem tree:<pre>
	<a href="ftp://ftp.linux-mips.org/pub/linux/mips/mipsel-linux/root/mipsel-root-20011216.tgz">ftp://ftp.linux-mips.org/pub/linux/mips/mipsel-linux/root/mipsel-root-20011216.tgz</a>
	19486676 bytes, md5 = 5bcb725c90209479cd7ead8ad0c4a414

</pre>
	This is an old Redhat tree from 2001, but it seems to almost work.
  <p>
  <li>Download one precompiled Malta kernel, with ramdisk,
	and one without ramdisk (which will be used later on
	when booting from disk):<pre>
	TODO

</pre>
  <li>Start the emulator with the ramdisk kernel, create a MS-DOS style
	MBR on the disk, create the filesystem, and extract the
	userland files:<pre>
	<b>gunzip vmlinux_2.*
	gunzip mipsel-root-20011216.tar
	gxemul -xemalta -d linux.img -d mipsel-root-20011216.tar vmlinux_2.4.33.2-ide-pci-ramdisk.elf</b>
	Inside GXemul: Log in as root and execute the following commands:
	<b>fdisk /dev/hda</b>
	(enter suitable commands, e.g. <b>n, p, 1, 1, 9921, w</b>)
	<b>mkfs /dev/hda1
	mount /dev/hda1 /mnt
	cd /mnt; tar -xf /dev/hdb; cd ..
	umount /mnt; sync; reboot</b>

</pre>
</ol>

<p>It should now be possible to boot from the disk image, using the 
following command:

<p><pre>
<b>	gxemul -xemalta -d linux.img -o "root=/dev/hda1 rw" vmlinux_2.6.18-rc4-ide-pci-novty.elf</b>
</pre>

<p>There's a slight problem with this specific Redhat tree, so when you 
see the message "Configuring kernel parameters:  [  OK  ]", press CTRL-C 
once.






<p><br>
<a name="linux_malta2"></a>
<h3>Linux/Malta (variant 2):</h3>

<p>The Malta emulation mode is best suited for running <a 
href="#netbsdevbmipsinstall">NetBSD/evbmips</a>, however, it is possible 
to experiment with Linux/Malta as well.

<p>It is also possible to experiment with much newer Linux userland, compared
to the Linux/Malta variant 1 above, by using a kernel and disk image from
<a href="http://people.debian.org/~aurel32/qemu/mipsel/">http://people.debian.org/~aurel32/qemu/mipsel/</a>.

<font color="#ff0000">THIS DOES <b>NOT</b> WORK YET!</font>

<p><ol start="1">
  <li>Download the Malta kernel and disk image:<pre>
	wget <a href="http://people.debian.org/~aurel32/qemu/mipsel/vmlinux-2.6.26-1-4kc-malta">http://people.debian.org/~aurel32/qemu/mipsel/vmlinux-2.6.26-1-4kc-malta</a>
	wget <a href="http://people.debian.org/~aurel32/qemu/mipsel/debian_lenny_mipsel_small.qcow.gz">http://people.debian.org/~aurel32/qemu/mipsel/debian_lenny_mipsel_small.qcow.gz</a> (142 MB)

</pre>
  <li>The disk image is both compressed and in QEMU format, so we need to extract it:<pre>
	gunzip debian_lenny_mipsel_small.qcow.gz
	qemu-img convert -f qcow -O raw debian_lenny_mipsel_small.qcow debian_lenny_mipsel_small.raw

</pre>
	(<tt>qemu-img</tt> actually requires that you have QEMU installed.)
</ol>

<p>It should now be possible to boot from the disk image, using the 
following command:

<p><pre>
<b>	gxemul -e malta -d debian_lenny_mipsel_small.raw -o "root=/dev/hda1 console=ttyS0" vmlinux-2.6.26-1-4kc-malta</b>
</pre>

<p>NOTE: <font color="#ff0000">IT DOES <b>NOT</b> WORK YET!</font>



<p><br>
<a name="helenosmalta"></a>
<h3>HelenOS/malta:</h3>

<p>Modern versions of HelenOS can run in GXemul,
using the Malta emulation mode, but without a graphical framebuffer.

<p>
<font color="red">The PCI devices in GXemul do not seem to be correctly emulated yet.</font>

<p>To run HelenOS for Malta in GXemul:
<ol>
  <li>Download the HelenOS kernel:<pre>
	<a href="http://www.helenos.org/releases/HelenOS-0.9.1-mips32-malta-be.boot">http://www.helenos.org/releases/HelenOS-0.9.1-mips32-malta-be.boot</a>
    or
	<a href="http://www.helenos.org/releases/HelenOS-0.9.1-mips32-malta-le.boot">http://www.helenos.org/releases/HelenOS-0.9.1-mips32-malta-le.boot</a>
  </pre>
  <li>Start GXemul using the following command line:<pre>
  	<b>gxemul -e maltabe HelenOS-0.9.1-mips32-malta-be.boot</b>
    or
  	<b>gxemul -e malta HelenOS-0.9.1-mips32-malta-le.boot</b>
  </pre>
</ol>




<p><br>



</body>
</html>