CPC/IP - A TCP/IP stack for Amstrad CPCs

CPC/IP is an implementation of the PPP, SLIP, IP, ICMP, UDP, TCP, DNS, TFTP, HTTP, ping, finger and telnet protocols for Amstrad CPC computers with an Amstrad, Pace or CPC Amstrad International serial interface. The code occupies about 14K, excluding the serial, filing system and IP buffers.

What's new?

Compatibility

CPC/IP is compatible with the following Internet protocols, with the limitations listed further below:

Unsupported features

Some of these limitations make this implementation non-compliant as per RFC1122 and RFC1123. You'll have to decide for yourself how significant the non-compliances are!

Oh, and CPC/IP doesn't support streaming RealVideo.

Portability

Although CPC/IP officially only supports Amstrad CPCs with Amstrad serial interfaces, it should work on compatible systems. The important points are that

Note the Pace serial interface satisfies these requirements, except that the interrupt line is not connected. It must therefore be polled. In turn, this means the datarate should be 4800 bps (though 9600 bps may be achievable if 8E2 or maybe just 8N2 framing is used -- it is in fact only necessary to use two stop bits on the remote side, so you might be able to get away with 8N1 on the CPC). You will need to make appropriate changes in config.z and rebuild.

A device driver for the serial interface which appeared in CPC Amstrad International 1992-06/07 is available; you'll need to change a line at the top of config.z and rebuild to use this (but note this currently does not support 64K memory configurations).

If you want to use the full 128K, then if your machine isn't a CPC6128 the important point is that

Failing all this, though, it shouldn't be very difficult to port the system-dependent bits to a different system.

How to use

(The following assumes connection to a Linux box, and specifically to the version of Linux which happens to be on my box at home. I'm not a Linux guru, so it's unlikely I'll be able to help if the Linux bits don't work for you or make no sense! You can also connect straight to an ISP via a modem (ignoring all the bits about setting up the peer), as long as, if you're using SLIP, you use addr to set your IP address everytime if your ISP gives out non-static IP addresses. Note: the Amstrad serial interface, at least, won't receive unless Carrier Detect is active, if hardware flow control is being used. If you can't get your modem to force it active via a DIP switch, you'll have to type "AT&C0" blind to do so in software.)

Well, wasn't that worth it?!

Other 8-bit TCP/IP stacks

Tangents

What next?

If you like what you see, and would like things to go further, then please get in touch. If no-one cares, there's not much point (although it's quite an educational experience implementing the protocols).

As you will see if you look at the code, it's reasonably well structured (within the limitations of Maxam), and hooking in new stuff shouldn't be too difficult. The most interesting bit will be to work out how to allow things to hook in and then be called in the background. I've been thinking of schemes using OS events, but nothing's very firm yet. Currently the serial device driver is interrupt-driven, but the protocol stack is essentially polling-driven.

Can you contribute?

Copyright

Although I ultimately plan to make CPC/IP available Free, at this stage in its evolution I would like to keep it under reasonable control.

CPC/IP is Copyright (c) 1999-2000 Mark RISON. You may not distribute it without my permission (this includes modified/extended versions). Try emailing me for permission -- you should be pleasantly surprised!

Thank you for respecting this.


Mark RISON, <mrison@hotmail.com>, 2000-10-15

Thanks to Franck ARNAUD for hosting these pages.