Originally published at 2023-05-10T20:47:11+01:00
. Updated to add details of FUZIX builder, and setting IP address with ifconfig
.
The SC111 is a Z180 processor module for use on a RCBUS (formerly RC2014) backplane.
The Z180 has CSIO pins which can be used for connecting to SPI devices. Wiznet produce the W5500 IC, which is a full TCP/IP stack in a chip. This offloads a lot of the required processing from the CPU and makes having a network connected 8-bit computer feasible.
Software wise, we will use FUZIX, which is a UNIX implementation for small computers put together by Alan Cox.
Hardware
The hardware I used for this is all obtainable from Steve Cousin’s site https://smallcomputercentral.com/, with the exception of the Wiznet adapter, which are widely available from sellers on AliExpress.
I used:
- SC112 modular backplane
- SC111 Z180 CPU
- SC145 Compact flash module
- Wiznet W5500 Ethernet adapter
When picking a Wiznet board, make sure to choose one which is usable on 5v. These tend to be slightly larger than the 3.3v only boards.
Next step is to connect the Wiznet to the CSIO header on the SC111. The pins need to be connected as follows:
Wiznet Pin | CSIO Pin |
---|---|
5V | VCC |
GND | GND |
RST | Connect to reset on the backplane |
INT | Not connected |
NC | Not connected |
3.3V | Not connected |
MISO | RXS |
MOSI | TXS |
SCS | GND |
SCLK | CKS |
Next, obtain FUZIX from https://github.com/EtchedPixels/FUZIX
In the top level makefile, set TARGET=rcbus-z180
.
We now need to modify some settings within the platform config file Kernel/platform-rcbus-z180/config.h
Ensure #define CONFIG_NET_W5500_FDM
is present. The Wiznet device has two modes of interfacing, VDM (Variable Data Mode), where any number of bytes can be sent/ received while asserting the chip select line,
and FDM (Fixed Data Mode) where the data phase length can only be 1 2 or 4 bytes and is indicated in the control phase. FDM is not recommended, but without adding some additional chip select logic similar to what’s present on the SC126, we have no way of controlling it, therefore FDM is the only option.
I didn’t know anything about FDM or VDM before embarking on this project but thanks to Alan Cox’s help and guidance in this thread https://groups.google.com/g/retro-comp/c/6qk9pLM4Sm4 I added support for FDM in this pull request https://github.com/EtchedPixels/FUZIX/pull/992. Many thanks for your help Alan!
In later FUZIX version I have found that reducing the memory usage is necessary to allow this option to be enabled - I’ve done this by changing NBUFS
to 3 in config.h
(and adjusting _bufpool
in rcbus-z180.s to the same)
Software
To build everything, do make all
. If you just want to rebuild the kernel, this can be done with make kernel
. Similarly just the built kernel can be cleaned with make kclean
. Finally disk images can be build with make diskimage
.
Using fuzix-builder
I have been using this docker image https://codeberg.org/reik_kaps/fuzix-builder to do the builds - this saves having to install the build tools locally.
First clone the fuzix-builder
repo, then run docker build -t fuzix-builder .
to build an image.
Then when in your clone of the FUZIX tree, you can build in a container, by doing for example docker run -v ${PWD}:/src/ -it fuzix-builder make all -j30
Writing the image and booting
The diskimage can be written to a CF card using dd if=./Images/rcbus-z180/disk.img of=/dev/<replace with cf card device>
FUZIX can be loaded by the ROMWBW bootloader the same as CP/M, by specifying the disk unit to boot (2 in this case).
At the bootdev
prompt, enter hda1 wiznet
RomWBW HBIOS v3.1.1-pre.21, 2020-07-12
RC2014 Z8S180-N @ 18.432MHz IO=0xC0
0 MEM W/S, 2 I/O W/S, INT MODE 2
512KB ROM, 512KB RAM
AY: IO=0xA0 NOT PRESENT
ASCI0: IO=0xC0 ASCI W/BRG MODE=115200,8,N,1
ASCI1: IO=0xC1 ASCI W/BRG MODE=115200,8,N,1
DSRTC: MODE=STD IO=0x0C NOT PRESENT
MD: UNITS=2 ROMDISK=384KB RAMDISK=384KB
IDE: IO=0x10 MODE=RC
IDE0: 8-BIT LBA BLOCKS=0x0001EA00 SIZE=61MB
IDE1: NO MEDIA
PPIDE: IO=0x20 PPI NOT PRESENT
Unit Device Type Capacity/Mode
---------- ---------- ---------------- --------------------
Char 0 ASCI0: RS-232 115200,8,N,1
Char 1 ASCI1: RS-232 115200,8,N,1
Disk 0 MD1: RAM Disk 384KB,LBA
Disk 1 MD0: ROM Disk 384KB,LBA
Disk 2 IDE0: CompactFlash 61MB,LBA
Disk 3 IDE1: Hard Disk --
RC2014 Boot Loader
Boot [H=Help]: 2
Booting Disk Unit 2, Slice 0, Sector 0x00000000...
Volume "Fuzix 126 Loader" [0xF200-0xF400, entry @ 0xF200]...
FUZIX version 0.5
Copyright (c) 1988-2002 by H.F.Bower, D.Braun, S.Nitschke, H.Peraza
Copyright (c) 1997-2001 by Arcady Schekochikhin, Adriano C. R. da Cunha
Copyright (c) 2013-2015 Will Sowerbutts <will@sowerbutts.com>
Copyright (c) 2014-2024 Alan Cox <alan@etchedpixels.co.uk>
Devboot
512KiB total RAM, 448KiB available to processes (15 processes max)
Enabling interrupts ... ok.
0000 : SMART CF - OK
0001 : - absent
hda: hda1 hda2 (swap)
bootdev: hda1 wiznet
Wiznet 5500 detected.
Mounting root fs (root_dev=1, ro): OK
Starting /init
init version 0.9.1
Checking root file system.
Current date is Wed 2024-09-25
Enter new date:
Current time is 22:30:46
Enter new time:
^ ^
n n Fuzix 0.5
>@<
Welcome to Fuzix
m m
login: root
Welcome to FUZIX.
You should see Wiznet 5500 detected.
in the messages printed. I found that the Wiznet was not detected from cold boots - at least 1 reset was required before it was detected.
Running ifconfig
should yield some sensible output:
# ifconfig
eth0 : up broadcast running mtu 1500
ether: c0:ff:ee:c0:ff:ee (Ethernet)
inet 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255 gateway 192.168.0.254
DHCP is not supported so the ip address must be manually configured, which can be done using ipconfig
ifconfig eth0 ip 192.168.1.234
ifconfig eth0 gw 192.168.1.1
Various programs are available to make use of the network interface, and example is htget
which operates similarly to wget and can download resources over http.
# htget http://192.168.0.2/ test.html
..
# cat test.html
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
Note that ping
will report socket: Protocol not supported
this is because we are not using the Wiznet in raw mode and therefore can’t send ICMP packets.
Common issues
If you get dumb is not a known terminal type
when running a command, set TERM to one of the options in /etc/termcap - vt52
or xterm