OpenCBM

VIC-1541 on my PC workstationWith it freezing and snowing today, I decided to make use of the idle time by hooking up my pristine VIC-1541 floppy disk drive to my workstation and do some file archiving to real 5-1/4″ media using OpenCBM under Linux.

OpenCBM provides an API library and some useful command-line tools.  The following is an example of how to format and copy Commodore files to the floppy drive:

$ sudo modprobe cbm

$ dmesg | tail
cbm_init: using passive (XM1541) cable (auto), irq 7
cbm: resetting devices
cbm: waiting for free bus...

$ cbmctrl detect
 8: 1540 or 1541 

$ cbmctrl command 8 "N0:VIC20 3-JAN-2010,10"
$ cbmctrl status 8
00, ok,00,00
$ cbmctrl dir 8
0 ."vic20 3-jan-2010" 10 2a
664 blocks free.
00, ok,00,00

$ cbmwrite 8 quikman+8k.prg
[Info] writing quikman+8k.prg -> QUIKMAN+8K.PRG,P,W
[Info] identified a 1540 or 1541 drive
............-
[Info] 00, OK,00,00
$ cbmwrite 8 omega-fury.prg 
[Info] writing omega-fury.prg -> OMEGA-FURY.PRG,P,W
[Info] identified a 1540 or 1541 drive
....................
[Info] 00, OK,00,00

$ cbmctrl dir 8
0 ."vic20 3-jan-2010" i1 2a
47   "quikman+8k.prg"   prg
76   "omega-fury.prg"   prg
541 blocks free.
00, ok,00,00

Of course, I can now hook-up this drive to a real VIC 20 computer and play what’s on the diskette(s).  But for giggles, I can even use the Commodore 8-bit emulator, VICE, to test drive my floppies, for example:

$ xvic -memory 8k -device8 2 +truedrive -keybuf 'LOAD "QUIKMAN+8K.PRG",8D'
...
sucessfully loaded libopencbm.so
/dev/cbm opened.
...
VICE
VICE 2.2 on a 24″ HP display

Nice!

One thought on “OpenCBM

  1. After copying a bunch of files to a real floppy, you can make a backup of the media using the d64copy command, i.e.,

    $ time d64copy -w -v 8 vic20.d64
    [Info] Trying to identify drive type
    [Info] drive 08 (1541): 00, OK,00,00
    [Info] copying tracks 1-35 (683 sectors)
    1: *********************
    2: *********************
    3: *********************
    4: *********************
    5: *********************
    6: *********************
    7: *********************
    8: *********************
    9: *********************
    10: *********************
    11: *********************
    12: *********************
    13: *********************
    14: *********************
    15: *********************
    16: *********************
    17: *********************
    18: *******************
    19: *******************
    20: *******************
    21: *******************
    22: *******************
    23: *******************
    24: *******************
    25: ******************
    26: ******************
    27: ******************
    28: ******************
    29: ******************
    30: ******************
    31: *****************
    32: *****************
    33: *****************
    34: *****************
    35: ***************** 100% 683/683
    683 blocks copied.

    real 1m22.080s
    user 0m2.073s
    sys 1m15.706s

Comments are closed.