View Full Version : Contiki and the Commodore 64

March 10th, 2010, 06:30 PM
Okay, tonight in my Networking class, my instructor was talking about the TCP/IP stack and why it needs so much memory.

I seemed to remember Contiki running on a Commodore 64. Checking the internet, I verified I'm not crazy (well, at least on this subject!).

My question, I noticed you need a eth64 ethernet adapter. Anyone every use one of these? And how much do they run? Do you need to get the IDE64 also?

Fact of the matter, how much would it run to get a C64 up and running on the 'net?

Another MAJOR question, I saw where you can download a d64 image of contiki for the C64, but how do you get that disk image from a Windows Vista (sigh...) over to the C64?

Thinking a bit, IF you need the IDE64 to connect the eth64 to the C64, am I correct in assuming that would resolve getting the .d64 image to the C64?

Inquiring minds want to know!


March 10th, 2010, 10:03 PM
A friend of mine has demonstrated Contiki a couple of times on a C64. There are a few different Ethernet solutions, but off-hand I don't remember how expensive they are. I would expect somewhere in the ballpark of $50-$70 for a setup. From what I remember, Contiki runs off a floppy disk so no real need of getting an IDE interface. If you need a mass storage device, you should look up the uIEC/SD by Jim Brain on this forum, or its cousin sd2iec. Jim also has an uIEC/IDE+CF solution if you insist of connecting a hard drive to the C64 instead of just a memory card.

As for your second question, how to transfer D64 images to real floppy disks, the answer is it depends on which tools you have available. The oldschool solution that works quite well is an X-series cable, ideally an XM1541 or XA1541 cable. It requires that your PC has a meaningful parallel port and you have a 1541 or compatible disk drive that you can connect to it. There are like a couple dozen more ways to transfer those disks, but all the others tend to be more complicated or expensive.

Finally, the uIP stack featured in Contiki isn't exclusive to the C64. A lot of integrated devices today uses Contiki as the network operating systems. Many of those devices come with 48-64K ROM and 1-2K RAM. Even 8K RAM would be a luxury. See also Mike Brutman's TCP/IP stack which can be made running even on a IBM PCjr, dunno at how little memory. So your instructor talking about TCP/IP using a lot of memory probably refers to modern big-scale operating systems like Windows and Linux, systems where performance is at premium and a good deal of workspace, stack, cache is preferred.

If you look for implementations meant to run slow but use very little memory, there exists a bunch but I suppose it would be a bit irrelevant to a general networking class. It is like mentioning you can actually build a car engine with 0.8 liter volume and still cram 50-70 mph out of it, not to mention it will run at 3000+ rpm. Most of your buddies probably would never consider that car and rather go for one with 2-3 liter volume and better performance.

March 11th, 2010, 05:41 AM
Excellent comments from Carlsson, as usual .. I want add two things:

Everything you want to know about Contiki OS can be found here: http://www.sics.se/contiki/

A full functioned TCP/IP can be a memory hog. But you can get a pretty compliant TCP/IP in just a few 10s of kilobytes of RAM. Here is what you give up as the memory gets constrained:

Buffer space: with little or no buffer space you lose a lot of the performance advantages of TCP/IP. Taken to an extreme (as in Contiki), it basically has to throw away the sliding window part of the protocol.
IP fragment reassembly: IP packets can be up to 64KB in size. You need a considerable amount of RAM to hold and reassemble fragments. Smaller implementations generally don't support IP fragments.
Error handling and recovery code: this often gets pushed up into the application to make the TCP/IP layer simpler. The application becomes responsible for holding onto buffers and retransmitting when necessary.
Advanced features: The ability to listen for incoming socket connections adds code. So does built in tracing, zero-window support, multiple open sockets at the same time, etc.

Contiki is as about as small as you can get, but it is also very stripped down. The PC based TCP/IP stacks generally support many more features and better performance, but the cost is that they require at least 128KB to get started.

March 11th, 2010, 05:58 AM
Great points! It goes to show there are many ways to approach a task. Either you try to make a fully compliant implementation which gets a bit big in size, or you stick to implementing the bare necessities and profile it to become as small as possible. Curtis might want to take this insight back to class and if there is room for it, discuss those stripped down implementations and which implications it has on applications and rest of the network.

March 11th, 2010, 07:45 PM
My question, I noticed you need a eth64 ethernet adapter.
64NIC+ is compatible with Contiki, and it is sold for $55.00

Anyone every use one of these? And how much do they run? Do you need to get the IDE64 also?
You do not need IDE64 for Contiki, but if you buy an ETH64, you will need an IDE64, as the ETH64 requires the IDE64 to provide a suitable hardware interface (ShortBus, I think they call it)

Fact of the matter, how much would it run to get a C64 up and running on the 'net?

Google for 64NIC+ or RR-NET, and you should find links to GuruTerm, a Twitter Client, ip64, etc.

March 12th, 2010, 06:30 AM
Hmmm, sounds like something to tinker with once I get my workbench cleared of the A2000 that's beeen eviserated!

Will have to start gathering pieces.

September 6th, 2010, 12:23 PM

I also have the C64NIC+. And I'm using an original C64 with 1541 floppy drive. I'm trying to get the WWW browser in Contiki to get online. It starts up with the website already in there, http://contiki.c64.org/
But it keeps getting 'host not found'.

I ran the NIC-Test utility to run the Loopback test on the CS8000 chip and it works fine. This test doesn't require a Lan cable. The test runs a loopback test thru the network chip only. I found this test here

When I connect the Lan cable to my router here at home, the green Link led is lit and the red Activity led blinks on the C64NIC+. Also, I can see the Link light is lit on my Verizon FiOS router for that channel. I know the Lan cable is good because I share it with my 2nd PC here to go online. I downloaded the *.d64 image for C64 contiki from this website

Then I read about this website
This has some kind of config screen to let you customize the image. I realize I need to select C64 for my computer and I have to select the Ethernet card supporting RR-Net. But do I need to enter any of the IP Addr's in there, as I see it doesn't detect my system automatically.

This is what I get on when i visit that webpage

IP Address: 192.168. 0.111
Subnet Mask: 255.255.255. 0
Default Gateway: 192.168. 0. 1
DNS Server: 192.168. 0. 1

Now, on my home Lan, and my PC addr is, the network router is at, so shouldn't I enter the same IP Addr for the Router in the box for 'Default Gateway' and 'DNS Server' ?
So then, it should look like this.

IP Address: 192.168. 1.111
Subnet Mask: 255.255.255. 0
Default Gateway: 192.168. 1. 1
DNS Server: 192.168. 1. 1

Then it shows that there's 2 disk images to download, versus only the one disk image from the link above.

an I safely assume this is the latest version by going to the cbm8bit.com website instead ?

Do I need two drives then, since there's 2 disk images, or is this just extra software which I can swap out with just one 1541 drive ?

The switches on this weren't very clear. I didn't receive any paperwork with instructions. So I had to google this info. I found that the Top of the card that they mention is the goldfinger edge.

So my toggle switches are currently set this way - looking at it while sitting in front of the C64 keyboard (slash indicated direction of toggle switch) . I would use the term front/back - unless someone is using a cartridge expander--but then it seems top/bottom description they use is reversed still.

/ S1 = RR-NET
\ S2 EPROM NOT selected
\ S3 = C64 EPROM usage
/ S4 register space = IO1

September 7th, 2010, 09:19 AM
I posted what I found to get my C64NIC+ running with my C64 on this thread