Moved retro IP configuration from web site to target machine.

Better match user expectations by allowing to download plain disk images and configure the IP settings afterwards on the target machine - then most likely leveraging DHCP. This works for the users with the most usual Ethernet adapter and settings - which are now pre-configured in default.cfg's. Only the few users with non-default Ethernet adapter and/or settings are required to download a custom contiki.cfg and inject it manually into their disk image files.
This commit is contained in:
Oliver Schmidt 2013-02-01 23:19:12 +01:00
parent 69317ad1db
commit b175ba7463
8 changed files with 26 additions and 73 deletions

View File

@ -74,7 +74,7 @@ $(eval $(call makes,apple2enh))
apple2enh-1-disk: apple2enh-makes
cp ../apple2enh/prodos.dsk contiki-1.dsk
java -jar $(AC) -p contiki-1.dsk contiki.cfg bin 0 < dummy.cfg
java -jar $(AC) -p contiki-1.dsk contiki.cfg bin 0 < ../apple2enh/default.cfg
java -jar $(AC) -p contiki-1.dsk menu.system sys 0 < ../apple2enh/menu.system
java -jar $(AC) -p contiki-1.dsk ipconfig.system sys 0 < ../apple2enh/loader.system
java -jar $(AC) -cc65 contiki-1.dsk ipconfig bin 0 < ../../cpu/6502/ipconfig/ipconfig.apple2enh
@ -92,7 +92,7 @@ apple2enh-1-disk: apple2enh-makes
apple2enh-2-disk: apple2enh-makes
cp ../apple2enh/prodos.dsk contiki-2.dsk
java -jar $(AC) -p contiki-2.dsk contiki.cfg bin 0 < dummy.cfg
java -jar $(AC) -p contiki-2.dsk contiki.cfg bin 0 < ../apple2enh/default.cfg
java -jar $(AC) -p contiki-2.dsk menu.system sys 0 < ../apple2enh/menu.system
java -jar $(AC) -p contiki-2.dsk ipconfig.system sys 0 < ../apple2enh/loader.system
java -jar $(AC) -cc65 contiki-2.dsk ipconfig bin 0 < ../../cpu/6502/ipconfig/ipconfig.apple2enh
@ -106,7 +106,7 @@ apple2enh-2-disk: apple2enh-makes
apple2enh-3-disk: apple2enh-makes
cp ../apple2enh/prodos.dsk contiki-3.dsk
java -jar $(AC) -p contiki-3.dsk contiki.cfg bin 0 < dummy.cfg
java -jar $(AC) -p contiki-3.dsk contiki.cfg bin 0 < ../apple2enh/default.cfg
java -jar $(AC) -p contiki-3.dsk menu.system sys 0 < ../apple2enh/menu.system
java -jar $(AC) -p contiki-3.dsk ipconfig.system sys 0 < ../apple2enh/loader.system
java -jar $(AC) -cc65 contiki-3.dsk ipconfig bin 0 < ../../cpu/6502/ipconfig/ipconfig.apple2enh
@ -120,7 +120,7 @@ apple2enh-3-disk: apple2enh-makes
apple2enh-4-disk: apple2enh-makes
cp ../apple2enh/prodos.dsk contiki-4.dsk
java -jar $(AC) -p contiki-4.dsk contiki.cfg bin 0 < dummy.cfg
java -jar $(AC) -p contiki-4.dsk contiki.cfg bin 0 < ../apple2enh/default.cfg
java -jar $(AC) -p contiki-4.dsk menu.system sys 0 < ../apple2enh/menu.system
java -jar $(AC) -p contiki-4.dsk ipconfig.system sys 0 < ../apple2enh/loader.system
java -jar $(AC) -cc65 contiki-4.dsk ipconfig bin 0 < ../../cpu/6502/ipconfig/ipconfig.apple2enh
@ -134,7 +134,7 @@ $(eval $(call makes,c64))
c64-1-disk: c64-makes
$(C1541) -format contiki,00 d64 contiki-1.d64
$(C1541) -attach contiki-1.d64 -write dummy.cfg contiki.cfg,u
$(C1541) -attach contiki-1.d64 -write ../c64/default.cfg contiki.cfg,u
$(C1541) -attach contiki-1.d64 -write ../../cpu/6502/ipconfig/ipconfig.c64 ipconfig,p
$(C1541) -attach contiki-1.d64 -write ../../examples/webserver/webserver-example.c64 webserver,p
$(C1541) -attach contiki-1.d64 -write ../../examples/webbrowser/webbrowser.c64 webbrowser,p
@ -150,7 +150,7 @@ c64-1-disk: c64-makes
c64-2-disk: c64-makes
$(C1541) -format contiki,00 d64 contiki-2.d64
$(C1541) -attach contiki-2.d64 -write dummy.cfg contiki.cfg,u
$(C1541) -attach contiki-2.d64 -write ../c64/default.cfg contiki.cfg,u
$(C1541) -attach contiki-2.d64 -write ../../cpu/6502/ipconfig/ipconfig.c64 ipconfig,p
$(C1541) -attach contiki-2.d64 -write ../../examples/email/email-client.c64 email,p
$(C1541) -attach contiki-2.d64 -write ../../examples/ftp/ftp-client.c64 ftp,p
@ -163,7 +163,7 @@ $(eval $(call makes,c128))
c128-1-disk: c128-makes
$(C1541) -format contiki,00 d71 contiki-1.d71
$(C1541) -attach contiki-1.d71 -write dummy.cfg contiki.cfg,u
$(C1541) -attach contiki-1.d71 -write ../c128/default.cfg contiki.cfg,u
$(C1541) -attach contiki-1.d71 -write ../../cpu/6502/ipconfig/ipconfig.c128 ipconfig,p
$(C1541) -attach contiki-1.d71 -write ../../examples/webserver/webserver-example.c128 webserver,p
$(C1541) -attach contiki-1.d71 -write ../../examples/webbrowser/webbrowser.c128 webbrowser,p
@ -186,7 +186,7 @@ atari-1-disk: atari-makes
mkdir -p atr
cp ../atari/dos.sys atr/dos.sys
cp ../atari/dup.sys atr/dup.sys
cp dummy.cfg atr/contiki.cfg
cp ../atari/default.cfg atr/contiki.cfg
cp ../../cpu/6502/ipconfig/ipconfig.atari atr/ipconfig.com
cp ../../examples/webserver/webserver-example.atari atr/webserve.com
cp ../../examples/webbrowser/webbrowser.atari atr/webbrows.com
@ -201,7 +201,7 @@ atari-2-disk: atari-makes
mkdir -p atr
cp ../atari/dos.sys atr/dos.sys
cp ../atari/dup.sys atr/dup.sys
cp dummy.cfg atr/contiki.cfg
cp ../atari/default.cfg atr/contiki.cfg
cp ../../cpu/6502/ipconfig/ipconfig.atari atr/ipconfig.com
cp ../../examples/wget/wget.atari atr/wget.com
cp ../../examples/irc/irc-client.atari atr/irc.com
@ -212,7 +212,7 @@ atari-3-disk: atari-makes
mkdir -p atr
cp ../atari/dos.sys atr/dos.sys
cp ../atari/dup.sys atr/dup.sys
cp dummy.cfg atr/contiki.cfg
cp ../atari/default.cfg atr/contiki.cfg
cp ../../cpu/6502/ipconfig/ipconfig.atari atr/ipconfig.com
cp ../../examples/email/email-client.atari atr/email.com
cp ../../examples/ftp/ftp-client.atari atr/ftp.com
@ -223,7 +223,7 @@ atari-4-disk: atari-makes
mkdir -p atr
cp ../atari/dos.sys atr/dos.sys
cp ../atari/dup.sys atr/dup.sys
cp dummy.cfg atr/contiki.cfg
cp ../atari/default.cfg atr/contiki.cfg
cp ../../cpu/6502/ipconfig/ipconfig.atari atr/ipconfig.com
cp ../../../contikiprojects/vandenbrande.com/twitter/platform/atari/breadbox64.atari atr/breadbox.com
$(DIR2ATR) -b Dos25 1040 contiki-4.atr atr

View File

@ -1,31 +1,21 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Contiki Download</title>
<title>Contiki Configuration Download</title>
<style type="text/css">
tr.p { padding: 15px 0px }
tr.pt { padding-top: 15px }
tr.pb { padding-bottom: 15px }
tr.bg { background-color: black; height: 1px }
</style>
<script type="text/javascript">
function disks(disks) {
for (var i = 4; i; i--) {
document.forms[0].disk[i].disabled = i > disks;
if (document.forms[0].disk[i].checked &&
document.forms[0].disk[i].disabled)
document.forms[0].disk[i-1].checked = true;
}
}
</script>
</head>
<body>
<form action="download.php">
<h4 align="center">Download your custom generated Contiki</h4>
<h4 align="center">Download your custom generated Contiki configuration</h4>
<table align="center" cellpadding="0" cellspacing="0">
<tr class="p">
<td>
<input type="radio" name="machine" id="apple2" value="apple2" onclick="disks(4)" checked="checked" />
<input type="radio" name="machine" id="apple2" value="apple2" checked="checked" />
<label for="apple2">Apple //e</label>
</td><td>
<label for="apple2-drv">Ethernet Card:</label>
@ -49,40 +39,40 @@
<td colspan="3" />
</tr><tr class="p">
<td>
<input type="radio" name="machine" id="c64" value="c64" onclick="disks(2)" />
<input type="radio" name="machine" id="c64" value="c64" />
<label for="c64">C64</label>
</td><td colspan="2">
<label for="c64-drv">Ethernet Card:</label>
<select name="c64-addr-drv" id="c64-drv" size="1">
<option value="DE08-CS8900A.ETH" >RR+RR-Net</option>
<option value="DE00-CS8900A.ETH" >TFE </option>
<option value="DE00-LAN91C96.ETH">ETH64 </option>
<option value="DE08-CS8900A.ETH" >RR-Net</option>
<option value="DE00-CS8900A.ETH" >TFE </option>
<option value="DE00-LAN91C96.ETH">ETH64 </option>
</select>
</td>
</tr><tr class="bg">
<td colspan="3" />
</tr><tr class="p">
<td>
<input type="radio" name="machine" id="c128" value="c128" onclick="disks(1)" />
<input type="radio" name="machine" id="c128" value="c128" />
<label for="c128">C128</label>
</td><td colspan="2">
<label for="c128-drv">Ethernet Card:</label>
<select name="c128-addr-drv" id="c128-drv" size="1">
<option value="DE08-CS8900A.ETH" >RR+RR-Net</option>
<option value="DE00-CS8900A.ETH" >TFE </option>
<option value="DE00-LAN91C96.ETH">ETH64 </option>
<option value="DE08-CS8900A.ETH" >RR-Net</option>
<option value="DE00-CS8900A.ETH" >TFE </option>
<option value="DE00-LAN91C96.ETH">ETH64 </option>
</select>
</td>
</tr><tr class="bg">
<td colspan="3" />
</tr><tr class="p">
<td>
<input type="radio" name="machine" id="atari" value="atari" onclick="disks(4)" />
<input type="radio" name="machine" id="atari" value="atari" />
<label for="atari">Atari 8-bit</label>
</td><td colspan="2">
<label for="atari-drv">Ethernet Card:</label>
<select name="atari-addr-drv" id="atari-drv" size="1">
<option value="D500-CS8900A.ETH" >Atari 8-bit Ethernet</option>
<option value="D500-cs8900a.eth" >Atari 8-bit Ethernet</option>
</select>
</td>
</tr><tr class="bg">
@ -125,21 +115,6 @@
</td>
</tr><tr class="bg">
<td colspan="3" />
</tr><tr class="p">
<td colspan="3">
<input type="radio" name="disk" id="conf" value="0" />
<label for="conf">Configuration File Only</label><br />
<input type="radio" name="disk" id="disk-1" value="1" checked="checked" />
<label for="disk-1">Complete Image Of Disk 1</label><br />
<input type="radio" name="disk" id="disk-2" value="2" />
<label for="disk-2">Complete Image Of Disk 2</label><br />
<input type="radio" name="disk" id="disk-3" value="3" />
<label for="disk-3">Complete Image Of Disk 3</label><br />
<input type="radio" name="disk" id="disk-4" value="4" />
<label for="disk-4">Complete Image Of Disk 4</label>
</td>
</tr><tr class="bg">
<td colspan="3" />
</tr><tr class="p">
<td colspan="3" align="center">
<input type="submit" value="Download" />

View File

@ -7,33 +7,22 @@ $cfg .= chr($_GET['mask-a']).chr($_GET['mask-b']).chr($_GET['mask-c']).chr($_GET
$cfg .= chr($_GET['dgw-a']). chr($_GET['dgw-b']). chr($_GET['dgw-c']). chr($_GET['dgw-d']);
$cfg .= chr($_GET['dns-a']). chr($_GET['dns-b']). chr($_GET['dns-c']). chr($_GET['dns-d']);
$dsk = $_GET['disk'];
switch ($_GET['machine']) {
case 'apple2':
$hex = $_GET['apple2-addr'];
$drv = $_GET['apple2-drv'];
$ext = '-' . $dsk . '.dsk';
$ofs = 0x05B00;
break;
case 'c64':
$hex = strtok($_GET['c64-addr-drv'], '-');
$drv = strtok('-');
$ext = '-' . $dsk . '.d64';
$ofs = 0x15002;
break;
case 'c128':
$hex = strtok($_GET['c128-addr-drv'], '-');
$drv = strtok('-');
$ext = '-' . $dsk . '.d71';
$ofs = 0x15002;
break;
case 'atari':
$hex = strtok($_GET['atari-addr-drv'], '-');
$drv = strtok('-');
$ext = '-' . $dsk . '.atr';
$blk = array(0, 5, 4, 4, 275);
$ofs = 0x00010 + ($blk[$dsk] - 1) * 0x80;
break;
}
@ -41,19 +30,8 @@ $addr = hexdec($hex);
$cfg .= chr($addr % 0x100).chr($addr / 0x100);
$cfg .= $drv;
if ($dsk) {
$img = file_get_contents('contiki'. $ext);
if ($img)
$out = substr_replace($img, $cfg, $ofs, strlen($cfg));
else
$out = '';
} else {
$ext = '.cfg';
$out = $cfg;
}
header('Content-Type: application/octetstream');
header('Content-Disposition: attachment; filename=contiki' . $ext);
print($out);
header('Content-Disposition: attachment; filename=contiki.cfg');
print($cfg);
?>

Binary file not shown.

BIN
tools/apple2enh/default.cfg Normal file

Binary file not shown.

BIN
tools/atari/default.cfg Normal file

Binary file not shown.

BIN
tools/c128/default.cfg Normal file

Binary file not shown.

BIN
tools/c64/default.cfg Normal file

Binary file not shown.