tag:blogger.com,1999:blog-85276031537273152802024-02-19T00:00:56.905-08:00NetBSD0Random NetBSD related blogabshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-8527603153727315280.post-13068792277962656802022-05-15T14:56:00.002-07:002023-04-29T11:46:13.666-07:00The journey to ZFS raidz1 with different sized disks (On NetBSD) (Wheelbarrow optional)<p>The joy of having a redundant remote backup machine is that if it dies you do not immediately lose any data, just some redundancy.</p><p>On the other hand, sufficient remoteness can make the process of rebuilding annoying enough to encourage a burning desire to avoid repeating it.</p><p>So... I find myself wanting to setup a NetBSD machine with a ZFS raidz1 - but without sufficient equally sized large disks or enough drive bays to pack in many smaller disks. In the world of ZFS, that's a pretty big liability.</p><p>So, what are our assets?</p><ul style="text-align: left;"><li>Five drive bays</li><li>One 8TB disk</li><li>Two 6TB disks</li><li>A seemingly unlimited number of 2TB and smaller disks</li></ul><p>That's it? Impossible. If I had a month to plan, <i>maybe</i> I could come up with something. But this... I mean, if we only had a wheelbarrow, that would be something.</p><p>Now the question of how to use different sized disks with ZFS comes up reasonably often, and the answer is invariably "You don't", quite often followed by:<br /></p><p></p><div class="separator" style="clear: both; text-align: center;"></div><p></p><ul style="text-align: left;"><li>Various ways in which you would not be able to do it</li><li>One way in which you <i>could</i> do it, but everything pretends to be the size of the smallest disk, so you have much less space</li><li>Some options to build a stack of ZFS on something on ZFS on something on ... with a note that you may want to supply the disk data blocks with good reading material and detailed maps in case they get lost on the long trek to and from the disk</li><li><div style="text-align: right;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8bn83RDxMkcLs5jd5DWmw1AbDS1DOt9cypNOXtbuOnvuTkN1UYB6UoAhavOXt9JN7uKS0_yRfQ9GkL5D5hglbsXh2dozcELqP-Dlxn4Cfq3LOxHWlV8u8bFQ_DqVqIVO67xSzHtbdPWlXi6RDmp3ousCpLCfbeN6J7yJ4F7cNsIa4QOopEfPwefpPSg/s391/Screenshot%202022-05-15%20at%2022-41-59%20princess%20bride%20fezzik%20fire%20-%20Google%20Search.png" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="239" data-original-width="391" height="196" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8bn83RDxMkcLs5jd5DWmw1AbDS1DOt9cypNOXtbuOnvuTkN1UYB6UoAhavOXt9JN7uKS0_yRfQ9GkL5D5hglbsXh2dozcELqP-Dlxn4Cfq3LOxHWlV8u8bFQ_DqVqIVO67xSzHtbdPWlXi6RDmp3ousCpLCfbeN6J7yJ4F7cNsIa4QOopEfPwefpPSg/s320/Screenshot%202022-05-15%20at%2022-41-59%20princess%20bride%20fezzik%20fire%20-%20Google%20Search.png" width="320" /></a></div>(and my personal favourite) Split up all the devices into the largest divisible unit common to all disks, determine just the right way to stack and assemble all the units (I think that would come to 12 separate units in my case), wrap the result up in a holocaust cloak, set it on fire and push it towards a castle gate<br /></li></ul><p>These all seemed to either not give the desired result, or to be the wrong type (*) of complexity (or quite often both), so I thought I'd give it a go</p><p>*: Criticising other solutions as <i>too complex</i> while I contemplate my own particular combination of cogs, pulleys, and string, would be... unsporting<br /></p><p>Anyway, I did consider using RAIDframe, but to bolt together each 6 & 2 disk to pretend to be an 8, but then... I recalled ccd - a delightful little artisanal driver from the last couple of decades of the 1900s. ccd can be used to stripe together multiple devices, concatenate them, or even a combination (stripe until one until it runs out then just use the other).</p><p>Since I'm just trying to pretend to ZFS that "No, no, really you have three identically sized disks. Just Trust Me Here", I elected to concatenate them.</p><p>And as a final gust of pretending this Might All Be A Serious Attempt At Making Something Useful, I decided to use labelled wedges, for both the ccd and the ZFS elements, so when something inevitably fails and devices just go away, or everything gets randomly crammed into another box the system might have a vague chance of determining how to fit together whatever pieces remained.</p><p>So, before the script (there always has to be a script, encoding the necessary magic with cryptic, misleading and occasionally completely incorrect comments for the edification of one's future self), did it work?</p><p>It seems to work fine, taking<span style="font-size: x-small;">:<br /><span style="font-family: courier;">wd0: 1863 GB, 3876021 cyl, 16 head, 63 sec, 512 bytes/sect x 3907029168 sectors<br />wd1: 7452 GB, 15504021 cyl, 16 head, 63 sec, 512 bytes/sect x 15628053168 sectors<br />wd2: 1863 GB, 3876021 cyl, 16 head, 63 sec, 512 bytes/sect x 3907029168 sectors<br />wd3: 5589 GB, 11628021 cyl, 16 head, 63 sec, 512 bytes/sect x 11721045168 sectors<br />wd4: 5589 GB, 11628021 cyl, 16 head, 63 sec, 512 bytes/sect x 11721045168 sectors</span></span><br /></p><p>... into<br /></p><p><span style="font-size: x-small;"><span style="font-family: courier;"># zpool list -v </span></span> <br /><span style="font-family: courier;"><span style="font-size: x-small;">NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT<br />onyx 21.8T 5.94M 21.7T - 0% 0% 1.00x ONLINE -<br /> raidz1 21.8T 3.83M 21.7T - 0% 0%<br /> wedges/onyx0 - - - - - -<br /> wedges/onyx1 - - - - - -<br /> wedges/onyx2 - - - - - -</span></span><br /></p><p>Right now its booted off an old USB key which appears to think its a QL microdrive, so syncthing is busy maxing out IOPs to that while its downloading the data to rebuild the backup, but that's a problem for another day.</p><p>Oh, yes - the script. I suspect primarily for my benefit so as when something goes horribly wrong in three years time and I have no memory of how I set things up:<br /></p><span style="font-family: courier;">#!/bin/sh -e<br /># Setup raidz1 pool from one large disk, and two smaller paired disks using ccd<br /># - everything created in labelled wedges <br /># - vdev size is capped to the first large disk<br /><br />DISK0=wd1<br />DISK1a=wd3<br />DISK1b=wd2<br />DISK2a=wd4<br />DISK2b=wd0<br />DISKS="$DISK0 $DISK1a $DISK1b $DISK2a $DISK2b"<br /><br />calculate_needed()<br />{<br />disk1_size="$(gptsize $1)"<br />disk2_size="$(gptsize $2)"<br /># Add 4096 for ccd header<br />expr $disk1_size - $disk2_size + 4096<br />}<br /><br />create_ccd()<br />{<br />wedge=$1<br />ccd=$2<br />diska=$3<br />diskb=$4<br />ccdconfig $ccd 0 0 NAME=$diska NAME=$diskb<br /># gpt destroy falls over if reusing with different ccd size<br />(yes y | fdisk -i $ccd) > /dev/null<br />gpt destroy $ccd || true<br />gpt create -f $ccd<br />gpt add -a 1m -t fbsd-zfs -l $wedge $ccd<br />}<br /><br />gptsize()<br />{<br />gpt show -i 1 $1 | awk '/Size:/{print $2}'<br />}<br /><br />zpool destroy onyx || true<br />ccdconfig -u ccd1 || true<br />ccdconfig -u ccd2 || true<br />for disk in $DISKS; do<br /> gpt destroy $disk || true<br /> gpt create $disk<br />done<br />gpt add -a 1m -t fbsd-zfs -l onyx0 $DISK0<br /><br />gpt add -a 1m -t ccd -l onyx1a $DISK1a<br />extrasize="$(calculate_needed $DISK0 $DISK1a)"<br />gpt add -a 1m -t ccd -l onyx1b -s $extrasize $DISK1b<br />create_ccd onyx1 ccd1 onyx1a onyx1b<br /><br />gpt add -a 1m -t ccd -l onyx2a $DISK2a<br />extrasize="$(calculate_needed $DISK0 $DISK2a)"<br />gpt add -a 1m -t ccd -l onyx2b -s $extrasize $DISK2b<br />create_ccd onyx2 ccd2 onyx2a onyx2b<br /><br />sleep 1 # Allow devpubd to catch up<br />zpool create onyx raidz1 /dev/wedges/onyx0 /dev/wedges/onyx1 /dev/wedges/onyx2<br /><br /># Calculate ccd size, remembering 4096 header<br /># Cannot use "ccdconfig -g ccd1 ccd2" as it loses wedge names<br />disk0_size=$(gptsize $DISK0)<br />ccd_size=$(expr \( $disk0_size + 4096 \) \* 512)<br /><br />cat > /etc/ccd.conf <<END<br />ccd1 0 none NAME=onyx1a NAME=onyx1b<br />ccd2 0 none NAME=onyx2a NAME=onyx2b<br />END<br /></span><br />abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com0tag:blogger.com,1999:blog-8527603153727315280.post-65749864225148713132014-09-24T05:34:00.000-07:002014-09-24T05:34:26.395-07:00CentOS 6 DOMU under NetBSD/xen in 15 minutesA while ago I wrote a quick post on <a href="http://netbsd0.blogspot.co.uk/2012/05/centos-under-netbsdxen-in-15-minutes.html" target="_blank">setting up CentOS 5.x under NetBSD/xen </a><br />
I've long since updated all the CentOS instances to 6.x, but I found I needed to install a fresh version and as the procedure was slightly different, here are some notes :)<br />
<h3>
Converting an existing NetBSD install to Xen DOM0</h3>
<ul>
<li>Install xenkernel42 and xentools42 from pkgsrc</li>
<li>Extract kern-XEN3_DOM0.tgz into /netbsd.dom0 (leave /netbsd alone)</li>
<li>Add the following to /boot.conf - adjust <b><i>512M</i></b> to the amount to reserve for the DOM0 </li>
</ul>
<blockquote class="tr_bq" style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: small;">menu=Xen <i><b>512M</b></i>:load /netbsd.dom0 console=pc;multiboot /usr/pkg/xen41-kernel/xen.gz dom0_mem=<b><i>512M</i></b> noreboot</span></blockquote>
<ul>
<li>Add the following to /etc/rc.conf</li>
</ul>
<blockquote class="tr_bq" style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: small;">xencommons=YES<br />xenwatchdog=YES</span></blockquote>
<ul>
<li>Create /etc/ifconfig.bridge0 with the following - replace <b><i>bge0</i></b> with a suitable Ethernet interface</li>
</ul>
<blockquote class="tr_bq" style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: small;">create<br />!brconfig $int add <b><i>bge0</i></b> up</span></blockquote>
<ul>
<li>Reboot and select the Xen option</li>
<li>Edit /boot.cfg and change the default= entry to the number of the Xen option</li>
</ul>
<br />
To
mis-quote Ken Arnold: "Now that we have a NetBSD DOM0, it would be nice
to do something with it, unless you have the social life of a kumquat
in which case just running the DOM0 may be enough in itself :)"<br />
<br />
Onto setting up the DOMU!<br />
<h3>
</h3>
<h3>
Setting up a CentOS 6 DOMU</h3>
The easiest option it to run the standard CentOS install iso in a xen hvm (Hardware
Virtual Machine) guest, and then after install switch it to a pv (ParaVirtualised) guest. The big advantage of this is it should work for pretty much any guest OS - if the guest does not support xen, just leave it as an hvm guest!<br />
<br />
The follow assume all files are in /opt/xen. Adjust to taste <br />
<ul>
<li>Download the latest <a href="http://mirror.centos.org/centos/6/os/x86_64/images/boot.iso" target="_blank">CentOS 6 install iso</a> </li>
<li>Create a file onto which to install. The below is 20G (20480M)</li>
</ul>
<blockquote class="tr_bq" style="font-family: "Courier New",Courier,monospace;">
dd if=/dev/zero of=centos6.img bs=1m count=20480</blockquote>
<ul>
<li>Create a config file 'centos6.cfg' for installing</li>
</ul>
<blockquote class="tr_bq">
<pre><span style="font-size: x-small;">name = "centos"
memory = "512"
disk = [ 'file:/opt/xen/centos6.img,xvda,w', 'file:/opt/xen/boot.iso,hdc:cdrom,r'
]
vif = [ mac=02:00:00:00:00:01, 'bridge=bridge0', ]
vcpus = 2
builder='hvm'
boot='d'
vnc=1
vncunused=1</span></pre>
</blockquote>
<ul>
<li>Start the domain to install, and then connect to the console using vncviewer. If you are running this remotely on a server you can 'ssh -Y in to proxy the X connection back to your local host</li>
</ul>
<blockquote class="tr_bq" style="font-family: "Courier New",Courier,monospace;">
xm create centos && vncviewer :0.0</blockquote>
<ul>
<li>Complete the CentOS install, then adjust centos.cfg as vmlinuz & initrd are not needed</li>
</ul>
<blockquote class="tr_bq" style="font-family: "Courier New",Courier,monospace;">
<pre><span style="font-size: x-small;">name = "centos"
memory = "512"
disk = [ 'file:/opt/xen/centos6.img,xvda,w', ]
vif = [ mac=02:00:00:00:00:01, 'bridge=bridge0', ]
vcpus = 2</span></pre>
</blockquote>
<h3>
</h3>
<h3>
Points to note</h3>
<ul>
<li>NetBSD/xen does not yet handle modules. If you need pf or ipf you will need to compile your own DOM0 kernel</li>
<li>Not all X drivers run as well under DOM0, the above was done on a server where X was not required</li>
<li>If
the original NetBSD installation was before 5.0 and has been upgraded
you will need to ensure the boot program must be updated</li>
<li>If anyone hits any issues with any of the above, drop me a message & I'll be happy to try to help :)</li>
</ul>
abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com1tag:blogger.com,1999:blog-8527603153727315280.post-8548002009061360972012-09-21T15:04:00.001-07:002012-09-21T15:06:51.530-07:00Netbooting NetBSD on a PC Engines Alix2<table cellpadding="0" cellspacing="0" class="tr-caption-container tr_bq" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="http://pcengines.ch/pic/alix2d2.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="298" src="http://pcengines.ch/pic/alix2d2.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Alix 2d2 board</td></tr>
</tbody></table>
I've been looking for a small box to act as a firewall and OpenVPN server, and someone pointed me at the <a href="http://pcengines.ch/alix2d2.htm" target="_blank">PC Engines Alix</a>2 - a delightful little AMD Geode board, with up to 256M, three Ethernet ports, USB, CompactFlash, miniPCI and a serial console.<br />
<br />
The Geode is a 486 class processor, so will just run NetBSD/i386 directly.<br />
<br />
I picked the 2D2, which just has two Ethernet ports, primarily because the 2D3 was out of stock and I wanted something now :)<br />
<br />
<h3>
Installing NetBSD</h3>
The easiest option would be to put the Compact Flash card into a normal PC, install as normal, and set the boot blocks to use the serial console. Of course this assumes that: (a) you haven't already put the CF card into the Alix and assembled the case, and (b) you're not in the process of redecorating your study, the contents of which have been decanted into a huge pile in the kitchen, with your only CF equipped machine at the bottom.<br />
<br />
So, a good opportunity to test netbooting and install, which I've been doing on Suns and other machines since early 1990's, but this is possibly the first time I've done it on an x86 box. I'm going to use my T500 running NetBSD/amd64 as the server.<br />
<br />
<h4>
1) Console setup</h4>
<h3>
</h3>
The Alix 2 has a serial console defaulting to 38400 bps. As serial ports are a distant memory for most modern machines, my T500 needs a USB to serial adaptor, plus the obvious null model cable. On NetBSD the USB serial port shows up as ttyU0 (or dtyU0 for the 'direct' device), so to connect:<br />
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;"># <b>cu</b></span><span style="font-family: "Courier New",Courier,monospace;"><b><span style="font-family: "Courier New",Courier,monospace;"><b> -l dtyU0</b></span> -s 38400</b></span></blockquote>
Powering on the ALIX rewards me with:<br />
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;">PC Engines ALIX.2 v0.99h<br />640 KB Base Memory<br />261120 KB Extended Memory<br /><br />01F0 Master 848A TS8GCF133 <br />Phys C/H/S 15538/16/63 Log C/H/S 974/255/63 LBA<br /><br />BIOS setup:<br /><br />(9) 9600 baud (2) 19200 baud *3* 38400 baud (5) 57600 baud (1) 115200 baud<br />*C* CHS mode (L) LBA mode (W) HDD wait (V) HDD slave (U) UDMA enable<br />(M) MFGPT workaround<br />(P) late PCI init<br />*R* Serial console enable <br />(E) PXE boot enable <br />(X) Xmodem upload <br />(Q) Quit</span></blockquote>
All that should be required now is to select PXE boot and away we go.<br />
<br />
It is at this point that I will reveal that while the NetBSD PXE boot program is more than happy to speak to the console at the speed it is given, when it goes to load the kernel it seems to switch to 9600 baud (at least as on NetBSD 6.0_RC1). Rather than relate the actual sequence of events (which involved the NetBSD boot startup, go to load the kernel, then some time of watching a non-responsive screen, followed by a "hmmm", and a retry... closely followed by another retry with tcpdump running, a quizzical expression and finally a minor baud rate epiphany, I'll continue as if I already knew about the baud rate issue (purely to make me seem more forward thinking).<br />
<br />
So, that would be a <b>[9]</b>, <b>[e]</b>, <b>[q]</b> and a <b>[y]</b> to save, followed by <b>[RETURN][~][.]</b> to exit cu, and reconnecting at the new speed with<br />
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;"># <b>cu</b></span><span style="font-family: "Courier New",Courier,monospace;"><b><span style="font-family: "Courier New",Courier,monospace;"><b> -l dtyU0</b></span> -s 9600</b></span></blockquote>
This time you should be rewarded with a message ending something like:<br />
<blockquote>
CLIENT MAC ADDR: 00 0D B9 DD EE FE</blockquote>
which we need for the netboot server.<br />
<br />
<h3>
2) The netboot server</h3>
<br />
For this we need three services, conveniently all of which ship with NetBSD:<br />
<ol>
<li>A DHCP server to provide an IP address and details of where to load the boot program (dhcpd)</li>
<li>A tftp server to serve the boot program (tftpd)</li>
<li>An NFS server to provide the NetBSD kernel which the boot program loads (rpdbind, mountd, nfsd)</li>
</ol>
We could extract a full NetBSD/i386 distribution onto the NFS server and
export it to the Alix, but a diskless network routing box which
requires an NFS server to run seems a little... perverse, so we'll just
use a NetBSD INSTALL kernel. <br />
<br />
That means we need two files from a <a href="http://ftp.netbsd.org/pub/NetBSD" target="_blank">NetBSD/i386 distribution</a>:<br />
<ol>
<li>The PXE boot program - installation/misc/pxeboot_ia32.bin</li>
<li>An INSTALL kernel with ramdisk - binary/kernel/netbsd-INSTALL.gz</li>
</ol>
Other items to note, and potentially change in your configuration<br />
<ul>
<li>The gateway to the Internet is at 192.168.2.1</li>
<li>The server is at 192.168.2.2</li>
<li>The Alix is at 192.168.2.3 and named "alix"</li>
<li>The Alix "hardware ethernet" address is copied from above</li>
<li>The directory to NFS export will be /export/alix"</li>
</ul>
So, starting with the dhcpd setup<br />
<ul>
<li>Create an /etc/dhcpd.conf as below</li>
<li>Add "dhcpd=YES" to /etc/rc.conf </li>
<li>Start dhcpd with <b>/etc/rc.d/dhcpd start</b></li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;"># dhcpd.conf</span><br />
<span style="font-family: "Courier New",Courier,monospace;">ddns-update-style none;</span><br />
<span style="font-family: "Courier New",Courier,monospace;">subnet 192.168.2.0 netmask 255.255.255.0 {</span><span style="font-family: "Courier New",Courier,monospace;"> option routers 192.168.2.1;</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> option domain-name-servers 192.168.2.1;</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> host alix {</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> hardware ethernet 00:0d:b9:dd:ee:fe;</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> filename "pxeboot_ia32.bin";</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> fixed-address 192.168.2.3;</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> next-server 192.168.2.2;</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> option host-name "alix";</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> option root-path "/export/alix";</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> }</span><br />
<span style="font-family: "Courier New",Courier,monospace;">}</span></blockquote>
(If its never been run before you will also need to <b>touch /var/db/dhcpd.leases</b>)<br />
<br />
Next the PXE boot program<br />
<ul>
<li>Copy pxeboot_ia32.bin into /tftpboot/pxeboot_ia32.bin</li>
<li>Edit /etc/inetd.conf, uncomment the line starting "#tftp"</li>
<li>Restart inetd with <b>/etc/rc.d/inetd restart</b></li>
</ul>
<br />
Finally the kernel<br />
<ul>
<li>Copy netbsd-INSTALL.gz in /export/alix as netbsd (no need to uncompress it)</li>
<li>Edit /etc/exports and add a line "/export/alix 192.168.2.3"</li>
<li>Add the following lines to /etc/rc.conf "mountd=YES", "nfsd=YES", "nfs_server=YES"</li>
<li>Start the daemons:<b> /etc/rc.d/rpcbind start; /etc/rc.d/mountd start; /etc/rc.d/nfsd start</b></li>
</ul>
<h3>
3) Netbooting the Alix</h3>
<br />
<span id="goog_78633874"></span><span id="goog_78633875"></span>Once all the above is in place we can connect the console, switch on the Alix and netboot it. We need to interrupt the PXE boot program to tell it to use the serial console, but apart from that it should just boot directly into the NetBSD sysinst installer. Log below:<br />
<blockquote>
<span style="font-family: "Courier New",Courier,monospace;">PC Engines ALIX.2 v0.99h<br />640 KB Base Memory<br />261120 KB Extended Memory<br /><br />01F0 Master 848A TS8GCF133 <br />Phys C/H/S 15538/16/63 Log C/H/S 974/255/63 LBA<br /><br />Intel UNDI, PXE-2.0 (build 082)<br />Copyright (C) 1997,1998,1999 Intel Corporation<br />VIA Rhine III Management Adapter v2.43 (2005/12/15)<br /><br />CLIENT MAC ADDR: 00 0D B9 DD EE FE <br />CLIENT IP: 192.168.2.3 MASK: 255.255.255.0 DHCP IP: 192.168.2.2 <br />GATEWAY IP: 192.168.2.1 <br /><br /><br />>> NetBSD/x86 PXE boot, Revision 5.1 (from NetBSD 6.0_POST_RC1)<br />>> Memory: 555/261120 k<br />Press return to boot now, any other key for boot menu<br />booting netbsd - starting in 5 seconds. <b>[SPACE]</b><br />type "?" or "help" for help.<br />> <b>consdev com0</b><br /><br />>> NetBSD/x86 PXE boot, Revision 5.1 (from NetBSD 6.0_POST_RC1)<br />>> Memory: 555/261120 k<br />> <b>boot netbsd</b><br />PXE BIOS Version 2.1<br />Using PCI device at bus 0 device 9 function 0<br />Ethernet address 00:0d:b9:dd:ee:fe<br />10741836+5665276+443200 [573760+563454]=0x11296ac<br />Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,<br /> 2006, 2007, 2008, 2009, 2010, 2011, 2012<br /> The NetBSD Foundation, Inc. All rights reserved.<br />Copyright (c) 1982, 1986, 1989, 1991, 1993<br /> The Regents of the University of California. All rights reserved.<br /><br />NetBSD 6.0_POST_RC1 (INSTALL)<br />total memory = 255 MB<br />avail memory = 234 MB<br />RTC BIOS diagnostic error 0x80<clock_battery><br />mainbus0 (root)<br />acpi_probe: failed to initialize tables<br />cpu0 at mainbus0: Geode(TM) Integrated Processor by AMD PCS, id 0x5a2<br />pci0 at mainbus0 bus 0: configuration mode 1<br />pchb0 at pci0 dev 1 function 0: vendor 0x1022 product 0x2080 (rev. 0x33)<br />glxsb0 at pci0 dev 1 function 2: RNG AES<br />vr0 at pci0 dev 9 function 0: vendor 0x1106 product 0x3053 (rev. 0x96)<br />vr0: interrupting at irq 10<br />vr0: Ethernet address: 00:0d:b9:dd:ee:fe<br />ukphy0 at vr0 phy 1: OUI 0x0002c6, model 0x0034, rev. 3<br />ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto<br />vr1 at pci0 dev 11 function 0: vendor 0x1106 product 0x3053 (rev. 0x96)<br />vr1: interrupting at irq 15<br />vr1: Ethernet address: 00:0d:b9:dd:ee:ff<br />ukphy1 at vr1 phy 1: OUI 0x0002c6, model 0x0034, rev. 3<br />ukphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto<br />gcscpcib0 at pci0 dev 15 function 0: vendor 0x1022 product 0x2090 (rev. 0x03)<br />gcscpcib0: Watchdog Timer via MFGPT0, GPIO<br />gpio0 at gcscpcib0: 32 pins<br />viaide0 at pci0 dev 15 function 2: AMD CS5536 IDE Controller (rev. 0x01)<br />viaide0: primary channel interrupting at irq 14<br />atabus0 at viaide0 channel 0<br />viaide0: secondary channel ignored (disabled)<br />ohci0 at pci0 dev 15 function 4: vendor 0x1022 product 0x2094 (rev. 0x02)<br />ohci0: interrupting at irq 12<br />ohci0: OHCI version 1.0, legacy support<br />usb0 at ohci0: USB revision 1.0<br />gcscehci0 at pci0 dev 15 function 5: vendor 0x1022 product 0x2095 (rev. 0x02)<br />gcscehci0: interrupting at irq 12<br />gcscehci0: companion controller, 4 ports each: ohci0<br />usb1 at gcscehci0: USB revision 2.0<br />isa0 at gcscpcib0<br />com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo<br />com0: console<br />com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo<br />attimer0 at isa0 port 0x40-0x43<br />pcppi0 at isa0 port 0x61<br />midi0 at pcppi0: PC speaker<br />sysbeep0 at pcppi0<br />isapnp0 at isa0 port 0x279<br />npx0 at isa0 port 0xf0-0xff<br />attimer0: attached to pcppi0<br />uhub0 at usb0: vendor 0x1022 OHCI root hub, class 9/0, rev 1.00/1.00, addr 1<br />uhub1 at usb1: vendor 0x1022 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1<br />wd0 at atabus0 drive 0<br />wd0: <TS8GCF133><br />wd0: 7647 MB, 15538 cyl, 16 head, 63 sec, 512 bytes/sect x 15662304 sectors<br />boot device: vr0<br />root on md0a dumps on md0b<br />root file system type: ffs<br />WARNING: clock lost 4632 days<br />WARNING: using filesystem time<br />WARNING: CHECK AND RESET THE DATE!<br />warning: no /dev/console<br />Created tmpfs /dev (1474560 byte, 2848 inodes)</span></blockquote>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDWx30p5yiDKcR9YFNYgotG3ADlS-5a4bG7YoB4oMko92Iqd68X5hldRXGsNpm1ZYMsUnlX7kWP8s3-phSyuY-7glxGqhNReI_HarV7AMxa1wueHCZF-aPv2xRZDGSD5zsQ9LSnsW02yQz/s1600/IMG_20120921_225309.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDWx30p5yiDKcR9YFNYgotG3ADlS-5a4bG7YoB4oMko92Iqd68X5hldRXGsNpm1ZYMsUnlX7kWP8s3-phSyuY-7glxGqhNReI_HarV7AMxa1wueHCZF-aPv2xRZDGSD5zsQ9LSnsW02yQz/s320/IMG_20120921_225309.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Alix running sysinst (via T500)</td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
Followed by the sysinst screen. The only thing to remember is that when prompted to install the boot blocks, select the serial console version, and your preferred speed (I went back to 38400 at that point).abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com2tag:blogger.com,1999:blog-8527603153727315280.post-82511930143640046912012-08-17T12:21:00.000-07:002012-10-19T12:51:58.314-07:00Instant wifi - just add "Edimax EW-7811UN"<div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGf30ElzqRJavn_nf7YdU0A5XWKLJiY5Zt6EtGbTjdXcbVKIuTs_0l8HlbqFfOXoITnh8K1ImDfpWIQ1jqUhNz24xjfPm5dQB6U5QuYjynq7FW9tNizrfgQaWZMKMSQpj2I3Di07_DumkL/s1600/IMG_20120817_184204.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGf30ElzqRJavn_nf7YdU0A5XWKLJiY5Zt6EtGbTjdXcbVKIuTs_0l8HlbqFfOXoITnh8K1ImDfpWIQ1jqUhNz24xjfPm5dQB6U5QuYjynq7FW9tNizrfgQaWZMKMSQpj2I3Di07_DumkL/s320/IMG_20120817_184204.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Archimedes could use one of these with a pivot</td></tr>
</tbody></table>
Ah, the 3Com OfficeConnect 3CRUSB10075. I remember it well...<br />
<br />
About five years ago this would have been sold as a USB wifi adaptor, though its actual purpose was more to test the structural integrity of laptop USB ports. Extending no less than three inches, it was also cleverly more than an inch wide - providing the added bonus of preventing laptops with vertical USB ports from sitting flat.<br />
<br />
Slightly larger than the average car's indicator controls, and also slightly easier to hit, it was close to guaranteed that at some point *something* would strike the OfficeConnect a lateral blow, resulting in two goodly sized pieces of grey plastic, one still securely connected to the USB port.<br />
<br />
Of course the unlucky would find themselves with one very large piece of plastic, still securely connected to your USB port, and a usb sized hole in the side of the laptop.<br />
<br />
For mild amusement, I plugged it into my Thinkpad (after turning the laptop on its opposing side, then using both hands and alignment rails to guide it into place) and NetBSD's dmesg blurted out:<br />
<blockquote class="tr_bq" style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">zyd0 at uhub3 port 1<br />zyd0: 3COM 3CRUSB10075, rev 2.00/43.30, addr 2<br />zyd0: HMAC ZD1211, FW 46.05, RF RFMD, PA 0, address 00:0f:cb:c0:8c:d6<br />zyd0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps<br />zyd0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps</span></blockquote>
If I recall it even came with a cap - which itself was around three times the size of the other USB wifi adaptor in the picture - an Edimax EW-7811UN.<br />
For the princely sum of GBP8.95 delivered this diminutive device provides wifi connectivity without significantly adjusting your machine's centre of gravity:<br />
<blockquote class="tr_bq" style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">urtwn0: Realtek 802.11n WLAN Adapter, rev 2.00/2.00, addr 2<br />urtwn0: MAC/BB RTL8188CUS, RF 6052 1T1R, address 80:1f:02:61:13:b0<br />urtwn0: 1 rx pipe, 2 tx pipes<br />urtwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps<br />urtwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps</span></blockquote>
I had hoped to provide some benchmarks between the two USB devices and my Thinkpad's built in Intel PRO/Wireless 5100 AGN:<br />
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace; font-size: x-small;">iwn0 at pci3 dev 0 function 0: vendor 0x8086 product 0x4237 (rev. 0x00)<br />iwn0: interrupting at ioapic0 pin 17<br />iwn0: MIMO 1T2R, MoW, address 00:16:ea:c5:bb:10<br />iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps<br />iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps<br />iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps</span></blockquote>
... but unfortunately the OfficeConnect appears to no longer be able to associate with my WPA2 network. Possibly some of its valves have worn out, or maybe a small family of mice have set up residence inside - I would shake it to see if it rattles but I fear I might put my back out... <br />
<br />
For reference the PRO/Wireless 5100 reported ttcp rates of 17.2 Mbit/sec send and 16.9 Mbit/sec receive, while the Edimax managed 12.7 Mbit/sec and 12.2 Mbit/sec.<br />
<br />
Not earth shattering, but not too bad either. <br />
<br />
So what prompted this trip down "USB wifi adaptors the size of vinyl records" memory lane? Someone on a mailing list was running NetBSD on a macbook and it wasn't recognising the wifi. I suggested trying a nano USB wifi dongle, but I wanted to recommend one that worked - so I bought one to see it work.<br />
<br />
In the process I found out that while NetBSD-current included the urtwn driver and the firmware, NetBSD-6 BETA2 only had the driver and required a manual download of the firmware, so I submitted a pullup request to get the firmware into the NetBSD-6 release - its always nice to have stuff work Out Of the Box :)<br />
<br />
About the only thing bad I could have to say about the Edimax is its use of one of those violently blue LEDs - you know the one's suitable for landing aircraft in heavy fog or signalling direct to the Curiosity rover on Mars. It doesn't have any gaps or transparency in the case - the LED just shines directly through the black plastic (and I suspect the metal USB plug if it was far enough out of the machine).<br />
<br />
(some time elapses, as it does)<br />
<br />
Now *that* is interesting... in a "random profanity and threatening of inanimate objects" sort of way...<br />
<br />
Presumably the OfficeConnect did not appreciate my less than glowing comments about it - that, or possibly because I forgot to use the correct guide rails and block-and-tackle to remove it from the machine - when I unplugged it my laptop hung for a moment and then rebooted.<br />
<br />
More deserving of the profanity however, on reboot the laptop hung when probing the CPU. Repeated. Powered off, leaving for a minute and back on and it *still* hung on probing the CPU. Eventually I removed the battery and power cable, held the power button down for 30 seconds, then reassembled and successfully booted.<br />
<br />
So it appears the OfficeConnect is capable of deranging the USB hardware on a Thinkpad sufficiently well to require a complete disconnection and draining of all power. Handy... if you like the sensation (albeit briefly) of all blood draining from your face as you consider the prospect of your laptop having just been completely fried.<br />
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrs79DJd5p8g-dJPwOe7DpDAxGlq_x6gj7-5uyY3TVrVj_WzDtlRsMBsfTqt-cWYYEa-epqsn6z-gmOUbjYFKr3jtUk_MjYyQJdWq1BDFX7K_qzx7uUay6k8KLJvsG_81jr-QVUBxqMhxh/s1600/IMG_20120817_195954.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="236" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrs79DJd5p8g-dJPwOe7DpDAxGlq_x6gj7-5uyY3TVrVj_WzDtlRsMBsfTqt-cWYYEa-epqsn6z-gmOUbjYFKr3jtUk_MjYyQJdWq1BDFX7K_qzx7uUay6k8KLJvsG_81jr-QVUBxqMhxh/s320/IMG_20120817_195954.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Things you would prefer not to fall out of your battery</td></tr>
</tbody></table>
As an added bonus, when I removed the battery I found myself in possession of a small spring and broken black plastic tag, which appear to have fallen out of the battery.<br />
<br />
It could be a subtle suggestion that its time to replace the battery, or a somewhat less subtle hint that I really should drop the Thinkpad less..<br />
<div style="clear: both;">
</div>
<br />
Anyway, that concludes today's "Fun With WiFi And NetBSD" - and today's top hints are:<br />
<ul>
<li>Edimax make a cheap and usable tiny wifi adaptor</li>
<li>If you have an old wifi adaptor large enough use as furniture, just carefully dispose of it</li>
<li>While repeatedly dropping a Thinkpad may make it gradually lighter over time, its not a good idea</li>
</ul>
<br /></div>
abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com0tag:blogger.com,1999:blog-8527603153727315280.post-20960132696235341332012-08-04T05:18:00.000-07:002012-08-04T05:46:28.814-07:00Final Dreamcastery nonsense at the end of Retrochallenge 2012Retrochallenge 2012 has come to an end, so this is a catchup post of the mainly Dreamcast related foolery over the past week.<br />
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLIBkz4ouE_iNeGyIkcT3Xr8wbHao2l90kvy20T_gvnOkr6zoXcI4aEoFBqa4YZxciBqq6Uep6dlV8SF97wxN0ZHhIJecxxQm0rwD8UZtDGFbNiDWlKMV3nq2svvqhV46jA958nwKq3Sdz/s1600/dcext.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLIBkz4ouE_iNeGyIkcT3Xr8wbHao2l90kvy20T_gvnOkr6zoXcI4aEoFBqa4YZxciBqq6Uep6dlV8SF97wxN0ZHhIJecxxQm0rwD8UZtDGFbNiDWlKMV3nq2svvqhV46jA958nwKq3Sdz/s1600/dcext.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">What every Dreamcast needs</td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
Quite some time ago Kiyoshi IKEHARA designed a <a href="http://www.fuzzymuzzle.com/Kiyoshi/DCEXT.htm" target="_blank">DCEXT</a> board enabling connection of an IDE disk and an ISA (typically network) card to NetBSD/dreamcast, (I believe <span class="gD" name="Izumi Tsutsui">Izumi Tsutsui wrote the code</span>). The patches never made it back into the main NetBSD tree and have just been maintained by <span class="gD" name="Izumi Tsutsui">Izumi.</span><br />
<span class="gD" name="Izumi Tsutsui"> </span> <br />
Now someone is trying to add support for it to DreamShell, an alternative gaming OS for the Dreamcast, so I found a copy of the patches for netbsd-5, tweaked them for current, built a test kernel <a href="http://www.dc-swat.ru/forum/thread-1902.html" target="_blank">posted it to their forum</a>.<br />
<br />
Annoyingly the email notification of subsequent comments didn't seem to work for me, so I missed the very quick response asking for a kernel with additional debug. Just seen it now, so just built & uploaded it now :)<br />
<br />
Elsewhere in my world of retro-challenge I still don't have public IPs for wopr (VAX) and orac (Dreamcast) after the office move, so wopr is very lonely on an internal network and orac is at home (where at least I can poke at it).<br />
<br />
Unfortunately my "at home" Dreamcast CD-R burning opportunities are somewhat limited:<br />
<ul>
<li>My thinkpad DVD drive is more than a little unwell. It writes CDs that not even it can read, and had a tendency to just randomly eject at any point during the day. Hence its been replaced by an sata drive bay</li>
<li>Michelle has a macbook air, which is beautiful, but optical-drive-less</li>
<li>My gaming PC has a blueray drive, and none of the CD-Rs it generates work with the DC. I have a whole stack of coasters that prove adjusting speed, burn options, or switching NetBSD/Windows has no effect</li>
<li>I have a Mac-mini which has a drive, but only OSX installed. (thinks). I *could* port dc-burn-netbsd to OSX, or at least the "burn existing ISO" option... </li>
</ul>
Anyway...<br />
<br />
I had a play with telling NetBSD to add unused video ram to the normal kernel memory. Works perfectly on gxemul, but real hardware was a little pickier, so that it going to take some more work (if its possible).<br />
<br />
Nick Hudson posted me a Dreamcast serial cable he was now longer using, which enabled me to find out that getty and remote are *really* fussy about using a read-only /dev, so I'm probably going to have to switch my live CD to use the standard tmpfs /dev trick. That is annoying to the tune of around 300K of wasted memory, but not the end of the world.<br />
<br />
My current "goal of randomness" is to get the live CD to show a prompt in an xterm. Thats readonly-root-on-iso9660, with misc tmpfs & union mounts, running multi-user in 16M without swap, with the X server and one xterm running.<br />
<br />
I've tested it on root-on-nfs without swap, so I think it should be doable... just. I wonder if I should add an option to dc-burn-netbsd to create a root filesystem suitable for testing over NFS - to avoid a fresh coaster per test (and the feeling that I can hear the Dreamcast CD seek mechanism expiring before my ears).<br />
<br />
As if the VAX & Dreamcast retro-madness isn't enough I've just collected a PowerBook Duo 270c from someone who ran out of space. 12M RAM, 240M disk, 68030 & a 9" 640x480 screen. Its so *tiny* and cute that I actively want to do something useful with it, unfortunately its only I/O consists of two serial ports and a dock connector.<br />
<br />
Did I mention I also picked up a Duo Dock II with it, which has a vast selection of ports, floppy drive, space for an addition disk, an FPU chip, additional VRAM, and two nubus slots. It addresses the "tiny, cute but no ports" aspect of the Duo 270c in a big way. However...<br />
<br />
<div style="text-align: right;">
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6S1gnxM_hdwDR7qoPa47wWvwXYiW0Jqo0GOWJJK2iuOR3ZIwouRIqo5bjzu3eSmyPOiQzdAVcJSjLMnRq6nLZ709OLobdlBVCOhxdhoqq9xsi4Iy1qskS9Z2rq4vAepq3wVkLzGpwZiPA/s1600/IMG_20120804_130630.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6S1gnxM_hdwDR7qoPa47wWvwXYiW0Jqo0GOWJJK2iuOR3ZIwouRIqo5bjzu3eSmyPOiQzdAVcJSjLMnRq6nLZ709OLobdlBVCOhxdhoqq9xsi4Iy1qskS9Z2rq4vAepq3wVkLzGpwZiPA/s200/IMG_20120804_130630.jpg" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Do not make Dock angry. Dock crush!</td></tr>
</tbody></table>
</div>
<ol>
<li>It is the size and weight of a small bus. I keep having to check underneath for wheels</li>
<li>The network port does not appear to be fitted - so the *one* thing I need most, it doesn't do</li>
<li>It requires the laptop to be closed and inserted - so I now need to find a an external ADB mouse, keyboard, and a mac compatible monitor (or adaptor)</li>
</ol>
<br />
<ol>
</ol>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5ESLUVUVnYuqpesb-w88lDBX7IF7Fh08VTT_ggFo5vqQ5MmgXUBHx8r2Vg4mL_-JiTvljMe03xRkQ7nAkbSK3IpVl3s698GsuSewtqZtT3VYfK6iHXGSwE4FacYqIPZwpvg77gvWY_0n0/s1600/user1367_1175084187.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5ESLUVUVnYuqpesb-w88lDBX7IF7Fh08VTT_ggFo5vqQ5MmgXUBHx8r2Vg4mL_-JiTvljMe03xRkQ7nAkbSK3IpVl3s698GsuSewtqZtT3VYfK6iHXGSwE4FacYqIPZwpvg77gvWY_0n0/s1600/user1367_1175084187.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Don't worry, its Apple approved</td></tr>
</tbody></table>
There is a beautiful scene from the film <a href="http://www.imdb.com/title/tt0088846/" target="_blank">Brazil</a>, where Robert De Nero - playing a renegade special forces equipped air conditioning engineer - pulls out a tiny component and says "thats your problem". When asked if he can fix it he says "no, but I can bypass it with *this*" and proceeds to take from his bag what can only be described as a cross between a cybernetic cthulhu and the spinal column of a robot made from valves.<br />
<br />
I look at the tiny Duo 270c and the across at the docking station from hell, and think... "Thank you Robert, that will do just fine".<br />
<br />abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com1tag:blogger.com,1999:blog-8527603153727315280.post-30655392639311573632012-07-27T17:37:00.000-07:002012-07-27T17:37:13.159-07:00Nice NetBSD/dreamcast shell script, but can you do it under Windows?<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqFWB3eOw9dR96aEi37xjrypfP-rHlJy5sUp_ezHKgjXkBXdmqVJgh4yXJ_MSc8DIS9V3lbaUllMdPDoT8EB157uoivvqqran3srjN4I4oaBEiJaMZV7SmdLXI3X9FZ1yTC9ScmKZkftFd/s1600/win7_wp_1.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqFWB3eOw9dR96aEi37xjrypfP-rHlJy5sUp_ezHKgjXkBXdmqVJgh4yXJ_MSc8DIS9V3lbaUllMdPDoT8EB157uoivvqqran3srjN4I4oaBEiJaMZV7SmdLXI3X9FZ1yTC9ScmKZkftFd/s320/win7_wp_1.jpg" width="320" /></a></div>
I posted about the dc-burn-netbsd script on one of the Dreamcast forums, and someone asked if they could run the script under Windows.<br />
<br />
I suspect pointing him at Microsoft's current *nix-on-Windows solution (Interix? Windows Services for Unix? Subsystem for UNIX-based Applications? Grudgingly Provided but Subtly Maladapted Compatibility Subsystem for Customers Who Otherwise Would Use Some OS Begining with L?)... might have (quite rightly) have been met with a vigorous but somewhat impolite reply, so I decided to generate an image for him to burn directly.<br />
<br />
I also took the opportunity to cleanup dc-burn-netbsd a little more:<br />
<ul>
<li>split out 'extract sets' from 'setup extracted data for live usage' (now -l) - after all, why should I assume my live setup is the One True Way?</li>
<li>tweaked live setup further (do we *really* want to try to rebuilding the X11 fontcache? I think not), and /etc/motd was not reporting the kernel version (tsk, fer-shame)</li>
<li>making -l default to the right kernel and minimal sets. I have a deep seated antipathy towards typing many options on a command line. (If I'm building a live CD then it should be able to work out that it needs some sets and a non ramdisk kernel - but only as a default of course, if the user wants to explicitly select something apparently stupid... "here is rope")</li>
<li>Adjusting default behaviour to generate but not burn the image (added -b to burn). Ah, now I have a naming crisis as it no longer "does what it says on the tin" by default. Foo. I'll come back to that later</li>
</ul>
He also asked another question - to paraphrase it - "why?"<br />
<br />
Currently the motivation for all this has been "because its there" - while NetBSD/dreamcast can run a whole bunch of standard unix software (see <a href="http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/dreamcast/5.1_2012Q1/All/">http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/dreamcast/5.1_2012Q1/All/</a> for example), not all of it necessarily makes sense on such a platform.<br />
<br />
But again... "here is rope" :)<br />
<br />
<br />
<br />
I also put together a README (I'll quote it below - mainly on the grounds I've already spent time writing it, got distracted watching the Olympics opening ceremony, and its a cheap way to pad out the rest of this entry)<br />
<br />
<br /><u style="color: blue;">netbsd-dreamcast-6_BETA2.iso.README</u><br style="color: blue;" /><br style="color: blue;" /><span style="color: blue;">Sample NetBSD/dreamcast live image (Generated by "dc-burn-netbsd -l -n"):</span><br style="color: blue;" /><br style="color: blue;" /><span style="color: blue;">Requirements</span><br style="color: blue;" /><span style="color: blue;">- Dreamcast or gxemul emulator (*)</span><br style="color: blue;" /><span style="color: blue;">- If using a real Dreamcast, blank CD-R & Dreamcast keyboard</span><br style="color: blue;" /><span style="color: blue;">- Optional: Dreamcast BBA (broadband adaptor) for network access</span><br style="color: blue;" /><br style="color: blue;" /><span style="color: blue;">Usage:</span><br style="color: blue;" /><span style="color: blue;">- Download netbsd-dreamcast-6_BETA2.iso.7z and uncompress to get .iso image</span><br style="color: blue;" /><span style="color: blue;">- To burn to CD for booting on Dreamcast:</span><br style="color: blue;" /><span style="color: blue;"> - On Windows use http://code.google.com/p/bootdreams/downloads</span><br style="color: blue;" /><span style="color: blue;"> - On NetBSD no need to download this, use http://pkgsrc.se/sysutils/dc-tools</span><br style="color: blue;" /><span style="color: blue;"> and run 'dc-burn-netbsd -l' directly </span><br style="color: blue;" /><span style="color: blue;">- To boot in gxemul (*) run</span><br style="color: blue;" /><span style="color: blue;"> "gxemul -XEdreamcast -d co23965696:netbsd-dreamcast-6_BETA2.iso"</span><br style="color: blue;" /><span style="color: blue;">- Once booted enter "gdrom0" and return three times when prompted</span><br style="color: blue;" /><span style="color: blue;">- Login as "root"</span><br style="color: blue;" /><br style="color: blue;" /><span style="color: blue;">This is still a work in progess, in particular future goals for future versions</span><br style="color: blue;" /><span style="color: blue;">include:</span><br style="color: blue;" /><span style="color: blue;">- Including installed binary packages such as some from </span><br style="color: blue;" /><span style="color: blue;"> http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/dreamcast/5.1_2012Q1/All/</span><br style="color: blue;" /><span style="color: blue;">- Switching to a shell with command line editing</span><br style="color: blue;" /><span style="color: blue;">- Support for Serial-SD and potentially Serial-Ethernet adaptors</span><br style="color: blue;" /><span style="color: blue;">- Better X support (currently insufficient memory to effectively run)</span><br style="color: blue;" /><br style="color: blue;" /><span style="color: blue;">(*) Running under gxemul requires gxemul-0.6.0nb3 or later from pkgsrc, or the</span> <span style="color: blue;">patch-src_devices_dev__dreamcast__gdrom.cc patch applied to gxemul-0.6.0</span><br />
<br />
<span style="color: blue;"><span style="color: black;">Interestingly X doesn't </span> </span><span style="color: blue;"></span>start under gxemul - I'll need to test on real hardware before I dig further into that, but as my DC is in my office, and I'm currently in a Days Inn in Winchester (not Inglewood - that was a rather different experience), that will have to wait...<br />
<br />abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com0tag:blogger.com,1999:blog-8527603153727315280.post-8878641341644191802012-07-26T16:44:00.001-07:002012-08-04T05:48:37.774-07:00Virtual Dreamcast - Virtual (a)Live?<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhewEgrfbiZx7FHNJZ6bcu-rVQsY2buXbWdvf7xCt_Yc9jqfPtIO_hUinftokmaUE4aDIL0xsKv_rmKmlfwBlHvXBs29C-O2HOe7j3_AHm1WsMTQfQcBL0B7fkAlEGFkodQ0qJxeaHwzTXR/s1600/virtual.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="248" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhewEgrfbiZx7FHNJZ6bcu-rVQsY2buXbWdvf7xCt_Yc9jqfPtIO_hUinftokmaUE4aDIL0xsKv_rmKmlfwBlHvXBs29C-O2HOe7j3_AHm1WsMTQfQcBL0B7fkAlEGFkodQ0qJxeaHwzTXR/s320/virtual.png" width="320" /></a></div>
There has been something of a hiatus in my Retrochallenge 2012 postings. <br />
<br />
Last Tuesday evening I visited <a href="https://london.hackspace.org.uk/" target="_blank">London Hackspace</a> and... made it home in the decidedly early hours of Wednesday morning, rather neatly occupying the time during which I would have tried to do something Retrochallenge related and then have written about it.<br />
<br />
Then as ever, "stuff happened", but finally I have made time to get back to it!<br />
<br />
"...Last episode on Retrochallenge2012, I was doing something with a Dreamcast, or a VAX - I really can't remember now, possibly even combining the two in a gratuitous and potentially amusing fashion, but I did remember that trying to create a Dreamcast live CD was quite an annoying process, requiring as it did burning a CD-R each time to test.<br />
<br />
Enter <a href="http://gxemul.sourceforge.net/" target="_blank">gxemul</a>, a very nice set of emulators which included one that could boot NetBSD/dreamcast, including a rather elderly NetBSD-3.0 live CD image. Unfortunately... I was unable to get a recent NetBSD CD image to mount - the kernel would load, I could view the start of the CD image partition which looked fine, but it would just refuse to mount the ISO9660 filesystem.<br />
<br />
Sprinkling some debugging prints in both the kernel and gxemul (it is *so* much nicer to be able to debug from both sides), revealed the NetBSD kernel trying to access sectors somewhere in the multigigabyte range (a neat trick on a medium with a maxiumum of 900MB capacity).<br />
<br />
The issue, it transpires, was gxemul only fakes up enough of a CD ToC (Table of Contents) to allow NetBSD to boot... specifically NetBSD 3.0. NetBSD 4.0 and later have stricter requirements. Actually the code is very similar and I have a horrible feeling that the fake ToC caused the NetBSD 3.0 gdrom code to fall off the start of an array and read some nulls. Nasty.<br />
<br />
So I went searching for the CD ToC specifications, and eventually determined that I needed the Yellow and Red Book standards, written by Sony & Philips and apparently still to this day considered commercially privileged and not freely available. However... their contents match the freely available (and catchy named) <i><a class="external text" href="http://www.ecma-international.org/publications/standards/Ecma-130.htm" rel="nofollow">Standard ECMA-130: Data Interchange on Read-only 120 mm Optical Data Disks (CD-ROM)</a></i> which has insane level of detail on the ToC (among other things).<br />
<br />
So I read the relevant section, rubbed my eyes a few times and read it again, then took out a pad & paper and thought about drawing diagrams... and then read it again. I considered the strange need for some engineers to produce overly complicated and involved solutions, and about technical writers who actively despised their potential readers.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-UMLeVeqoLl4/UBHT0lyhl_I/AAAAAAAANO4/ccZjxXrpCAs/s1600/q.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="188" src="http://2.bp.blogspot.com/-UMLeVeqoLl4/UBHT0lyhl_I/AAAAAAAANO4/ccZjxXrpCAs/s320/q.png" width="320" /></a></div>
I just have to share Figure 15 at this point. Looks nice and simple? Just split up 96 bits into sections? Only... bits 0..97 makes *98* bits, and the Control bits have two extra bits (for free). Don't even get me started on how each track has 4 bytes in the ToC data returned, but something like 10 bytes in the spec. <br />
<br />
<br />
Then I experimented with building gxemul with some values that should have made sense... but apparently didn't. In the end I burned a NetBSD/dreamcast disk with a modified kernel which dumped the ToC values, then updated gxemul to fake a more convincing ToC...<br />
<br />
Final result is an updated gxemul which will boot NetBSD/dreamcast 3, 4, 5 & 6 kernels, a NetBSD/dreamcast kernel option to dump the gdrom ToC, and a tweak to the gdrom parsing code to reject too-fake ToC values.<br />
<br />
Once the above was reached it only took a few quick iterations to get <a href="https://github.com/abs0/dc-burn-netbsd" target="_blank">dc-burn-netbsd</a> building fully functional Dreamcast live CDs, including the ability to login to both the graphical and the serial consoles - literally multiple users on a virtual Dreamcast without any network interfaces or persistent storage, virtual or otherwise. And they say retrocomputing emulation has no practical use? Pffff...abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com0tag:blogger.com,1999:blog-8527603153727315280.post-32667795231894834952012-07-16T14:52:00.001-07:002012-07-17T02:03:12.857-07:00wargames meets Linux (and Dreamcast VGA)<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-NNoq1bGjPfE/UASCMl-KzUI/AAAAAAAANEE/v43zy3IwOJQ/s1600/fedora-logo.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><br /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<a href="http://3.bp.blogspot.com/-NNoq1bGjPfE/UASCMl-KzUI/AAAAAAAANEE/v43zy3IwOJQ/s1600/fedora-logo.png" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://3.bp.blogspot.com/-NNoq1bGjPfE/UASCMl-KzUI/AAAAAAAANEE/v43zy3IwOJQ/s1600/fedora-logo.png" /></a>When I wrote a small script to simulate the <a href="http://netbsd0.blogspot.co.uk/2012/07/wargames-for-masses.html" target="_blank">W.O.P.R. computer from wargames</a>, little did I expect it to help me learn some new things about Linux (specifically Fedora in this case).<br />
<br />
One criticism often cast towards people writing software on Linux is that they only write it for Linux, not caring about basic portability to other systems. Sometimes there has obviously been a pass to make it run on OS/X also, though earlier versions of XBMC were my go-to case for "portability" code which only cthulhu could love (So, if #ifdef _LINUX <b>and</b> #ifdef APPLE then... no, wait, <i>what?</i>)<br />
<br />
Anyway, My Little Pony-I-mean-Wargames script was written on NetBSD, for my own use, but not intentionally using any NetBSD specific features.<br />
<br />
Since I had the temerity to <a href="https://github.com/abs0/wargames" target="_blank">host it on github</a>, of course someone is going to come along and try to build it on their $OS_of_choice, in this case Fedora.<br />
<br />
So, lets count my portability fails<br />
<ol>
<li>I used "tput up" to move the cursor up, rather than "tput cuu1" (both work on NetBSD). To be fair "cuu1" does sound more like something a standards committee would define, probably short hand for "CursorUnproportionablyUpOneLineOnly"</li>
<li>I used "{.TARGET}" and "${.ALLSRC}" in the Makefile. Gmake does not support these, which is interestingly as I thought the gmake project mission statement was to make bash look like a lean, minimally functional application. Still, easy enough to hardcode the values & we're portable</li>
<li>I include a getopt(3) using program for outputting text called wopr, which at one point was called as 'wopr "IDENTIFICATION NOT RECOGNIZED BY SYSTEM" "--CONNECTION TERMINATED--" ""'. Traditional getopt() usage has option parsing stop when the first non '-' prefixed argument is reached. Linux is more... helpful... in this respect and happily picks up options from anywhere in the arguments... and quite possibly from the environment and your dotfiles. Wait... (check online), No, apparently I only *thought* I was kidding:</li>
</ol>
<blockquote class="tr_bq">
ENVIRONMENT VARIABLES
<br />
<dl compact="compact">
<dt><b>_<PID>_GNU_nonoption_argv_flags_</b>
</dt>
<dd>This variable was used by
<b>bash</b>
2.0 to communicate to GNU libc which arguments are the results of
wildcard expansion and so should not be considered as options. This
behaviour was removed in
<b>bash</b>
version 2.01, but the support remains in GNU libc.
</dd></dl>
</blockquote>
So, now wargames now runs on Linux. Anyone with a Solaris/Illuminos machine want to take a pass? :)<br />
<br />
(I'd like to thank the person on github who took the time to try wargames, and then fix it up to run on Fedora, and who should not take anything of the above as ingratitude :)<br />
<h3>
... meanwhile, on planet Dreamcast</h3>
In an <a href="http://netbsd0.blogspot.co.uk/2012/07/dreamcast-display-fail-now-with-added.html" target="_blank">earlier posting</a> I may have commented on the quality of the construction of a newly acquired Dreamcast SD+VGA adaptor in a fashion which might have been construed as potentially disparaging. I am now delighted to revise that previous comment and to be able to state positively that indeed, it is a bit sh*t. By repeatedly pressing the plug into the back of the Dreamcast, and - god help me yes - by tilting to engage the assistance of gravity, I now have a clear and fully usable display. As before, walking heavily, sneezing, or careless placing of coffee cups near the machine is strictly prohibited.<br />
<br />
I appear to be getting carried away in <a href="http://netbsd0.blogspot.co.uk/2012/07/tidying-up-at-end-of-week.html" target="_blank">mentioning previous postings</a>, in this case why gxemul was not able to mount the CD as a root filesystem while booted. I am lightly disappointed to say it does not appear to be some boneheaded mistake in my script as the CD image runs fine on real hardware, so if I want to use gxemul to test root-on-cd9660 Dreamcast image I'm going to have to poke into the gxemul source. Definitely still retrochallenge 2012 material, though only just :)<br />
<br />
<h3>
</h3>abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com3tag:blogger.com,1999:blog-8527603153727315280.post-17125156226844883902012-07-15T17:37:00.000-07:002012-07-17T02:03:36.095-07:00Tidying up at the end of the week<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiczRr3Lcqdiy4RzM02tKdahvFMrpyO_qqaf1MAkliWyZblKlnC88wCXI8bqCnq8rCQiYCqtCO8mBEsh4OWP3NU5ZYGin872aKZIlMTb2uHuiGKUQsMt3vYVxuUajh0vk3gMpbKYHpH_vv5/s1600/IMG_20120716_010216.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiczRr3Lcqdiy4RzM02tKdahvFMrpyO_qqaf1MAkliWyZblKlnC88wCXI8bqCnq8rCQiYCqtCO8mBEsh4OWP3NU5ZYGin872aKZIlMTb2uHuiGKUQsMt3vYVxuUajh0vk3gMpbKYHpH_vv5/s320/IMG_20120716_010216.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Spot the server, printer, or cow</td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
Spent some of today tidying up the house, and a little bit tidying up in the Dreamcast and VAX emulation world.<br />
<ul>
<li>Updated the <a href="http://www.netbsd.org/ports/vax/emulator-howto.html" target="_blank">Booting NetBSD/vax in SIMH howto</a> to reflect the changes in NetBSD-6, point to the correct page for the simh pkgsrc package and misc cleanup</li>
<li>Updated the <a href="http://www.netbsd.org/ports/dreamcast/howto.html" target="_blank">NetBSD/dreamcast howto</a> to point at the two very much easier methods of burning a Dreamcast CD</li>
<li>Relaxed the timer granularity check on the SIMH pkgsrc package to allow setting the idle check on machines with HZ=100 - now emulated vax machines do not need to max out the host CPU all the time</li>
<li>Fixed the configure mkstemp() check on the gxemul pkgsrc package, so it can boot full Dreamcast CD images again</li>
<li>Adjusted the dc-burn-netbsd script to include a full set of devices in the release-in-root-on-cd case, and attempted to test this in gxemul (hence the previous item)</li>
</ul>
Interestingly I discovered that once the CD image was booted in gxemul attempting to mount the CD failed with the (verbose) gxemul console messages:<br />
<blockquote class="tr_bq" style="font-family: inherit;">
[ GDROM cmd: 30 20 39 fd 9c 00 00 00 00 00 01 00 (cnt=2048) ]<br />
[ diskimage__internal_access(): disk_id 0, offset 2791911424, transfer not completed. len=2048, len_done=0 ]<br />
GDROM: diskimage_access failed? TODO </blockquote>
<span style="font-family: inherit;">Given the entire ISO image was 97,910,784 bytes in size, I suspect tying to access data at offset 2,791,911,424 is unlikely to yield a happy result in any universe with congruent natural laws to our own, but just to make sure I'll try to test on a real Dreamcast tomorrow.</span><br />
<br />
<span style="font-family: inherit;">Looks like I'll either be hacking my dc-burn-netbsd script to determine what boneheaded bug I've added, or gxemul's dev_dreamcast_gdrom.cc. Good good!</span><br />
<span style="font-family: inherit;"><br /></span>abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com0tag:blogger.com,1999:blog-8527603153727315280.post-19550063757130606892012-07-14T17:11:00.002-07:002012-07-14T17:11:56.756-07:00Potential VAX gcc news (and damp dogs)<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhevrwE7fSN7mbY9FwfI67pABzIWr9vbvGkJ106TFbpIX5xubFSK4M0a_53cEqJAzaHIkqt3x7q7O536mHL9tjy8PWD9OD1y1LXSu8dXc6HZnfKJrVIYfKrwH4BVdhomlWjBf7ILuG1fl3W/s1600/dis.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="227" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhevrwE7fSN7mbY9FwfI67pABzIWr9vbvGkJ106TFbpIX5xubFSK4M0a_53cEqJAzaHIkqt3x7q7O536mHL9tjy8PWD9OD1y1LXSu8dXc6HZnfKJrVIYfKrwH4BVdhomlWjBf7ILuG1fl3W/s320/dis.png" width="320" /></a></div>
Today was not particularly productive in Retrochallenge terms - I visiting my parents and spent a large part of it digging fresh palisade roll into their garden, ably "assisted" by two dogs, one of whom tried to stand exactly wherever I needed to be, and the other just dug up random sections of flowerbed.<br />
<br />
<br />
Fortunately it was raining continually, which should have driven the dogs indoors, rather less fortunately they were so caught up in helping me that they remained outside the entire time, finally following me back in trailing that distinctive fragrance of "damp dog"... and mud. Don't forget the mud.<br />
<br />
I did manage to exchange email with someone who is both an expert on VAX assembler and gcc, who now has an simh NetBSD environment setup, and is investigating the possibility of fixing the latest gcc to be able to compile VAX executables which bear at least a passing resemblance to their source code.<br />
<br />
This is definitely a Good Thing (in VAX terms), and would benefit anyone looking to compile VAX executables for any system using a recent gcc (Granted, this may be a rather exclusive club).<br />
<br />
Oh, and I did fix a recently added reference in the NetBSD atf tree which unconditionally pointed to the gcc-4.5 stdc++, breaking the gcc-4.1 build (and I'm going to go out on a limb and guess the set of people who care about <b>that</b> make the group in the previous paragraph seem like a thundering herd).<br />
<br />abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com0tag:blogger.com,1999:blog-8527603153727315280.post-52461650178511295672012-07-13T15:42:00.000-07:002012-07-13T15:47:41.380-07:00Dreamcast display fail. Now with added SD-card!<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiobp3LzS6D6iANEpHIvojKsbEzxd5t-DPTue13Di7-qf2uKuLFLR2cy3ytiChllZQ49k_xgXdhfUlgEtD9gNUbUBiZKBDncch48h_csFjDhC1eDLeQN0Mh4pdDIJAVZqXE0Vic3JqgPcu6/s1600/V2c_f.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="244" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiobp3LzS6D6iANEpHIvojKsbEzxd5t-DPTue13Di7-qf2uKuLFLR2cy3ytiChllZQ49k_xgXdhfUlgEtD9gNUbUBiZKBDncch48h_csFjDhC1eDLeQN0Mh4pdDIJAVZqXE0Vic3JqgPcu6/s320/V2c_f.jpg" width="320" /></a></div>
When I first connected up my Dreamcast to boot NetBSD I used a generic RCA video to VGA convertor. It cames with its own little power adaptor and the sort of multi-button UI designed by monitor engineers from the late 90's who had clearly been through a messy divorce and wanted to share those feelings with the rest of the world.<br />
<br />
The display was faithful to what you would see on a normal video monitor - so moderately awful - and faithfully reproduced the "we'll just hide the top or bottom two lines of your console to make typing a more challenging experience" effect. Starting X was particularly visually interesting, with the root weave pattern providing a crawling sensation on the insides of your eyeballs.<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-X5Gq3YxZilg/UACgIMrUe8I/AAAAAAAANAM/8i406I9pgmk/s1600/vga-sd.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="240" src="http://3.bp.blogspot.com/-X5Gq3YxZilg/UACgIMrUe8I/AAAAAAAANAM/8i406I9pgmk/s320/vga-sd.jpg" width="320" /></a></div>
When I found out that Dreamcast SD card adaptors were easily available I immediately set out to buy one, but was then tempted by a combined VGA+SD, with its promise of crisper display, and the sensual delight of potentially being able to characters on screen as you typed them.<br />
<br />
It arrived today, and was hooked up to the DC when I arrived in the office. Build quality was... adequate for something that had been assembled from parts left lying around in a workshop. In particular the two plugs appear to have been designed by someone who once spoke to someone who had the original plug described to them over a phone... in a foreign language. They fit, but much in the same way as breaking out all of the pins in a serial cable, then individually poking them into the serial port would fit. For a moment I seriously considered turning the Dreamcast onto its front edge to gain the assistance of gravity with keeping the plugs in, but in the end resolved just not to sneeze or walk heavily near it.<br />
<br />
As for the display... the good news is that all of the lines from the console are visible on screen, the bad news is you need to take quite a relaxed view of the word "visible" . Think "ancient TV with something significant dying inside", with a side order of "who turned the brightness all the way down and broke off the knob".<br />
<br />
Its a little disappointing to say the least. I will have another play on Monday then quite possibly email some pictures accompanied by a light sprinkling of sarcasm to the vendor...abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com2tag:blogger.com,1999:blog-8527603153727315280.post-16788130190825239992012-07-12T17:19:00.000-07:002012-07-12T17:19:27.055-07:00NetBSD/dreamcast from NetBSD in 4 minutes?<div class="separator" style="clear: both; text-align: center;">
<a href="http://netbsd.org/images/NetBSD.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="245" src="http://netbsd.org/images/NetBSD.png" width="320" /></a></div>
So last night I located an easy way to burn a NetBSD/dreamcast bootable CD from a Windows box, along the way discovering it was *almost* possible to use that mechanism to have the iso9660 filesystem used as the root fs.<br />
<br />
It annoyed me that it was now quicker to burn a NetBSD/dreamcast CD on a Windows box than a *ix box, so tonight I decided to address that.<br />
<br />
A fair number of years ago Marcus Comstedt write a number of very handy Dreamcast development tools, including a couple of utilities to generate a Dreamcast bootloader and then process a binary suitable for use with that bootloader ('makeip' and 'scramble' from <a href="http://mc.pp.se/dc/sw.html">http://mc.pp.se/dc/sw.html</a>)<br />
<br />
All I needed to do was wrap them in a little shell script, throw in a call to mkisofs to create an iso9660 CD filesystem and cdrecord to write and and I was done.<br />
<br />
Then the creatures started feeping.<br />
<ul>
<li>Obviously it would be convenient if the script could download the necessary kernel files from ftp.netbsd.org automatically, but you should also be able to point it at a locally built kernel</li>
<li>If downloading the version should be selectable</li>
<li>Selection of a plain GENERIC or GENERIC plus ramdisk be possible</li>
<li>As a final bonus it should be able to download a complete NetBSD distribution, extract and burn it onto the CD as the root filesystem</li>
</ul>
The end result was <a href="https://github.com/abs0/dc-burn-netbsd" target="_blank">dc-burn-netbsd</a> on github, and a sysutils/dc-tools <a href="http://www.pkgsrc.org/" target="_blank">pkgsrc</a> entry which included dc-burn-netbsd, makeip, scramble, and a couple more dc tools.<br />
<br />
... and finally the feeping stopped.<br />
<br />
I can now say I've run a Dreamcast with an iso9660 (rockridge) root filesystem. Its not exactly fast, and you would really want to union mount some ramdisks over /var and suchlike to even consider trying to take it multiuser, but it works :)<br />
<br />
<br />
<span style="font-family: "Courier New", "Courier", monospace;">% dc-burn-netbsd -h<br />Usage: dc-burn-netbsd [opts]<br /> -C : Clean work directory before starting<br /> -c opts : Set cdrecord opts (driveropts=burnfree gracetime=3)<br /> -d : Take kernel/ & sets/ under datadir - no downloading<br /> -h : This help<br /> -k type : Set kernel type (GENERIC_MD) eg: GENERIC or GENERIC_MD<br /> -n : Generate data but do not write (just display cdrecord commands)<br /> -r : Include full NetBSD release on CD<br /> -t tmpd : Set temporary work directory to tmpd<br /> -v vers : Set NetBSD version (6.0_BETA2) eg: 5.1 6.0_BETA2<br /><br />dc-burn will create a temporary work directory dc-burn-netbsd-files which will<br />need to have sufficient space to store the downloaded & generated files.<br /><br />if -d is used the directory is expected to match the layout on ftp.netbsd.org:<br /> - kernel/netbsd-$type.bin.gz, and<br /> - sets/base.tgz (etc - if -r given)</span><br />
<br />
<br />abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com2tag:blogger.com,1999:blog-8527603153727315280.post-40493705059260959592012-07-11T16:32:00.001-07:002012-07-11T16:32:31.102-07:00NetBSD/dreamcast from Windows in 5 minutes<div style="text-align: right;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJCKarbDs-BAVazd7jVap0gT_YFB_HnEnDThDebqY3jjo452qa4udznMGrAo-ZI3yjKBf3JTKdqZwxbw3Vf7lBSHb14g-CjugOTPpKDBWq9yU8B-F09TsUSw-69Pzl830GyjpRSpFLx2K9/s1600/6899251013_1a48cedcfa_b.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img alt="Thanks to http://www.flickr.com/photos/russellede/ for this image" border="0" height="159" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJCKarbDs-BAVazd7jVap0gT_YFB_HnEnDThDebqY3jjo452qa4udznMGrAo-ZI3yjKBf3JTKdqZwxbw3Vf7lBSHb14g-CjugOTPpKDBWq9yU8B-F09TsUSw-69Pzl830GyjpRSpFLx2K9/s200/6899251013_1a48cedcfa_b.jpg" title="" width="200" /></a></div>
Retrochallenge segue: How to burn a Dreamcast boot CD from Windows?<br />
<br />
Someone was asking on the NetBSD/dreamcast list about burning a bootable CD from a Windows machine. Its already easy to burn a CD using a NetBSD <a href="http://ftp.netbsd.org/pub/NetBSD/arch/dreamcast/dcburn/README" target="_blank">'cdburn'</a> live image, but obviously in this case they prefer to burn from an existing Windows machine.<br />
<br />
It certainly is possible - and turned out to be quite easy:<br />
<ul>
<li>Download <a href="http://code.google.com/p/bootdreams/downloads" target="_blank">BootDreams</a></li>
<li>Create a new directory </li>
<li>Download a NetBSD/dreamcast .bin kernel (*), uncompress, and rename to netbsd.bin (to ensure it is no longer than 12 characters + .bin), and put into above directory</li>
<li>Run BootDreams</li>
<li>Insert blank CD-R (Not CD-RW)</li>
<li>Select "CDRecord" (4th icon)</li>
<li>Click "Browse" and select the above directory </li>
<li>Click "Process" and answer "Yes" to any questions</li>
</ul>
<br />
(*) NetBSD/dreamcast kernels are available in two forms, as netbsd-GENERIC.bin.gz which is just the kernel and netbsd-GENERIC_MD.bin.gz which includes a ramdisk with basic shell tools. Remember to gunzip the file to get the .bin. (a tool like 7zip should handle that).<br />
<br />
A GENERIC_MD kernel will boot up directly to a shell, while a GENERIC kernel will prompt for the root filesystem - which will be rtk0 if you have a BBA and NFS serving machine, and gdrom0a for root-on-cd.<br />
<br />
The latest released kernel is in<br />
<ul>
<li><a href="http://ftp.netbsd.org/pub/NetBSD/NetBSD-5.1.2/dreamcast/binary/kernel/">http://ftp.netbsd.org/pub/NetBSD/NetBSD-5.1.2/dreamcast/binary/kernel/</a></li>
</ul>
The BETA2 test kernel for the upcoming NetBSD-6 release is in:<br />
<ul>
<li><a href="http://ftp.netbsd.org/pub/NetBSD/NetBSD-6.0_BETA2/dreamcast/binary/kernel/">http://ftp.netbsd.org/pub/NetBSD/NetBSD-6.0_BETA2/dreamcast/binary/kernel/</a></li>
</ul>
There are also nightly builds of -current and the various netbsd- branches at<br />
<ul>
<li><a href="http://nyftp.netbsd.org/pub/NetBSD-daily/">http://nyftp.netbsd.org/pub/NetBSD-daily/</a></li>
</ul>
<br />
As a bonus any files in the same directory as the kernel are accessible to the booted NetBSD image, offering some interesting possibilities of "root on CD". Extracting base.tgz into *almost* works - it just fails when init tries to run /dev/MAKEDEV as due to the case-insensitivity of Windows it is now /dev/makedev, plus any symlinks have been mangled.<br />
<br />
I would hope a RockRidge format CD written on NetBSD would Just Work... Something to try tomorrow!<br />abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com0tag:blogger.com,1999:blog-8527603153727315280.post-76746636241539558042012-07-10T16:19:00.000-07:002012-07-10T16:19:10.716-07:00eMSCPation proclamation<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9R2tOLfP7S0eRZIDStjjKWv20JhVZPSd4zDNMd_o43AfOgkJefNBe3AUxLGJDPUP0XlvXXEp-uUX67aYKA5BGH4NqZ2cYQ_va4yYU7op76dxfclAuZQaRTvKBhyphenhyphenXNifvZdphjzi-acAb5/s1600/mscp.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="227" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9R2tOLfP7S0eRZIDStjjKWv20JhVZPSd4zDNMd_o43AfOgkJefNBe3AUxLGJDPUP0XlvXXEp-uUX67aYKA5BGH4NqZ2cYQ_va4yYU7op76dxfclAuZQaRTvKBhyphenhyphenXNifvZdphjzi-acAb5/s320/mscp.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Diagram from MSCP patent</td></tr>
</tbody></table>
Tonight's Retrochallenge 2012 diversion features some MSCP code I wrote a couple of weeks ago, but have only just committed to the NetBSD source tree.<br />
<br />
MSCP, or <b>Mass Storage Control Protocol </b>was designed by Digital Equipment Corporation to provide high level but low overhead communication with storage devices.<br />
<br />
It was used extensively on PDP-11 and early VAX, and even some DEC MIPS system. Later systems tended to drift across to the then available SCSI.<br />
<br />
At some point before the netbsd-6 branch the MSCP driver started behaving oddly (cleanups related to kernel threads). Under the quite excellent <a href="http://simh.trailing-edge.com/vax.html" target="_blank">simh-vax</a> emulator it would report (and ignore) an additional phantom device on the bus, but on at least some real hardware it would end up in a decidedly unhappy state, with the machine unable to access any devices.<br />
<br />
Not actually having any real MSCP hardware made this a little harder to debug, but thanks to the delightfully interconnected world in which we live someone was willing to test build kernels based on diffs from me to track down the issue and confirm the fix.<br />
<br />
The issue turned out to be an interesting interaction between the mscp_attach() routine, which iterated through the units on the bus, sending an M_OP_GETUNITST+M_GUM_NEXTUNIT message to each, and mscp_dorsp() which processed interrupts (and returned messages) from the devices. When probing for devices M_GUM_NEXTUNIT provides a very handy ability to find the next active unit - so if you have unit ids 0 and 8 you can probe for 0 with M_GUM_NEXTUNIT and get 0 back, then probe for 1 with M_GUM_NEXTUNIT and get 8 back, <i><span class="st">without all that <em>tedious</em> mucking about in <em>hyperspace, - </em></span></i><span class="st"><em></em></span>ahem, or rather without having to probe the intermediate unit ids. Once you try probing past the last unit, it loops around. The mishandling of this final probe was what gave the phantom device and much unhappiness.<br />
<br />
So, some simple changes, a tweak to better handle non-contiguous unit ids, and an opportunity to replace a couple of gotos with a for(;;) loop, and NetBSD/vax is happy again.<br />
<br />
The next phase is to clean up the MSCP code further to permit attaching new devices while the system is running. Ragge (the vax portmaster) is going to play with that one, but it seemed best to get my changes in the tree so NetBSD-6.0 will be guaranteed to have working MSCP code :)<br />
<br />
In other news since it was updated to NetBSD 6-BETA2 the Dreamcast has finished building bash & zsh and has *nearly* finished building simh. Why would I want to build a vax emulator on a Dreamcast which uses a VAX as an NFS server? Surely there could not be some strange and twisted plan afoot? We shall just have to see...<br />
<br />abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com2tag:blogger.com,1999:blog-8527603153727315280.post-82560580726700338832012-07-09T15:05:00.002-07:002012-07-09T15:05:21.250-07:00Whats new Dream Cat? (wooah-wooah)<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzXfj6Ufl4SXU5n5S0Y4YK9NoJ0mIX29Pluk2mm2DBjtSVf_83JD-62TzCAviXGL5VpmZZ8f8DMF6OUuO0KJvj_3rugEX6-4fyM4SJCSsQPugNS-EMwOAaj5oTrdldoXhqKuqQUqqQiBxO/s1600/dc_shells_cs.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="262" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzXfj6Ufl4SXU5n5S0Y4YK9NoJ0mIX29Pluk2mm2DBjtSVf_83JD-62TzCAviXGL5VpmZZ8f8DMF6OUuO0KJvj_3rugEX6-4fyM4SJCSsQPugNS-EMwOAaj5oTrdldoXhqKuqQUqqQiBxO/s320/dc_shells_cs.jpg" width="320" /></a></div>
Arrived into the office this morning, rebooted the Dreamcast and started it building zsh and bash (bash is still compiling as I type). Rather than actually accomplish anything Retrochallenge related today I spent a little time browsing the InterTubes and wondering if there was anything obvious NetBSD could do better to take advantage of the Dreamcast.<br />
<br />
Found a very interesting Russian site discussing Dreamshell - a<br />
homebrew OS for the Dreamcast.<br />
<br />
They have some very nice hardware pages, including schematics for:<br />
<br />
<br />
<ul>
<li><a href="http://translate.google.com/translate?sl=ru&tl=en&u=http%3A%2F%2Fwww.dc-swat.ru%2Fblog%2Fhardware%2F14.html" target="_blank">Dreamcast Serial to SD card adaptor - easily available online</a></li>
<li><a href="http://translate.google.com/translate?sl=ru&tl=en&u=http%3A%2F%2Fwww.dc-swat.ru%2Fblog%2Fhardware%2F15.html" target="_blank">Dreamcast Serial to Ethernet adaptor - under testing</a></li>
</ul>
Obviously the SD serial adaptor is going to be slower than directly<br />
attached hardware, but people are reporting 650KBytes/sec write speed<br />
(out of a theoretical 1.5Mbytes/sec, which isn't bad for a $20 shipped<br />to your door adaptor). Oh, and have ordered one :)<br />
<br />
Also, while the Dreamcast is typically quoted as having 16MB of RAM, it also has 2MB of "audio RAM" (attached to the ARM sound controller), and another 8MB of video RAM. If you're running a 3D game on the Dreamcast this division of memory may make a lot of sense, but when running a general purpose OS much of that 10MB could be put to better use. Even if its too slow (or simply unavailable) to run programs in directly (more research needed), it should at least be possible to make it available for swap space or even a ram disk.<br />
<br />
So, I think there is real scope for some NetBSD/dreamcast related kernel hacking during the rest of RetroChallenge 2012. It will make a change from just plugging together existing stuff in <a href="http://netbsd0.blogspot.co.uk/2012/07/retrochallenge-mission-accomplished.html" target="_blank">unusual ways</a>, or writing <a href="http://netbsd0.blogspot.co.uk/2012/07/wargames-for-masses.html" target="_blank">vintage fantasy computer simulators</a>.abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com0tag:blogger.com,1999:blog-8527603153727315280.post-52344405577525351062012-07-08T16:05:00.000-07:002012-07-08T16:05:23.548-07:00Dreamcast virtual display - 50% off!<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYGARXFfZQF1F_-Nf8l8eEdFSj_MSY3KrCUJb0JgXDnekbH1AqdQsLOvjrAROSHUHZbob6gKftWIQaDaYY4-kSZfpijEufakR-vKA3azx5-OApelRqfiltcbxYxezBXUTKLJsmo894G9q5/s1600/gxemul-240.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="243" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYGARXFfZQF1F_-Nf8l8eEdFSj_MSY3KrCUJb0JgXDnekbH1AqdQsLOvjrAROSHUHZbob6gKftWIQaDaYY4-kSZfpijEufakR-vKA3azx5-OApelRqfiltcbxYxezBXUTKLJsmo894G9q5/s320/gxemul-240.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">gxemul -XEdreamcast booting NetBSD-3.1.1</td></tr>
</tbody></table>
Not having a great deal of time to spare this evening for Retrochallenge 2012, and having neither the Dreamcast or the VAX to hand, I decided to have a quick run of the gxemul Dreamcast emulator to see how easy it was to use as a test environment. <br />
<br />
It turned out to be amazingly easy to run - just install gxemul, download a <a href="http://ftp.netbsd.org/pub/NetBSD/NetBSD-6.0_BETA2/dreamcast/binary/kernel/netbsd-GENERIC_MD.gz">NetBSD kernel</a> and run gxemul -XEdreamcast kernel.gz.<br />
<br />
Interesting display though - the entire bottom part of the display appears to be blank for NetBSD-{6,5,4} and intermittently for NetBSD-3.1.1.<br />
<br />
The fact that booting a NetBSD 3.1.1 kernel *sometimes* displays correctly is quite curious - fortunately gxemul outputs various debug output:<br />
<br />
Bad boot:<br />
<div style="font-family: "Courier New",Courier,monospace;">
[ pvr: DIWMODE set to: clock_double=0, ...<br />[ pvr: SYNCCONF set to: video_enabled=1, NTSC, interlaced=1, ...</div>
<div style="font-family: "Courier New",Courier,monospace;">
... </div>
<div style="font-family: "Courier New",Courier,monospace;">
[ pvr_geometry_updated: 640 x 240, RGB565 (16-bit) ]</div>
<br />
Good boot:<br />
<div style="font-family: "Courier New",Courier,monospace;">
[ pvr: DIWMODE set to: clock_double=1, ...</div>
<div style="font-family: "Courier New",Courier,monospace;">
[ pvr: SYNCCONF set to: video_enabled=1, VGA, interlaced = 0, ...</div>
<div style="font-family: "Courier New",Courier,monospace;">
... </div>
<div style="font-family: "Courier New",Courier,monospace;">
[ pvr_geometry_updated: 640 x 480, RGB565 (16-bit) ]</div>
<br />
So... a happy boot thinks its setting up a VGA output and an unhappy one has picked the American "Never Twice Same Colour" TV standard. Could be an uninitialised (virtual) register?<br />
<br />
Completely irrelevant to what I was intending to look at, but I definitely think I'll be having a poke around with this further, just not tonight :)<br />
<br />
<br />abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com0tag:blogger.com,1999:blog-8527603153727315280.post-2702302020386221502012-07-07T16:23:00.001-07:002012-07-13T01:14:24.966-07:00Wargames for the masses<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqwSUz7_Y1bD7n2BMovIYdyzjtvnEGrFJWX4Ncc910OHRrOnqlIaoJCEBW670DOC2GrRrJ2d96G5fMJT0fWQNCI2Gum3K2WNFaA2lX4HAqKBQuscZLfOMIxyNfiy3rI6o6iJmWTbxyQeI5/s1600/wargames-05.jpg" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="177" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqwSUz7_Y1bD7n2BMovIYdyzjtvnEGrFJWX4Ncc910OHRrOnqlIaoJCEBW670DOC2GrRrJ2d96G5fMJT0fWQNCI2Gum3K2WNFaA2lX4HAqKBQuscZLfOMIxyNfiy3rI6o6iJmWTbxyQeI5/s320/wargames-05.jpg" width="320" /></a>Yesterday for Retrochallenge 2012 I wrote a little shell script to simulate the interaction with the WOPR computer in wargames. (<a href="http://wopr.absd.org/" target="_blank">Connect link</a>)<br />
<br />
It was quite incomplete, and bodged into the telnet port on the VAXstation, so tonight I polished it a little, and then a little more, adjusted the output timings, made it very generous when accepting input (so you could type "fine", rather than "I'm fine. How are you"), and finally made it go back and rewrite what the user typed in such cases to match the film.<br />
<br />
Finally I got over-enthusiastic and put it up on <a href="https://github.com/abs0/wargames" target="_blank">github</a> and added an entry to pkgsrc.<br />
<br />
Notice, at no point in this process did I ask myself "why?".<br />
<br />
Along the way I found out how easy it was to setup telnetd to automatically run a program instead of asking for login, and found a java telnet app to add to <a href="http://wopr.absd.org/" target="_blank">wopr's home page</a> to make it easier for random web users to connect to the script. I also tweaked the font colour and style to better match that in the film.<br />
<br />
Its this attention to pointless detail that is probably quite worrying.<br />
<br />
Its like building a perfect matchstick model of a chair with a broken leg, who's only purpose is to be put on a bonfire.<br />
<br />
Learning how to setup telnetd to autorun a program instead of login would be potentially useful... if it was 1992 and anyone still had any use for telnet.<br />
(for reference just set the telnetd arguments in inetd.conf to "-g foo -a off -h" and in gettytab copy default to foo and replace the im= with lo=/path/to/app).<br />
<br />
Still, after dropping into an email thread on the simh list I've submitted a request to pullup a commit from Matt Thomas' so simh will be able to detect when a NetBSD-6 vax guest is idle and save CPU cycles. <br />
<br />
So... looked at it from the right perspective, that will reduce energy use and carbon emissions, so in a tiny way I just may have done something today which will help save the planet! ... or mabye not. <br />
<br />
<br />
<style>
a.nav { margin-top: 20px; font-size: 13px; color: blue; }
a.prev { float: left}
a.next { float: right}
</style>
<a class="nav prev" href="http://netbsd0.blogspot.co.uk/2012/07/only-winning-move-is.html"><< The only winning move is...</a>
<a class="nav prev" href="http://netbsd0.blogspot.co.uk/2012/07/dreamcast-virtual-display-50-off.html">Dreamcast virtual display - 50% off! >></a>abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com0tag:blogger.com,1999:blog-8527603153727315280.post-87773362799926089212012-07-06T16:47:00.000-07:002012-07-07T16:35:08.472-07:00The only winning move is...<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwNu6h8SMfYUD0eAThdR1XD7QHL0Ew0-oJivxQM3OCgq5sT48an0cwc5UTEZMOxOlDlaHenNPgg5ORR7acD5n1G_c7xJCrs1okTQC7_9EtH1OXkhJXQFCEZH-1kBxgerWtn7FCll6J7hkw/s1600/WOPR.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="177" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwNu6h8SMfYUD0eAThdR1XD7QHL0Ew0-oJivxQM3OCgq5sT48an0cwc5UTEZMOxOlDlaHenNPgg5ORR7acD5n1G_c7xJCrs1okTQC7_9EtH1OXkhJXQFCEZH-1kBxgerWtn7FCll6J7hkw/s320/WOPR.png" width="320" /></a></div>
Taking a break from a playing directly with retro-hardware, last night I watched wargames and took a few notes on the interaction with the WOPR computer.<br />
<br />
The result, lovingly crafted into a simple shell script was connected up to the telnet port in inetd whereupon three issues immediately sprung up<br />
<ol>
<li>Since there is no local telnetd, the script gets to see the initial IAC command codes (called for a little sed hackery)</li>
<li>Calling 'system("sleep 0.1") from awk on an amd64 box sleeps for about 1/10 of a second. On a VAX... its more like 1/5 a second with overhead. Cue writing a small C program to handle outputting the text</li>
<li>I'm pretty sure TCP Nagle is kicking in and making the output blocky, but its late & I'll come back to that</li>
</ol>
Anyway - the result should be visible by "<b>telnet wopr.absd.org</b>" (If your client tries SRA login you may need "<b>telnet -K wopr.absd.org</b>"). It turns out there was quite a lot of interaction with WOPR in the film. I suspect I have about 60-75% of it complete (mainly towards the start), and I've tried to be relatively generous in what it accepts (checking for a matching key word rather than an entire sentence).<br />
<br />
So, how much do you remember from Lightman's typed conversations with WOPR? telnet to wopr.absd.org and test your memory :)<br />
<br />
(In other news I upgraded the Dreamcast to NetBSD-6, which went fine apart from the fact I'd forgotten the kernel had been set to prompt for a root device, which meant my decision to run a final reboot *after* leaving the office was... unhelpful)<br />
<br />
<style>
a.nav { margin-top: 20px; font-size: 13px; color: blue; }
a.prev { float: left}
a.next { float: right}
</style>
<a class="nav prev" href="http://netbsd0.blogspot.co.uk/2012/07/retrochallenge-mission-accomplished.html"><< Retrochallenge mission accomplished. Need new mission! </a>
<a class="nav next" href="http://netbsd0.blogspot.co.uk/2012/07/wargames-for-masses.html">Wargames for the masses >></a>abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com0tag:blogger.com,1999:blog-8527603153727315280.post-7691743280089113432012-07-05T14:33:00.002-07:002012-07-07T16:32:30.568-07:00Retrochallenge mission accomplished. Need new mission!<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-yelHEXwE3vs/T_YASt3oesI/AAAAAAAAM5w/l9P8z6E-C5Q/s1600/checkmark.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://3.bp.blogspot.com/-yelHEXwE3vs/T_YASt3oesI/AAAAAAAAM5w/l9P8z6E-C5Q/s1600/checkmark.jpg" /></a></div>
So this morning's Retrochallenge 2012 activity was reuniting the Dreamcast with the VAX and setting the VAX up to act as a dhcp and NFS server to the DC (copying the config from home).<br />
<br />
Sundry small sysadmin tasks later (adding swap, users, mounting /home from the vax, installing some binary packages and starting a build for the latest PHP (don't ask)), and there was just time to break for the pre-9am coffee.<br />
<br />
So, what do we have:<br />
<ul>
<li><a href="http://wopr.absd.org/" target="_blank">wopr</a> - an 128M VAXstation 4000/90A acting as a NFS server to</li>
<li><a href="http://orac.absd.org/" target="_blank">orac</a> - a 16M SEGA Dreamcast with sh3 CPU</li>
</ul>
Both have user logins and run web servers (wopr with PHP). orac has also run X (640x480 with a composite video to VGA adaptor is not a pretty sight).<br />
<br />
Both have a 'falken' login which runs the standard NetBSD /usr/games/wargames script (the password *is* the obvious one :)<br />
<br />
So, what next for Retrochallenge 2012:<br />
<br />
Some thoughts:<br />
<ul>
<li>The wargames script really could do with being a little more faithful to the movie. Per character delay, more interaction, prompting for Global Thermonuclear War or even a nice game of chess :)</li>
<li>Turning this into the worlds strangest honeypot. I have a sparc classic with two network interfaces which could act as a monitor, but what apps and accounts should be on the target VAX & Dreamcast machines? Samba? some hugely vulnerable web apps?</li>
<li>Running an sh3 emulator on the VAX & a VAX emulator on the Dreamcast?</li>
<li>Adding as many alternate architectures to the cluster as possible. Partial marks only for using VPN connections to alternate locations </li>
</ul>
Or... something else?<br />
<br />
Your suggestions wanted! <br />
<style>
a.nav { margin-top: 20px; font-size: 13px; color: blue; }
a.prev { float: left}
a.next { float: right}
</style>
<a class="nav prev" href="http://netbsd0.blogspot.co.uk/2012/07/dream-little-cast-of-me.html"><< Dream a little cast of me...</a>
<a class="nav next" href="http://netbsd0.blogspot.co.uk/2012/07/only-winning-move-is.html">THE ONLY WINNING MOVE IS... >></a>abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com6tag:blogger.com,1999:blog-8527603153727315280.post-24712610032328873112012-07-04T16:49:00.003-07:002012-07-06T04:17:39.030-07:00Dream a little cast of me...A little time poking at NetBSD on the Dreamcast at the end of this evening.<br />
<br />
Things I have learned.<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjClxmhteK9i0zbYRZeIIUhYCF28QOV4Cc06f-qE8Z87j7kAKW2kf1Wr7QQl_7WW4Mv5hOuF-ZR3ZtNmziwpuDo4flliKIsmOqEv3u0ow3gWZXgsFr82kJ6L-zaD2y8O2UHnQfHAndQrbb4/s1600/IMG_20120705_003858.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a> <br />
<ul>
<li>If your Dreamcast clock battery has failed, there is no way to get
past the poweron "set date & time" screen without a controller.
Having a bootable CD, ethernet BBA and full keyboard is no help. Strictly speaking I learned this yesterday when I brought everything *except* a controller home. The Dreamcast and I did not end that night on speaking terms</li>
<li>The console display is 80x30 - the top two lines of which are invisible on the UK Dreamcast (with two blank lines at the base), the bottom two invisible on the Japanese Dreamcast (with no space at the top). Isn't choice wonderful?</li>
<li>The Dreamcast Japanese keyboard is tiny, cute, and full of many
bonus glyphs you find when hoping for an underscore. Particularly good
to know when you're typing "mount_cd9660" on a Japanese Dreamcast with
the bottom two invisible lines</li>
<li>Dismembering the Dreamcasts to swap power supply boards gets old very quickly</li>
<li>The sonic characteristics of the fans in the two Dreamcasts are quite different, but both of them rapidly achieve Michael-Bolton-with-fingernails-on-blackboard-backing-sounds levels of annoyance</li>
<li>Audioplay *mostly* works, at least for the first four seconds of
any wav file, and then for some indeterminate sections of the rest.
Perfect for playing songs to those with exceptionally short attention
span</li>
<li>The gdrom0 device will not recognise disklabels, but will mount standard iso9660 CDs (including the special boot CD), so there may be scope for an easy root-on-CD image</li>
<li>Yes, that is a picture of a less than happy cow (thankyou John) </li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjClxmhteK9i0zbYRZeIIUhYCF28QOV4Cc06f-qE8Z87j7kAKW2kf1Wr7QQl_7WW4Mv5hOuF-ZR3ZtNmziwpuDo4flliKIsmOqEv3u0ow3gWZXgsFr82kJ6L-zaD2y8O2UHnQfHAndQrbb4/s1600/IMG_20120705_003858.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjClxmhteK9i0zbYRZeIIUhYCF28QOV4Cc06f-qE8Z87j7kAKW2kf1Wr7QQl_7WW4Mv5hOuF-ZR3ZtNmziwpuDo4flliKIsmOqEv3u0ow3gWZXgsFr82kJ6L-zaD2y8O2UHnQfHAndQrbb4/s400/IMG_20120705_003858.jpg" width="400" /></a></div>
<style>
a.nav { margin-top: 20px; font-size: 13px; color: blue; }
a.prev { float: left}
a.next { float: right}
</style>
<a class="nav prev" href="http://netbsd0.blogspot.co.uk/2012/07/ill-give-you-my-dmesg-when-you-take-it.html"><< I'll give you my dmesg...</a>
<a class="nav next" href="http://netbsd0.blogspot.co.uk/2012/07/retrochallenge-mission-accomplished.html">Mission accomplished. Need new mission! >></a>abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com0tag:blogger.com,1999:blog-8527603153727315280.post-57209393841285445112012-07-03T15:51:00.001-07:002012-07-06T04:13:26.601-07:00I'll give you my dmesg when you take it from my cold, dead hands<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDFhhS4iMMjRBXMyy0DgMV3X3_OgRmDTTePI-8mYfVKhD-hSVOd-iAA0H87X2LI4ovxHf-O6UTjiJVJU7LWeEOdKw2LC6qq8XMdyCC9aRdUVdmOcHr5ikbc_cyJc1zvJKWaNJSDOsJraxo/s1600/dmesg.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="286" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDFhhS4iMMjRBXMyy0DgMV3X3_OgRmDTTePI-8mYfVKhD-hSVOd-iAA0H87X2LI4ovxHf-O6UTjiJVJU7LWeEOdKw2LC6qq8XMdyCC9aRdUVdmOcHr5ikbc_cyJc1zvJKWaNJSDOsJraxo/s320/dmesg.png" width="320" /></a>Tonight's (rather quick) NetBSD/vax retrochallenge change was to disable kernfs from the install kernel & include dmesg in the crunchgen binary.<br />
<br />
The installer images for most NetBSD ports already do this, and there is something quite offputting in any *BSD system, no matter how cut down in seeing "dmesg: not found"<br />
<br />
Net effect is a slightly smaller image, and of course the ability to drop to a shell at any point and type dmesg... just like $deity intended.<br />
<br />
As an added bonus I took the opportunity to add dhcpcd to the vax installer image, because frankly life is too short to be manually entering IP addresses...<br />
<br />
The more eagle eyed among you will notice the dmesg image above is both a xterm screengrab, and obviously from a simh-vax emulator. This is because tonight I am far from my vax, and the edit-build-test cycle is a lot more convenient run locally on my Thinkpad.<br />
<br />
Fear not, these changes will be run on real iron too...
<style>
a.nav { margin-top: 20px; font-size: 13px; color: blue; }
a.prev { float: left}
a.next { float: right}
</style>
<a class="nav prev" href="http://netbsd0.blogspot.co.uk/2012/07/netbsdvax-moves-to-maxpartitions-16.html"><< NetBSD/vax moves to MAXPARTITIONS 16</a>
<a class="nav next" href="http://netbsd0.blogspot.co.uk/2012/07/dream-little-cast-of-me.html">Dream a little cast of me... >></a>abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com0tag:blogger.com,1999:blog-8527603153727315280.post-75795479969325472382012-07-02T16:03:00.001-07:002012-07-06T04:16:02.910-07:00NetBSD/vax moves to MAXPARTITIONS 16<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="http://archive.computerhistory.org/resources/physical-object/digital_equipment_corporation_dec/102673393.lg.jpg?rand=591312921" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="187" src="http://archive.computerhistory.org/resources/physical-object/digital_equipment_corporation_dec/102673393.lg.jpg?rand=591312921" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: xx-small;">Image courtesy of Computer History Museum</span></td></tr>
</tbody></table>
This is <a href="http://retrochallenge.org/" target="_blank">RetroChallenge 2012</a> month, and as my Dreamcast and VAXstation are still many miles apart I decided to finish off switching NetBSD/vax from 8 to 16 partitions per disk.<br />
<br />
Turned out to be quite simple to do - once I remembered to check that the boot blocks would need to be adjusted to handle the larger disklabel.<br />
<br />
Of course given the average disk size in use on a VAX is likely to be on the order of dozens to hundreds of MB there may not necessarily be as many obvious uses for more partitions, but to quote a *nix saying "Here is rope. Do stuff".<br />
<br />
Copy of the message sent to port-vax to inform users of the change: <br />
<div style="color: purple;">
<i><br /></i></div>
<div style="color: purple;">
<i>For all you staring at that RD52 and wondering how to make full use of<br />
its capacity with only seven partitions, your solution is here!<br />
No more will you have to nest devices to allow you to create 15<br />
separate 2MB partitions, now NetBSD/vax has been extended from 8<br />
partitions per device to 16! (*)<br /><br />
(*) Also works for devices greater than 31MB!</i>
<i><br /><br />
After updating current all existing /dev nodes should be unaffected,</i>
<i><br />
just run MAKEDEV to gain access to the additional partitions.<br /><br />
Commit message:</i>
<i><br />
- Increase MAXPARTITIONS for vax from 8 to 16, using the standard NetBSD<br />
mechanism to ensure all existing /dev nodes continue to work<br />
- Adjust boot block layout to fit additional partitions<br />
- Adjust number of inodes on install media</i>
</div>
<style>
a.nav { margin-top: 20px; font-size: 13px; color: blue; }
a.prev { float: left}
a.next { float: right}
</style>
<a class="nav prev" href="http://netbsd0.blogspot.co.uk/2012/07/retrochallenge-2012-public-access.html"><< Retrochallenge 2012 - public access Dreamcast?</a>
<a class="nav next" href="http://netbsd0.blogspot.co.uk/2012/07/ill-give-you-my-dmesg-when-you-take-it.html">I'll give you my dmesg... >></a>abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com1tag:blogger.com,1999:blog-8527603153727315280.post-11067394142983143002012-07-01T16:10:00.000-07:002012-07-09T07:05:46.713-07:00Retrochallenge 2012 - public access Dreamcast?<div>
So, just noticed <a href="http://retrochallenge.org/" target="_blank">RetroChallenge 2012</a>, which has various rules including:<br />
<ul>
<li>[...] computer systems must by approximately 10 years
old (or older!) [...]</li>
<li>Gaming consoles and PDAs qualify if they were made in the previous century</li>
</ul>
Well, the opportunity to comply with both of the above rules in one task is too good to miss, so onwards with my plan to setup a Sega Dreamcast as a public access *nix server, using a DEC VAXstation 4000/90A as a netboot and file server.<br />
<br />
For this plan to success all I needed was:<br />
<ol>
<li>A VAXstation 4000/90A, suitable for running dhcpd & nfs - that would be <a href="http://wopr.absd.org/" target="_blank">wopr</a></li>
<li>SEGA Dreamcast, with BroadBand Adaptor (ethernet) & keyboard</li>
<li>Cables, spare IP, downloaded NetBSD etc</li>
<li>Time and for everything to work</li>
</ol>
The plan suffered an early setback when the Dreamcast I acquired turned out to have a Japanese 110V power board which steadfastly refused to work with any 110V power supply I used.<br />
<br />
Fortunately the Bay-of-e has a ready supply of UK Dreamcasts with functional 240V power boards, quite cheap - particularly if you are willing to include a cosmetic condition of "Appears to have been used regularly as some form of dinner receptacle, also possibly slightly chewed by dog"<br />
<br />
A few moments with a screwdriver and my UK powered Japanese Dreamcast powers up with a NetBSD-5.1 CD in the drive.<br />
<br />
The first thing I notice is its loud. I think louder than the VAXstation (as the VS is around 5.5miles away its difficult to tell for sure, but last time I checked it didn't have a 2cm fan making a valiant attempt to bore its way out through the case).<br />
<br />
The second thing... the bottom two lines of the console are invisible. This provided a sufficiently convincing representation of "bizarrely hung" for my initial joy at the dmesg to pass through a selection of profanity before I worked out what was happening.<br />
<br />
Not having the VAX to hand (that would be some mighty big hand), I
decide to use my trusty HP microserver as a dhcp and nfs server and a
few minutes later... <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0Uk7nHN3ScXn0pba5eBKyWwEzqIuDp88Umvm30fOJh-g0a8pmRVADU2Zgw2oWAH2V7vU7GtPSITeheLm30VxG6xjuFqjpvvOAGs9UvCuhtgFXIzq37vTxUXHgGvgwzU4u8t2XX5r6T67c/s1600/IMG_20120701_235837.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0Uk7nHN3ScXn0pba5eBKyWwEzqIuDp88Umvm30fOJh-g0a8pmRVADU2Zgw2oWAH2V7vU7GtPSITeheLm30VxG6xjuFqjpvvOAGs9UvCuhtgFXIzq37vTxUXHgGvgwzU4u8t2XX5r6T67c/s640/IMG_20120701_235837.jpg" width="480" /></a></div>
<br />
<br />
Hmm, this could be too easy... maybe once the Dreamcast is up I can try building simh on it and set it up to emulate a VAX?<br />
<br />
Incidently, if anyone would like a login to the VAX (now) or the Dreamcast (soon)... let me know :)</div>
<style>
a.nav { margin-top: 20px; font-size: 13px; color: blue; }
a.prev { float: left}
a.next { float: right}
</style>
<a class="nav prev" href="http://netbsd0.blogspot.co.uk/2012/06/retrocomputing-with-vamp-stack-vax.html"><< Retrocomputing with a VAMP stack</a>
<a class="nav next" href="http://netbsd0.blogspot.co.uk/2012/07/netbsdvax-moves-to-maxpartitions-16.html">NetBSD/vax moves to MAXPARTITIONS 16 >></a>abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com3tag:blogger.com,1999:blog-8527603153727315280.post-73463865121579007892012-06-04T14:17:00.000-07:002012-07-09T06:59:05.241-07:00Retrocomputing with a VAMP stack: VAX, Apache, MySQL & PHP<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZIJOFWfZ92M97cw9l5zQDP9J7z03P-bxZLw9OCIKkakQPGFQ_8LQvWxrmXP4q7p3jn5TjCU0GCC7onlhHLm7ck1bGoY2Jv_PwQCdwTBtvGW-XGlcQuUofFn9Pn3a7P6krR4rcgb6DsYnM/s1600/7023239497_663d80b010_k.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="222" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZIJOFWfZ92M97cw9l5zQDP9J7z03P-bxZLw9OCIKkakQPGFQ_8LQvWxrmXP4q7p3jn5TjCU0GCC7onlhHLm7ck1bGoY2Jv_PwQCdwTBtvGW-XGlcQuUofFn9Pn3a7P6krR4rcgb6DsYnM/s320/7023239497_663d80b010_k.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">"wopr". A VAXstation 4000/90A</td></tr>
</tbody></table>
What to do with a VAX workstation, based on an architecture first released by Digital Equipment Corporation in 1977 and finally closed out by Compaq at the end of the last millennium?<br />
<br />
The obvious option would be to dig out an ancient copy of VMS, or maybe an early UNIX tape, but what then? Could it run the latest Apache or screen, and how will I be able to connect it to a native IPv6 network (when we finally get there :) ?<br />
<br />
As an alternative, lets see if a current OS and software can run on a machine with an architecture older than some of the *parents* of modern developers... <br />
<br />
In an ideal world, with a warehouse, a personal power station, and an unlimited time budget I'd find an original <a href="http://en.wikipedia.org/wiki/VAX-11#VAX-11.2F780" target="_blank">VAX 11/780</a>. Working in the real world I compromised with a <a href="http://en.wikipedia.org/wiki/VAXstation#VAXstation_4000_Model_90A" target="_blank">VAXstation 4000/90A</a>, which is around PC sized with PC power consumption (if not performance :)<br />
<br />
"wopr" has a 72Mhz CPU and is packed out with 128MB of 58.5MB/sec memory (no laughing in the back there), complete with colour graphics and an 8GB SCSI drive, and probably would have cost close to <span class="st">£20,000 in 1992.</span><br />
<br />
Now in VAX terms this is a blistering fast machine, with a raw CPU performance of 40 VUPs (40 times the speed of the original 11/780).<br />
<br />
Now you could regard using such a "fast" VAX as cheating, I regard it as choosing to be able to write this blog entry this year, rather than in 2018... <br />
<h4>
</h4>
<h4>
Installing the OS</h4>
<br />
For the OS I chose <a href="http://www.netbsd.org/" target="_blank">NetBSD</a> (for reasons blindingly obvious for anyone who knows me and pretty much irrelevant to the rest of the world).<br />
<br />
At this point you can assume a montage soundtrack in the background and lots of split screen visual effects covering: downloading the latest NetBSD/vax 6-BETA, setting up my laptop to run mopd (DEC proprietary MOP boot protocol), dhcpd (for the boot loader to query for IP address & kernel), tftpd (for the kernel), and nfsd (for the filesystem).<br />
<br />
The montage music fades as we're left with a screen saying<br />
<br />
<blockquote class="tr_bq">
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">NetBSD/vax (wopr) (ttyE0)</span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><br /></span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">login:</span></div>
</blockquote>
<br />
Actually this happened concurrently with a magical side quest involving trying to wire a serial console cable with:<br />
<ol>
<li>An RJ14 cable which needed to be cut to fit into the VAX MMJ console (and then kept falling out)</li>
<li>An RJ25 to DB9 shell (sold as an RJ14 to DB9)... of the wrong gender</li>
<li>A DB25 gender changer </li>
<li>A DB9 to DB25 adaptor</li>
</ol>
... to allow me to try poking the loose pins of the DB9 shell into the DB25.<br />
This was combined with several VAX console guides on the Internet which could not agree on the numbering of the required pins, and a certain amount of profanity.<br />
<br />
Additional entertainment was provided by the GNU compiler (gcc), which in its 4.5.3 incarnation doesn't so much compile for the VAX as throw together sequences of VAX code in the vague hope that by the time they are executed the machine has fallen into a parallel universe where they now make sense.<br />
<br />
NetBSD/vax has now switched back to gcc-4.1.3, which implements a more conventional level of mis-optimisation issues and (very) occasional compiler crashes.<br />
<h4>
</h4>
<h4>
Selecting and installing the software</h4>
<br />
Most things seemed to compile "out of the (<a href="http://www.pkgsrc.org/" target="_blank">pkgsrc</a>) box". I should point out that I'd been chatting to a couple of people interested in running apps on the box, hence the somewhat eclectic selection of packages. At least two of them ran Debian x86 boxes their end, which explains (at least in my mind) the X apps. Some of them actually use it as a persistent IRC client, running weechat or nirc in a screen session.<br />
<br />
The final result (to date) is <a href="http://wopr.absd.org/" target="_blank">http://wopr.absd.org/</a>. Conclusive proof that you can (more or less) run the latest software on retrocomputing systems.<br />
<br />
For anyone still reading, benzodiazepines are available on prescription, and if you're *still* reading, here are some of the issues encountered :)<br />
<ul>
<li>PHP has a php_get_inf() call which returns INF (infinity)... only on VAX there is no infinity (existential concepts aside - VAX floatingpoint maths has no concept of infinity, so the PHP code tried to return 1/0, which on the VAX is a quick route to a floating point exception and a core dump). A quick patch to special case __vax__ and we're good</li>
<li>cmake has an... interesting way to determine whether the current system is big or little endian. Rather than trust the system's include files, which after all are only part of the operating system and could have no idea of the processor type, cmake chooses to have a huge long special cased list of processor defines. So __vax__ fits nicely after other notable obsolete processor such as _s390__ (IBM ESA/390) and __ia64__ (Intel Itanium)</li>
<li>naim has a clever if somewhat cryptic assert() to check that its being used against ncurses rather than ncursesw. Since NetBSD ships with its own curses implementation the assert was tuned to be less aggressive. Amusingly enough this issue was also present on NetBSD/amd64, so in this case playing with retrocomputing hardware has had potentially tangible benefits for people on modern machines - you have been warned!</li>
<li>xneko failed on startup, which turned out to be a bug in the "non kernel implementation of the optional polyd VAX instruction as used in the assembler libm sin() implementation", now fixed. 'nuff said</li>
<li>xkobo aborted with an XFont issue on startup if the remote display was Debian. This was tracked down to selecting a font which was in the standard X11R7 distribution, but not installed as standard on Debian. It now catches missing fonts and falls back to "fixed". This has the potential to benefit any pkgsrc using Debian user worldwide... who try to run xkobo. I'm pretty sure that intersection is a null set, but... no, its a null set </li>
<li>MySQL failed to build because it depended on bash... which depended on bison... which when pkgsrc tried to check for portability issues caused awk to choke on parsing the test scripts. Apparently the strtod() implementation doesn't *quite* grok VAX FP limits, causing a free SIGFPE exception with every overlarge number. Skipping the check allows MySQL to build, but MySQL 5.5.24 seems to fall over on startup after creating the databases. 5.5.25 may fix this, but as it only started to compile 22 hours ago, we're still waiting to see if it does :)</li>
<li>python, irssi via glib2 and a selection of other software depends on libffi, for which there is no VAX implementation. This looks to be non trivial to fix and require a significant amount of VAX compiler-fu.</li>
</ul>
<br />
<h4>
Conclusion</h4>
<br />
So there you have it, retrocomputing with Apache-2.4.2, PHP 5.3.13, Perl 5.14.2, Bash 4.2, and Screen 4.0.3. Its almost civilised...<br />
<br />
My next task is to submit back some of the VAX patches to the various projects (rather than just leaving them in pkgsrc), to see exactly what kind of response I get.<br />
<br />
Tune in next <i>[some arbitrary time interval]</i>, when I hope to get X running on the VAX, try to build Mosaic, and use the VAX as a network server for a SEGA Dreamcast...<br />
<br />
<br />
<style>
a.nav { margin-top: 20px; font-size: 13px; color: blue; }
a.prev { float: left}
a.next { float: right}
</style>
<a class="nav next" href="http://netbsd0.blogspot.co.uk/2012/07/retrochallenge-2012-public-access.html">Retrochallenge 2012 - public access Dreamcast? >></a>abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com2tag:blogger.com,1999:blog-8527603153727315280.post-21334257188161889992012-05-26T15:26:00.004-07:002014-09-24T06:40:22.427-07:00CentOS 5 DOMU under NetBSD/xen in 15 minutesThe NetBSD site has a <a href="http://www.netbsd.org/ports/xen/howto.html" target="_blank">howto</a> page on setting up Xen. It runs to... quite a few pages of detail for differing versions and is rather involved.<br />
<br />
Recently I needed a test CentOS box and decided to put an underutilised NetBSD/amd64 box to use as my first Xen DOM0 host.<br />
<br />
Setup
turned out to be surprising simple, so I decided to jot down some brief
notes on how to quickly turn a NetBSD-6 box into a Xen DOM0 running a
CentOS 5.8 VM. (This covers amd64, but i386 should be almost the same).<br />
<h3>
</h3>
<h3>
Converting an existing NetBSD install to Xen DOM0</h3>
<ul>
<li>Install xenkernel41 and xentools41 from pkgsrc</li>
<li>Extract kern-XEN3_DOM0.tgz into /netbsd.dom0 (leave /netbsd alone)</li>
<li>Add the following to /boot.conf - adjust 512M to the amount to reserve for the DOM0 </li>
</ul>
<blockquote class="tr_bq" style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: small;">menu=Xen <i>512M</i>:load /netbsd.dom0 console=pc;multiboot /usr/pkg/xen41-kernel/xen.gz dom0_mem=<i>512M</i> noreboot</span></blockquote>
<ul>
<li>Add the following to /etc/rc.conf</li>
</ul>
<blockquote class="tr_bq" style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: small;">xenbackendd=YES<br />xend=YES<br />xendomains=YES<br />xenwatchdog=YES</span></blockquote>
<ul>
<li>Create /etc/ifconfig.bridge0 with the following - replace bge0 with a suitable Ethernet interface</li>
</ul>
<blockquote class="tr_bq" style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: small;">create<br />!brconfig $int add <i>bge0</i> up</span></blockquote>
<ul>
<li>Reboot and select the Xen option</li>
<li>Edit /boot.cfg and change the default= entry to the number of the Xen option</li>
</ul>
<br />
To
mis-quote Ken Arnold: "Now that we have a NetBSD DOM0, it would be nice
to do something with it, unless you have the social life of a kumquat
in which case just running the DOM0 may be enough in itself :)"<br />
<br />
Onto setting up the DOMU!<br />
<h3>
</h3>
<h3>
Setting up a CentOS DOMU</h3>
CentOS provide an <a href="http://wiki.centos.org/HowTos/Xen/InstallingCentOSDomU" target="_blank">Installing CentOS DomU</a> page which was quite helpful for these notes<br />
<ul>
<li>The follow assume all files are in /opt/xen/centos. Adjust to taste </li>
<li>Download initrd.img & vmlinuz from http://mirror.centos.org/centos/5.8/os/x86_64/images/xen/</li>
<li>Create a file onto which to install. The below is 16G (16304M)</li>
</ul>
<blockquote class="tr_bq" style="font-family: "Courier New",Courier,monospace;">
dd if=/dev/zero of=centos.img bs=1m count=16384</blockquote>
<ul>
<li>Create a config file 'centos.cfg' for installing</li>
</ul>
<blockquote class="tr_bq">
<pre><span class="anchor" id="line-56"></span>name = "centos"
<span class="anchor" id="line-57"></span>memory = "512"
<span class="anchor" id="line-58"></span>kernel = "/opt/xen/centos/vmlinuz"
<span class="anchor" id="line-54"></span>ramdisk = "/opt/xen/centos/initrd"
<span class="anchor" id="line-55"></span>disk = [ 'file:/opt/xen/centos/centos.img,0xca00,w', ]
<span class="anchor" id="line-59"></span>vif = [ mac=02:00:00:00:00:01, 'bridge=bridge0', ]
<span class="anchor" id="line-60"></span>vcpus = 1
<span class="anchor" id="line-61"></span>on_reboot = 'destroy'
<span class="anchor" id="line-62"></span>on_crash = 'destroy'</pre>
</blockquote>
<ul>
<li>Start the domain to install, and then connect to the console. Remember Ctrl+] to exit the console</li>
</ul>
<blockquote class="tr_bq" style="font-family: "Courier New",Courier,monospace;">
xm create centos<br />
xm console centos</blockquote>
<ul>
<li>Complete the CentOS install, then adjust centos.cfg as vmlinuz & initrd are not needed</li>
</ul>
<blockquote class="tr_bq" style="font-family: "Courier New",Courier,monospace;">
name = "centos"<br />
memory = "512"<br />
bootloader = "/usr/pkg/bin/pygrub"<br />
disk = [ 'file:/opt/xen/centos/centos.img,0xca00,w', ]<br />
vif = [ mac=02:00:00:00:00:01, 'bridge=bridge0', ]<br />
vcpus = 1</blockquote>
<h3>
</h3>
<h3>
Points to note</h3>
<ul>
<li>NetBSD/xen does not yet handle modules. If you need pf or ipf you will need to compile your own DOM0 kernel</li>
<li>Not all X drivers run as well under DOM0, the above was done on a server where X was not required</li>
<li>If
the original NetBSD installation was before 5.0 and has been upgraded
you will need to ensure the boot program must be updated</li>
<li>If anyone hits any issues with any of the above, drop me a message & I'll be happy to try to help :)</li>
</ul>
abshttp://www.blogger.com/profile/09302666603874428873noreply@blogger.com1