Recent Developments in BBC B Hacking

Posted by barnoid Fri, 16 May 2014 21:39:00 GMT

BBC B running 2048

I've recently been experimenting at the Hackspace with UPURS and UPURSFS. These unfriendly strings of letters amount to a cable that links the BBC's User port to my laptop via a USB to serial converter, two ROMs that go in the Beeb and some Perl code that runs on my laptop. The upshot of which is that I can access parts of the filesystem of my laptop as if they were floppies on the BBC.

How it works

The cable and one of the ROMs are the UPURS part. The purpose of which is to allow the BBC's user port to be used as a fast serial port, much faster than the RS423 port on the back. It comes with a bunch of commands for shipping disk, tape and ROM images back and forth, but I was more interested in not having to use any of those.

UPURSFS works by using the Tube protocol over this serial link. The Tube protocol is usually used for communicating with second processor add-ons over the dedicated port on the bottom of the BBC. It basically diverts operating system calls and sends them to the second processor to handle. So nearly all operating system (* commands) and filesystem commands (not BASIC) are passed over to the computer on the other end of the serial link. The upshot of which is that you can implement a remote filesystem and access data stored on a modern computer directly from the BBC. No need for a floppy drive.

John at Bristol Hackspace was able to burn the two EPROMs for me and I made up the cable. We were able to verify that the ROMs work by the presence of their names in the output of *HELP. Having connected the cable, my next test was to upload the BASIC ROM by typing *UPXROM E (in this case) and observing the result in the serial terminal running on my laptop. The word "Roger" towards the end confirmed I was seeing the right stuff.

Next I downloaded the Perl TubeHost code. I set up a directory that will represent a disk and created a file in it called "test" containing the text "hello there". I modified the TubeHost code to look at that directory and then ran it with the option -U. Then by holding the U key and pressing Break on the BBC I put it in UPURSFS mode. I then typed *DCAT and my disk appeared. I typed *DIN 5 0 to select it and then *. to list its contents. There was my "test" file. I typed *TYPE TEST and "hello there" appeared on the screen. Success.

I wanted to try some real software, so I downloaded the SSD image of Eben Upton's version of 2048 that he recently implemented to observe 50 years of BASIC. I'd been wanting to try it on a real BBC since I saw it. I unpacked the SSD into my disks directory using MMB utils. Handily TubeHost respects .inf files that contain BBC file metadata. I was able to get the disk listing on the BBC so I typed CH. "2048" only to see the dreaded "Bad Program". It turns out that my serial link is not all that clean, occasional bytes are going missing or getting corrupted. It may be because I'm using the wrong type of USB to serial converter or it could be something else, it needs some debugging. As the corruption is random I figured I'd keep trying and hope for a try where nothing important gets broken. It took five or six goes.

So we played some 2048 (albeit with corrupted fonts). Ian got to 1024. The concept is proven, just need to iron out the kinks in the serial link.