1. Introduction
This page describes how to transfer data between a C64 and a Linux based PC.Data transfer on the C64 system usually means transferring disk images, so-called d64 files, directly to real floppy discs. The C64 does not come with permanent storage (even though hard disc extensions exists). And it does not have a in-memory file system either, so basically files must be stored to floppy discs in one way or another anyway.
This tutorial focuses on connecting the disc drive to the PC, writing the files, and later on connect the disc drive again to the real C64. In theory, it is possible to transfer single files to the C64 main computer and store the separate files within the C64 on the floppy disc connected to it. But since this is more complex, and I'm not aware of such tools, here I describe writing files to floppy discs connected to the PC.
For the actual data transfer, standard cables cannot be used as the C64 does not have standard parallel or serial ports. Luckily, the disc drive is connected to the C64 via a serial port, just not via a rs232 cable. Several cables has been developed to be able to connect the drive to the PC. Here, I focus on special cables which allow to connect the C64 floppy drive to a parallel port at the PC. Then it is easily possible to read and write disc images. This approach also has the advantage of being relatively fast.
The disc images itself can be created, modified, and managed with software available on UN*X, mainly the Vice commodore system emulator. It is possible to extract individual files from disc images, or put files into disc images.
2. Floppy image transfer
The software needed to transfer disc images is rather old and only supports linux kernel version up to 2.6. Since for this guide, you need a parallel port which are usually no longer available on current computers, I recommend to use a rather old PC with a parallel port, supported by Linux 2.6.The actual software is OpenCBM. To proceed, download version 0.4.2a from the website.
2.1. Software and hardware preparations
- Switch off both computers! Seriously, especially the old hardware is precious and not easily repaired. The circuits are not well protected for misconfigurations and over-voltage.
- Connect XA1541 cable to the parallel port of the PC and to the "Serial" connector on the 1541 floppy disc.
- Install necessary linux software:
- Install the linux kernel sources. Maybe you need to do "make prepare module_prepare" inside the top-level kernel sources, depending on your linux distribution.
- Install linuxdoc-tools
- Install latex/tetex/texlive
- Install OpenCBM:
- unpack opencbm-0.4.2a
- compile with "make -f LINUX/Makefile" maybe also "make -f LINUX/Makefile dev"
- install with "make -f LINUX/Makefile install"
- Load kernel modules:
- modprobe parport
- if it does not work, try "rmmod lp" to remove the printer module
- modprobe cbm
- "dmesg" should contain message about cable type:
"cbm_init: using active (XA1541) cable (auto), irq 7"
- Test connection:
- Execute in a shell:
$ cbmctrl command 8 I0
$ cbmctrl status 8
00, ok,00,00
- Execute in a shell:
2.2. Copy disc images
Once everything is set up, the transfer is very easy and straight-forward: To create a disc image from a floppy disc, executed64copy 8 <filename.d64>For the other direction, to write a disc image to the floppy disc, execute
d64copy <filename.d64> 8
3. Further reading
If you need additional information, here are some hints to look for:- the OpenCBM software contains additional software like "cbmcopy" to copy single files, etc. This can be more efficient if you plan to modify only small files on the disc.
- the Vice emulator comes with a tool named "c1541" which is able to modify disc images.
- You can find more information about different cable versions here.
tags: c642