Bug 246784 - New port: comms/opencbm: Commodore CBM serial IEC/IEEE-488 bus utilities
Summary: New port: comms/opencbm: Commodore CBM serial IEC/IEEE-488 bus utilities
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dirk Meyer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-27 14:40 UTC by Felix Palmen
Modified: 2020-06-06 14:26 UTC (History)
3 users (show)

See Also:


Attachments
add comms/opencbm, comms/opencbm-kmod and comms/opencbm-plugin-xa1541 (20.48 KB, patch)
2020-05-27 14:40 UTC, Felix Palmen
no flags Details | Diff
add comms/opencbm, comms/opencbm-kmod and comms/opencbm-plugin-xa1541 (19.67 KB, patch)
2020-06-06 10:31 UTC, Felix Palmen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Palmen freebsd_committer freebsd_triage 2020-05-27 14:40:44 UTC
Created attachment 214923 [details]
add comms/opencbm, comms/opencbm-kmod and comms/opencbm-plugin-xa1541

"The OpenCBM package contains user space support programs and development
libraries to control and use CBM serial IEC/IEEE-488 bus devices as used by
most Commodore (CBM) 8-bit machines."

With these ports, you can use an old 8-bit Commodore floppy drive on the PC, connected either to the parallel port or to USB (several cable types are supported).

Main category is "comms", because the main feature is implementing the old bus protocols for talking to the drives. Also added category "archivers" because older upstream versions included a FreeBSD port in with this category and as the tools can be used to archive old floppy disks, and the image formats are a sort of archive, this IMHO matches as well.

There are two slave ports because for parallel-port cables, a kernel module is needed, and the plugin for using these cables depends on the kmod port. This avoids the binary package of opencbm itself to pull in a kernel module that users of USB cables won't need. I added a FreeBSD manpage for the kernel module to the kmod port.

Tests passed:

- poudriere testport with default options on {11.3,12.1,13}/{i386,amd64}
- poudriere testport with all options combinations on 12.1/amd64
- correct operation using an XMP-1541 parallel-port cable and a C-1541 floppy
  drive verified on 12.1/amd64. I can't test functionality of USB cables as I
  don't own one.

Disclaimer: porting the kernel driver from Linux to FreeBSD was done by me around 1.5 years ago, upstream merged my code.
Comment 1 Torfinn Ingolfsen 2020-05-29 20:27:13 UTC
Tested with a ZoomFloppy and a 1571 drive (unfortunately, I don't have any CBM-formatted floppies for the drive yet) on a FreeBSD 11.3-stable machine:

root@kg-core1# uname -a
FreeBSD kg-core1.kg4.no 11.3-STABLE FreeBSD 11.3-STABLE #2 r352605: Sun Sep 22 22:53:27 CEST 2019     root@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64


root@kg-core1# cbmctrl detect
 8: 1571 
root@kg-core1# 
root@kg-core1# cbmctrl status 8
00, ok,00,00

appears to work.
Comment 2 Felix Palmen freebsd_committer freebsd_triage 2020-05-31 20:42:54 UTC
Well, model-detection and reading the status channel sure is enough to prove communication with the drive works!

So the only thing not tested is correct operation of the "xu1541" plugin (also included in the master port) for "home-brew" USB cables. It's unlikely to find someone for testing these, as they are probably very rare, people using USB will most likely have a "ZoomFloppy", "XoomFloppy" or similar, which require the "xum1541" plugin. But as both plugins work on top of libusb, I think having one of them tested is enough to be very confident that both work as intended :)

Thanks Torfinn for testing!
Comment 3 Mikael Urankar freebsd_committer freebsd_triage 2020-06-01 10:00:09 UTC
Can you put that on phabricator please?
Comment 4 Felix Palmen freebsd_committer freebsd_triage 2020-06-01 10:25:36 UTC
(In reply to Mikael Urankar from comment #3)
I don't have an account there (yet?) -- and I'd probably need a primer on the usage as well.
Comment 5 Mikael Urankar freebsd_committer freebsd_triage 2020-06-01 10:33:54 UTC
(In reply to Felix Palmen from comment #4)
or github/gitlab? It's easier to review / comment with phab/gh/gl
Comment 6 Felix Palmen freebsd_committer freebsd_triage 2020-06-01 10:49:47 UTC
(In reply to Mikael Urankar from comment #5)
Sure, here's a pull-request containing the changes:
https://github.com/Zirias/freebsd-ports/pull/1
Comment 7 Felix Palmen freebsd_committer freebsd_triage 2020-06-06 10:31:44 UTC
Created attachment 215290 [details]
add comms/opencbm, comms/opencbm-kmod and comms/opencbm-plugin-xa1541

Reworked the whole structure now, abandoning master/slave scheme.

Instead have a Makefile.inc in comms/opencbm and use this and the distinfo file from the other ports. This simplifies the ports a lot.

Resolved accidentally hardcoded /usr/local by patching the file with REINPLACE_CMD from the Makefile.

Repeated all previous build tests, still fine.

Updated the pull-request on github for easy review:
https://github.com/Zirias/freebsd-ports/pull/1
Comment 8 commit-hook freebsd_committer freebsd_triage 2020-06-06 14:22:07 UTC
A commit references this bug:

Author: dinoex
Date: Sat Jun  6 14:21:39 UTC 2020
New revision: 538094
URL: https://svnweb.freebsd.org/changeset/ports/538094

Log:
  OpenCBM driver module for parallel-port X[MA]-1541 cables

  The OpenCBM package contains user space support programs and development
  libraries to control and use CBM serial IEC/IEEE-488 bus devices as used by
  most Commodore (CBM) 8-bit machines.

  This port contains the FreeBSD driver for parallel-port cables for OpenCBM.

  WWW: http://opencbm.sourceforge.net/

  PR:		246784
  Submitted by:	Felix Palmen

Changes:
  head/comms/Makefile
  head/comms/opencbm-kmod/
  head/comms/opencbm-kmod/Makefile
  head/comms/opencbm-kmod/files/
  head/comms/opencbm-kmod/files/opencbm.4
  head/comms/opencbm-kmod/pkg-descr
  head/comms/opencbm-kmod/pkg-plist
Comment 9 commit-hook freebsd_committer freebsd_triage 2020-06-06 14:25:20 UTC
A commit references this bug:

Author: dinoex
Date: Sat Jun  6 14:24:23 UTC 2020
New revision: 538095
URL: https://svnweb.freebsd.org/changeset/ports/538095

Log:
  OpenCBM plugin for parallel-port cables

  The OpenCBM package contains user space support programs and development
  libraries to control and use CBM serial IEC/IEEE-488 bus devices as used by
  most Commodore (CBM) 8-bit machines.

  This port contains the xa1541 plugin for parallel-port cables.

  WWW: http://opencbm.sourceforge.net/
  PR:		246784
  Submitted by:	Felix Palmen

Changes:
  head/comms/Makefile
  head/comms/opencbm-plugin-xa1541/
  head/comms/opencbm-plugin-xa1541/Makefile
  head/comms/opencbm-plugin-xa1541/pkg-descr
  head/comms/opencbm-plugin-xa1541/pkg-plist
Comment 10 Dirk Meyer freebsd_committer freebsd_triage 2020-06-06 14:26:50 UTC
Thanks, Committed with small changes.