I’ve been an eager reader of hackaday.com and a while ago they have introduced this challenge to browser their retro site (retro.hackaday.com) from old machines. I thought about doing it back when they announced it, but as it is with everything, life always gets in the way. However, now that we have autumn holidays at the university, and there are no emergency projects to take care of, I thought it couldn’t hurt to spend a couple of hours hacking something together
I have been collecting old hardware (as you can probably see from some of the older posts), and in this collection the two oldest pieces I have is a 386 laptop with 6 MB of ram, and the Schneider CPC664 (aka. Amstrad CPC664). At first, I thought I would get the laptop running, as it would probably be the easiest… Just whip up a small Linux on the 2.5″ IDE disk, set up SLIP or PPP for a connection, and I would be browsing away happily with lynx or elinks, however, it turned out that while the machine booted up fine (couple of memory problems on the way, but oh well) the HDD in it was dead, and the IDE ribbon cable was also broken. After sourcing an other HDD (this time from a much newer laptop), and fixing the cable, it turned out that most likely the newer drive draws too much power, as it would start spinning up and cut out in the middle of the spinup. Lacking a working floppy drive and harddrive, I turned to the other much much cooler machine.
The story behind this Schneider CPC664 (as has been told by my mom) is that back in the mid-1980s (roughly 5 years before I was even born), my parents were working at a university in (western) Germany, where they got the machine in return their help in fixing some disk/filesystem problems for a computer retailer. Computers like this were very rare in Hungary back then, and it had to be smuggled into the country. They had been using it for their scientific work for a number of years, and I have some faint memories of playing chess on it, and writing (with the help of my parents) a program that could display my weekly schedule in primary school. ( I believe this was around mid-1990s, at that point my parents have upgraded to much newer hardware, and I got this one as a toy ) By the time I was old enough to start coding, I’ve also got a 386, and the CPC664 was packed up and stored in the basement. After surviving another decade, the close to 30 year old machine still works!
After figuring out what to plug where, and sourcing an old TV, machine powers up, the “in function” LED lights up, and magical words appear on the TV:
However, when I was trying to type something, only a couple of buttons worked, the others didn’t do anything. Not good. Time to take it appart:
Opening it up revealed that most likely the flat cable connecting the keyboard to the motherboard got loose (and the connector oxidized a bit), so after cleaning it off and plugging it back in, it worked. Easy enough It was also a good excuse to look at what’s inside:
Btw, for those who might not be familiar with the CPC664, it houses a Zilog Z80 CPU running at 4Mhz and 64kByte of external RAM. It is capable of driving the screen at 160×200, 320×200 and 640×200 (thought this last mode is barely readable on the TV). It used to come with it’s own screen with a proprietary video connector, however it should be possible to interface it to regular tvs with SCART. I haven’t tried this, as my parents have built a separate device capable of converting the video from the machine into an RF TV signal, so it was possible to use it with regular TVs back in the days. It also has a 3″ floppy drive, which is I believe was a similar technology to the the 3.5″ we all know so well.. (I guess it was the HDDVD/Bluray war, but with floppies) Unfortunately I don’t have any of those old floppy disks anymore, or the tape drive, so everything needs to be typed. As an extension, it exposes a 16bit address bus and the 8bit data bus, which can be used for loading code from external ROMs, or in my case, a memory mapped RS232 serial.
After fiddling with PSUs, and serial connections etc, I finally ended up with a working setup. The CPC664 could communicate with my laptop, although at 300bps, it still worked. Then I was faced with the option on how to display the site, here I had a couple of possibilities:
- Implement some sort of TCP/IP network over serial on the CPC => out of the scope of this project
- Implement a serial HTTP proxy and process the HTTP on the CPC
- Do the HTTP processing on the laptop and only send the text to the CPC to display as a dumb terminal
After pondering a bit about it, I ended up with a hybrid solution, which looks somewhat like this:
1. Python script running on the laptop, opens up a serial connection to the CPC, and prompts the user to enter the url, and dumps the raw html through the serial
2. 30 lines of Locomotive BASIC, which handles both serial in/out, and strips the tags from the received data.
So here is the result, Retro Hack a Day on the CPC664 (Inpatient ones skip to 5m30s):
Source to the BASIC script: serialbrowser.bas
Source to the Python HTTP/serial proxy: term.py
And a couple of more pics:
Categorised as: Default