Issues with V6 UNIX

From the article Bringing up V6 Unix on the Ersatz-11 PDP-11 Emulator

V6 as distributed is strictly a 20th Century operating system. Literally. You can’t set the date to anytime in the 21st century, for two reasons.
First, the ‘date’ command only take a 2-digit year number. Second, even if you fix that, the ctime() library routine has a bug in it that makes it stop working in the closing months of 1999. (IIRC, it is that the number of 8-hour blocks since the epoch – January 1, 1970 – overflows a 15-bit integer at that point. ‘Vanilla’ V6 C doesn’t have unsigneds.)

I have ‘fixed’ copies of date.c and ctime.c; here and here. You can download them and install them; ctime.o goes in /lib/libc.a:

ar r /lib/libc.a ctime.o
The ‘date’ command has been extended to support 2- and 4-digit year numbers (to be upwardly compatible, the 2-digit ones assume 19xx). It has also been extended (for forgetful people like me 🙂 so that if you type:
date -
it will tell you what order the arguments go in.
The ‘fix’ in ctime() is really kludgy – sorry, I was in a hurry! It will also break in another 15 years or so (when the number of 8-hour periods overflows 16 bits). Someone else can fix that one!

RetroBSD on chipKIT Max32 with Arduino Ethernet shield

I bought myself one of these boards to play with RetroBSD a few months back but with build issues & other distractions in real life I didn’t get very far because the stock MAX32 kernel configuration is for SD card slots wired to the board whereas I was trying to use the SD card slot on an ethernet shield. This resulted in the kernel not being able to detect the SD card, hence no root file system. I’d use prebuilt binaries without trying to build my own but for some reason there is no prebuilt kernel image for the configuration I require. Finally, tonight I managed to get a MAX32-ETH kernel built & flashed onto the board, still unable to build the userland but I was able to get an older prebuilt image from the RetroBSD Autobuild Server which currently has images for build 860 & 778.

Will follow up once I have everything building from scratch.
Building RetroBSD on Mac OS X

2.11 BSD Unix for PIC32, revision 892 build 1:
Compiled 2014-03-29 by xxx@xxx.xxx:
/usr/local/retrobsd/sys/pic32/max32-eth
cpu: 795F512L 80 MHz, bus 80 MHz
oscillator: XT crystal, PLL div 1:2 mult x20
console: tty0 (5,0)
sd0: port SPI2, select pin C14
sd0: type SDHC, size 15339520 kbytes, speed 13 Mbit/sec
phys mem = 128 kbytes
user mem = 96 kbytes
root dev = rd0a (0,1)
root size = 163840 kbytes
swap dev = rd0b (0,2)
swap size = 2048 kbytes
temp0: allocated 47 blocks
/dev/rd0a: 576 files, 8644 used, 154555 free
temp0: released allocation
Starting daemons: update cron

2.11 BSD UNIX (pic32) (console)

login:

Building tcsh on 4.3BSD-Quasijarus

So after build installing 4.3BSD on simh I was left with a somewhat bare environment.
My first need was a better shell than stock csh with history & tab completion. I proceeded to download the latest version of tcsh to attempt a build.
Things fell into place quickly as I realised this was not going to be as straight forward.
At some point in the development path of tcsh, support for the GNU tool chain was added which would allow one to use autotools to build the software.
Bootstrapping the baseline is always a lengthy pain which prepackaged binaries ease. I was reminded of the period I avoided using OpenBSD-CURRENT because I was unaware packages were available so I would resort to painfully long builds as I started to tried to compile firefox on a freshly installed system.
I decided to see how far I can get in building software without the introduction GNU components, not using up to date versions is acceptable just so I can achieve the task. This also falls in line with the philosophy of the 4.3BSD-Quasijarus project.

I struggled to get tcsh 6.18.01 to build so thought I’d try the earliest version I could find on the official mirror to see if that would work any better.
Version 6.00 is the earliest one available on the US FTP site, the README file references 4.2 & 4.3BSD among a whole bunch of other legacy OS’s & no sign of GNU autoconf.
With a bit of experimentation I had tcsh compiled, essentially just needed to undefine functionality that was not present in my stock install (NLS) or available in the version I was running (better POSIX compliance).
There is lots of code which is spaced out so as to disable its functionality requiring the deletion of the spaces to re-enable depending on the intended target.
This approach assumes knowledge of the OS & its capabilities along with the functionality enabled in the version installed as apposed to the autotools approach where the developer is responsible for putting together something which in theory will reduced the requirement from the end user installing the software to running configure & make.
In my opinion it’s an idea which is poorly executed while not actually solving the problem, instead pushing the responsiblity from one end to the other with added complexity.
I discovered through an interview with Larry Wall that he was responsible for the patch utility we commonly use, I was curious to see how it would function on 4.3BSD & to my surprise there was no patch utility in base. There is the diff utility for generating differential patches but no support for unified context just copied context. You can generate scripts for ed which can be used to apply the changes for subsequent users.

To build tcsh on 4.3BSD Qausijarus
Fetch the tcsh-6.00.00.tar.gz from FTP
Uncompress with
gzcompat tcsh-6.00.00.tar.gz | uncompress | tar xf -

Copy tcsh-6.00/config/config.bsdreno to tcsh-6.00/config.h

Apply the following changes in this diff to your source & build by running make

By default, the install process puts files into /usr/local so you’ll need to create /usr/local/bin & /usr/local/man

> echo $version
tcsh 6.00.00 (Cornell) 07/04/91 options 8b,dl,al,dir

Last week I came across a project to develop 4.5BSD, a continuation from where 4.4BSD stopped. Comparing the current state of the modern BSD derivatives, we’ve come a long long way, with effort going in to reduce the need to bring the system to a useable state post install & shipping with sane defaults we are in a much better place. 20 years worth of changes to back port is a serious effort.

a.out

From the paper “First edition Unix: Its creation and restoration

because the PDP-11/20 provided no memory protection against kernel corruption by the running process, it was considered a courtesy for a programmer to yell ‘‘a.out?’’—the name of the Unix assembler’s default output file—before running a new executable for the first time

More Acme & tools of Plan9 from User Space

Mind blown today by the Plan9 tools as I got a chance to practice working in acme more today.
Browsing installed fonts exposed by fontsrv(1) as a file system using 9p(1) (a taste of treating everything as a file), using adict(1) which is a dictionary browser & win(1) which connects a shell with a pane in acme so anything you type into that pane is sent to shell & any output from the shell is sent back to the pane. This allows you to do such things as build notes as you work through a problem at the same time, without having to have a collection step as a part of your work flow.
I love the simplicity & elegance of this environment, the points raised above is essentially what is covered in the tour of Acme Editor by Ross Cox in the 2nd third part.

I’ve been trying different fonts for my terminal, currently between Inconsolata & Adobe Source Code Pro
Screenshot below is taken from 2 instances of Acme, one the left running with Inconsolata 19pt antialiased font & one the right Adobe Source Code Pro 17pt antialiased.

Inconsolata vs Adobe Source Code Pro

Running IPv6 on 4.4BSD – Summer 2012 Retrochallenge entry

I’m entering the summer Retrochallenge which runs throughout July, the plan is to get an emulated host running with 4.4BSD-lite connected via IPv6 using the NRL patches & if possible serving a basic webpage over HTTP or fail at it & either way document the journey in this post.
It will be a good opportunity to visit the early implementation of IPv6 & learn about the origin of this stack, IPv6 is sexy right? or is that DNS??
I was unaware of the existence of these patches & assumed KAME was the original implementation until I was pointed to the USENIX paper by fellow tweep Dan McDonald.
Looking forward to doing some digging for information & patches 🙂
To fit the challenge rules, the host the emulation will run on will be a Cobalt Qube2 with NetBSD/Cobalt.

3/7/12
Before I started to attempt building things I did some research on what was required & if the patches and any documentation was still around.
Sun Microsystems IPng Implmentations page is still available on archive.org though the NRL IPv6+IPsec is long gone, I was able to obtain the patch sets from the RIPE FTP server
The installing & operating 4.4BSD UNIX section of UNIX System Manager’s Manual (SMM) lists the supported platforms by 4.4BSD, I hadn’t realised that VAX was not a officially supported platform in this release by CSRG, the 3 official supported platforms which binaries are shipped for being the HP, DECstation & SPARC platforms, this means that simh is off the list & it’s a toss up between tme & GXemul, I’ve not played with GXemul before but tried the Sun3 emulation on tme a few years back in an attempt to get SunOS 4.x but failed after not getting the disk setup right.
I found a copy of the 4.4BSD-Lite CD ISO files on Poul-Henning Kamps website.
Next step is to get a virtual machine up & running with 4.4BSD-Lite, I’m probably going to start with the DECstation (MIPS) emulation on GXemul & move onto SPARC on tme if things don’t work out. The README with patches states the patches were built on SPARC but I’m hoping this isn’t an issue (endianness?).

21/7/12
My CSRG archives cd set is here, this week will be a cram as I play catch up.
Front cover for CSRG Archives cd set

Back cover for CSRG Archives CD set

Running Chillispot on OpenBSD, NetBSD & Mac OS X

*** 08/07/06 – Update, the patch just allows Chillispot to build successfully, tun.c needs some more patching before chillispot will work. Sorry 🙁 ***

I have made a patch which will enable Chillispot compile & run on OpenBSD, NetBSD & Mac OS X.

The patch has been tested working on the following versions of O/S’s
OpenBSD 3.9
NetBSD 3.0-STABLE & -CURRENT
Mac OS X 10.4.7
though it should work on previous versions aswell.

To build Chillipot 1.0 first download & extract Chillispot.
Then copy the patch into the Chillispot directory & issue:
patch -p1 < chillispot -1.0.patch

You should get the following result:
patching file src/chilli.c
patching file src/dhcp.c
patching file src/redir.c
patching file src/syserr.c
patching file src/tun.c

For NetBSD & OpenBSD:
Now run ./configure with the relevant switches e.g.
./configure --sysconfdir=/etc --localstatedir=/var
then for OpenBSD: run make install chilli_LDFLAGS=""

For Mac OS X:
Run make install chilli_LDFLAGS="-lcrypto -lresolv"
If compiling fails with the following error:
redir.c: In function 'redir_accept':
redir.c:1400: error: nested functions are not supported on MacOSX
redir.c:1406: error: nested functions are not supported on MacOSX
make[2]: *** [redir.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

then you’re using GCC 4.0.1, use gcc_select to switch to GCC 3.3 by running gcc_select 3.3 then rerunning make. When you’re done you can switch back to GCC 4 by running gcc_select 4.0 surprise surprise!!! 🙂

MSN Video / Webcam support

the cvs checkout of amsn (0.95 Beta) comes with video support enabling you to use your webcam on the MSN IM network 🙂
I had problems tryinig to get the last 2 nightly builds to run on OS X 10.4
After a bit of googling around I came across a packaged version of a nightly build from a couple of days ago for OS X here

Enjoy! 🙂

http://usuarios.lycos.es/sonicromsx/amsn.dmg

My 1st Patch!

Woohoo!
I’ve just created my 1st patch, to add support for Slackware to the iSCSI Enterprise Target software

Read this guide if youre interested in rolling out your patches

--- Makefile.orig 2004-11-22 10:30:57.000000000 +0000
+++ Makefile 2004-11-22 10:35:16.000000000 +0000
@@ -28,6 +28,8 @@
install -v -m 755 scripts/initd.debian /etc/init.d/iscsi-target;
elif [ -f /etc/redhat-release ]; then
install -v -m 755 scripts/initd.redhat /etc/init.d/iscsi-target;
+ elif [ -f /etc/slackware-version ]; then
+ install -v -m 755 scripts/initd /etc/rc.d/iscsi-target;
else
install -v -m 755 scripts/initd /etc/init.d/iscsi-target;

iSCSI On a budget!

Following the Quick Guide to iSCSI on Linux I managed to setup a iSCSI Target host on Slackware 10 running on a virtual machine on VMware then connected to it from the Windows 2000 box which was the VMware host! 🙂

I used the iSCSI Enterprise Target rather then the Ardis Target which the guide covers but as the Enterprise Target is a fork of the Ardis Target there is no variation in steps carried out.

The Windows Initiator can be dowloaded from here

WMI Window Manager

After a serious plugging by some of the peepz @ BSD Nexus (WIntellect!!) I decide to give the new window manager called WMI a try on my laptop running OpenBSD.
WMI is coming from the same angle as flux & black box in that its a totally stripped down window manager with heavy focus on keyboard shortcuts.
For OpenBSD the site links straight to the OpenBSD ports cvsweb page, where you can download the necessary files to build WMI, the build process went totally smoothely & a package was created in /usr/ports/packages/i386/all/ but as there is a error in one of the Make files, the package doesnt complete the install & outputs a error (will investigate this & keep you updated).

I wasnt particularly impressed with the default theme that WMI comes with (called industrial) but there are 2 aditional themes currently available on the WMI site which you can install, which I did (im currently running the DragonflyBSD theme) & judging from the contents of a theme if you dont like the themes available it wouldnt be very difficult to make your own one, a quick edit of my theme file to add some wallpaper & Its all systems go. 🙂

Automated Uploads with FTP using cron

Today I’ve mostly been messing with IRC bots & toys.
setup a bot (eggdrop) & irc stat generator (pisg) on my server here at home. Unfortunately the channels website is hosted elsewhere, using crontab I created a cron job to run pisg at a regular interval, then planned on using ftp in another job to upload the generated stats page. Unfortunately there no way of telling the ftp command to upload files.
To get around this I resorted to setting a cron job on a script which ran ftp & included the necessary ftp commands to upload the file piped to the ftp command.
Heres the script I used (thnx Dan!):

#!/bin/sh
ftp -i -n ftp.hostname.net <<EOF
user myusern mypasswd
cd /whereu/want2upload/
lcd /wherethe/fileis/locatedlocally/
put index.html
quit
EOF

the crontab entry looks like this
0 * * * * /pathto/sh /pathtothe/script >/dev/null 2>&1