1 |
<html> |
<html> |
2 |
<head><title>GXemul documentation: Configuration files</title> |
<head><title>GXemul documentation: Configuration files</title> |
3 |
|
<meta name="robots" content="noarchive,nofollow,noindex"> |
4 |
</head> |
</head> |
5 |
<body bgcolor="#ffffff" text="#000000" link="#4040f0" vlink="#404040" alink="#ff0000"> |
<body bgcolor="#f8f8f8" text="#000000" link="#4040f0" vlink="#404040" alink="#ff0000"> |
6 |
<p> |
<table border=0 width=100% bgcolor="#d0d0d0"><tr> |
7 |
<table width="100%"> |
<td width=100% align=center valign=center><table border=0 width=100%><tr> |
8 |
<tr><td width="100%" bgcolor="#808070"><font color="#ffffe0" size="6"> |
<td align="left" valign=center bgcolor="#d0efff"><font color="#6060e0" size="6"> |
9 |
<b>GXemul documentation: Configuration files</b></font></td></tr> |
<b>GXemul documentation:</b></font> |
10 |
</table> |
<font color="#000000" size="6"><b>Configuration files</b> |
11 |
<p> |
</font></td></tr></table></td></tr></table><p> |
|
<!-- The first 10 lines are cut away by the homepage updating script. --> |
|
|
|
|
12 |
|
|
13 |
<!-- |
<!-- |
14 |
|
|
15 |
$Id: configfiles.html,v 1.4 2005/03/14 19:30:47 debug Exp $ |
$Id: configfiles.html,v 1.10 2005/06/21 05:38:05 debug Exp $ |
16 |
|
|
17 |
Copyright (C) 2003-2005 Anders Gavare. All rights reserved. |
Copyright (C) 2003-2005 Anders Gavare. All rights reserved. |
18 |
|
|
50 |
<ul> |
<ul> |
51 |
<li><a href="#config">Configuration file syntax</a> |
<li><a href="#config">Configuration file syntax</a> |
52 |
<li><a href="#minimal">A minimal example</a> |
<li><a href="#minimal">A minimal example</a> |
53 |
|
<li><a href="#multihost">Network across multiple hosts</a> |
54 |
</ul> |
</ul> |
55 |
|
|
56 |
|
|
79 |
<b>emul(</b> |
<b>emul(</b> |
80 |
<b>name(<font color="#ff003f">"my test emul"</font>)</b> <font color="#2020cf">! Optional name of this emulation</font> |
<b>name(<font color="#ff003f">"my test emul"</font>)</b> <font color="#2020cf">! Optional name of this emulation</font> |
81 |
|
|
82 |
<font color="#2020cf">! This creates a network (ethernet):</font> |
<font color="#2020cf">! This creates an ethernet network:</font> |
83 |
<b>net(</b> |
<b>net(</b> |
84 |
<b>ipv4net(<font color="#ff003f">"10.2.0.0"</font>)</b> <font color="#2020cf">! The default is 10.0.0.0/8, but</font> |
<b>ipv4net(<font color="#ff003f">"10.2.0.0"</font>)</b> <font color="#2020cf">! The default is 10.0.0.0/8, but</font> |
85 |
<b>ipv4len(16)</b> <font color="#2020cf">! it can be overridden like this.</font> |
<b>ipv4len(16)</b> <font color="#2020cf">! it can be overridden like this.</font> |
86 |
|
<font color="#2020cf">! local_port(12345)</font> |
87 |
|
<font color="#2020cf">! add_remote("127.0.0.1:12346")</font> |
88 |
<b>)</b> |
<b>)</b> |
89 |
|
|
90 |
<font color="#2020cf">! This creates a machine:</font> |
<font color="#2020cf">! This creates a machine:</font> |
98 |
<b>type(<font color="#ff003f">"dec"</font>)</b> <font color="#2020cf">! This is actually not optional</font> |
<b>type(<font color="#ff003f">"dec"</font>)</b> <font color="#2020cf">! This is actually not optional</font> |
99 |
<b>subtype(<font color="#ff003f">"5000/200"</font>)</b> |
<b>subtype(<font color="#ff003f">"5000/200"</font>)</b> |
100 |
|
|
101 |
<b>cpu(R3000)</b> <font color="#2020cf">! Normally set implicitly to a reasonable</font> |
<b>cpu(<font color="#ff003f">"R3000"</font>)</b> <font color="#2020cf">! Normally set implicitly to a reasonable</font> |
102 |
<font color="#2020cf">! value, depending on <i>type</i> and <i>subtype</i></font> |
<font color="#2020cf">! value, depending on <i>type</i> and <i>subtype</i></font> |
103 |
|
|
104 |
<font color="#2020cf">! ncpus(4)</font> |
<font color="#2020cf">! ncpus(4)</font> |
188 |
Starting the emulator with a configuration file is as simple as |
Starting the emulator with a configuration file is as simple as |
189 |
|
|
190 |
<pre> |
<pre> |
191 |
$ <b>./gxemul @myconfig</b> |
$ <b>gxemul @myconfig</b> |
192 |
</pre> |
</pre> |
193 |
|
|
194 |
if <b>myconfig</b> is the name of the configuration file. |
if <b>myconfig</b> is the name of the configuration file. |
198 |
|
|
199 |
|
|
200 |
|
|
201 |
|
|
202 |
|
|
203 |
<p><br> |
<p><br> |
204 |
<a name="minimal"></a> |
<a name="minimal"></a> |
205 |
<h3>A minimal example:</h3> |
<h3>A minimal example:</h3> |
206 |
|
|
207 |
Here is an example of what a minimal configuration file might look like: |
Here is an example of what a minimal configuration file might look like: |
208 |
|
|
209 |
<p> |
<p><table border="0"><tr><td width="40"> </td><td><pre> |
|
<table border="0"><tr><td width="40"> </td><td> |
|
|
<pre> |
|
210 |
<font color="#2020cf">!!gxemul</font> |
<font color="#2020cf">!!gxemul</font> |
211 |
|
|
212 |
<b>emul(</b> |
<b>emul(</b> |
219 |
</pre> |
</pre> |
220 |
</td></tr></table> |
</td></tr></table> |
221 |
|
|
222 |
<p> |
<p>For some machine types, specifying the <tt>subtype</tt> might not even |
223 |
For some machine types, specifying the <b>subtype</b> might not even be |
be necessary. Also, adding a <tt>net</tt> is quite useful, especially for |
|
necessary. Also, adding a <b>net</b> is quite useful, especially for |
|
224 |
netbooting kernels. |
netbooting kernels. |
225 |
|
|
226 |
|
|
227 |
|
|
228 |
|
|
229 |
|
|
230 |
|
|
231 |
|
<p><br> |
232 |
|
<a name="multihost"></a> |
233 |
|
<h3>Network across multiple hosts:</h3> |
234 |
|
|
235 |
|
<font color="#ff0000">2005-06-21: This a very new feature, so it might not |
236 |
|
be totally stable yet.</font> |
237 |
|
|
238 |
|
<p>It is possible to add multiple <tt>machine</tt> entries into one |
239 |
|
configuration file. This will cause the emulator to try to run all those |
240 |
|
machines simultaneously. An alternative solution for doing this, which |
241 |
|
gives higher reliability (stability) and performance, is to have one |
242 |
|
configuration file per machine. |
243 |
|
|
244 |
|
<p><table border="0"><tr><td width="40"> </td><td><pre> |
245 |
|
<font color="#2020cf">!!gxemul</font> |
246 |
|
|
247 |
|
<b>emul(</b> |
248 |
|
<b>net(</b> |
249 |
|
<b>local_port(15000)</b> |
250 |
|
<b>remote_add(<font color="#ff003f">"127.0.0.1:15001"</font>)</b> |
251 |
|
<b>)</b> |
252 |
|
<b>machine(</b> |
253 |
|
<b>type(<font color="#ff003f">"dec"</font>)</b> |
254 |
|
<b>subtype(<font color="#ff003f">"3max"</font>)</b> |
255 |
|
<b>load(<font color="#ff003f">"netbsd-pmax-2.0-GENERIC"</font>)</b> |
256 |
|
<b>)</b> |
257 |
|
<b>)</b> |
258 |
|
</pre> |
259 |
|
</td></tr></table> |
260 |
|
|
261 |
|
<p>This example creates a network using the default settings (10.0.0.0/8), |
262 |
|
but it also allows the network to be connected to other emulator |
263 |
|
instances. <tt>local_port(15000)</tt> means that anything coming in to |
264 |
|
UDP port 15000 on the host is added to the network. All ethernet packets |
265 |
|
on the network are also sent out to all other connected machines (those |
266 |
|
added with <tt>remote_add()</tt>). |
267 |
|
|
268 |
|
<p>As you can see in the example, this is a configuration file for running |
269 |
|
NetBSD/pmax 2.0, with a netbooting GENERIC kernel. (Netbooting because |
270 |
|
there is no disk image.) Another emulator instance (which must have |
271 |
|
the same kind of <tt>net()</tt>, except that it listens to port 15001) |
272 |
|
emulates the nfs server. |
273 |
|
|
274 |
|
<p>There is no error checking or security checking of any kind. All UDP |
275 |
|
packets arriving at the input port are added to the emulated ethernet. |
276 |
|
<font color="#ff0000">This is not very good, and is the primary |
277 |
|
reason why there needs to be some kind of rewrite before this |
278 |
|
is to be considered stable.</font> |
279 |
|
|
280 |
|
|
281 |
|
|
282 |
|
|
283 |
</p> |
</p> |
284 |
|
|