SpeccyBoot
How it works

SpeccyBoot is about booting a ZX Spectrum over an Ethernet network. Network booting was used for diskless workstation a few years back, but is still used for booting embedded development boards. I thought it'd be interesting to try this with the Spectrum.

Contents


How network booting works

In general, network booting works as follows:

SpeccyBoot is a device to do this with a Spectrum. The device connects to the Spectrum's expansion port, and to your local network using standard Ethernet. SpeccyBoot uses standard IP-based protocols, so it works with standard software.

This allows us to load virtually any program onto the Spectrum in a matter of seconds, instead of the tedious and error-prone cassette loading. Programs are packaged as .z80 snapshots, which can be created from any modern Spectrum emulator, or obtained from the World of Spectrum archives.

Network booting with SpeccyBoot

When you switch on a SpeccyBoot-equipped Spectrum, it will do the following:

  1. If Caps Shift is being pressed during start, the machine will boot into BASIC, and not continue with the steps below.
  2. An IP address is obtained using DHCP.
  3. Tthe file snapshots.lst is loaded using TFTP.
  4. The contents of snapshots.lst are displayed as a menu. When a snapshot is selected, it is loaded using TFTP, and then executed.

Configuration is neither necessary nor supported:


SpeccyBoot internals

The picture below gives a logical view of SpeccyBoot's internals. The device connects to the Spectrum's expansion bus connector, and uses the MicroChip ENC28J60 Ethernet Controller to connect to Ethernet. The controller communicates with the Spectrum using the SPI protocol using a very simple SPI host. Finally, the device also contains an 8kB EEPROM with a dedicated stack for the protocols involved.

Hardware/software interface

The SpeccyBoot hardware is controlled by writing to and reading from a single 8-bit control register, located at address 0x9F in the Z80 I/O address space. Data from SpeccyBoot is read back from the same address. The individual bits have different have the following meaning:

BitMeaning when writtenMeaning when read
0SPI SCK: SPI clock signal (strobe).SPI MISO: SPI data from ENC28J60.
1-2, 4Unused: the SpeccyBoot stack will write 0 to these bits.Unused: ignore
3ETH CS: Chip select signal for ENC28J60 (active low).
5EEPROM CS: Chip select signal for EEPROM. When this signal is asserted (low), the ROMCS signal (for the Spectrum's internal ROM) will automatically be deasserted (forced high).
6ETH RESET: Reset signal for the ENC28J60 Ethernet controller (active low).
7SPI MOSI: SPI data to ENC28J60.

SpeccyBoot software stack

The software stack implements (needed parts of) the following standard IETF network protocols:

RFC 768UDP (User Datagram Protocol)August 1980
RFC 791IP (Internet Protocol)September 1981
RFC 826ARP (Address Resolution Protocol)November 1982
RFC 906Bootstrap Loading using TFTPJune 1984
RFC 1350TFTP (Trivial File Transfer Protocol)July 1992
RFC 2131DHCP (Dynamic Host Configuration Protocol)March 1997
RFC 3164BSD Syslog ProtocolAugust 2001

Although these protocols are as old as (in some cases, even older than) the Spectrum, these IP-family protocols are supported by all personal computers since the mid 1990s.

SpeccyBoot also includes a bit-banged SPI stack (capable of a transfer bandwidth of about 45kbit/s), a menu selection facility, and support for loading and executing Z80 snapshots.

The code is available at SourceForge.


Compatibility

I'm using SpeccyBoot with a Spectrum 128. It should work equally well with a 48k machine, and probably with a 16k machine too. Tests with Fuse emulation seem to confirm this.

The later Amstrad Spectrum machines (+2A/+2B/+3) have a different expansion connector, and will not work directly with the SpeccyBoot as described here. It's certainly possible to design a slightly modified SpeccyBoot board to connect to one of these machines; I just haven't had the opportunity to do so myself.


2009–2012