CMX(4)

πŸ’– CMX(4) β€” the Omnikey CardMan 4040 smartcard reader device driver πŸ’–

okay bestie, sit down, grab a boba, because we're talking about cmx, the driver for the PCCARD based Omnikey CardMan 4040 smartcard reader. this is a Kernel Interfaces Manual situation and it's giving niche-but-iconic. πŸŽ€


✨ SYNOPSIS ✨

device cmx

that's it. that's the whole vibe. one line, zero notes. πŸ’…


🚨 DEPRECATION NOTICE 🚨

bestie this one is on the way out!! this driver is scheduled for removal prior to the release of FreeBSD 13.0. so enjoy it while it lasts, because the countdown has officially begun. 😭

🌸 DESCRIPTION 🌸

okay so the cmx driver is the whole support system for the PCCARD based Omnikey CardMan 4040 smartcard reader. it hooks you up with a character device special file based Chip/Smart Card Interface Devices (CCID) interface. basically it implements what the vendor calls the Synchronous API onto the smartcard reader device. the way that it just… does that. slay. ✨

reading and writing are synchronous, which means a call to write(2) directly corresponds to a complete CCID command sent to the device, and then the following read(2) will return the complete answer from the reader. no half measures, no partial anything. 🫢

  • there is no support for partial reads or writes β€” full send or nothing, fr fr
  • there is no upper limit on CCID request or response sizes, but heads up: the complete CCID request must be sent to the driver in write(2), and the complete CCID response must fit into the buffer supplied to read(2)

Non-blocking I/O, select(2) and poll(2) are all supported and work as expected. and here's the little detail that matters: an open file descriptor will always be ready for writing, but it's only ready for reading if the device indicates that it has data available. vibe check passed. πŸ‘‘


πŸ“ FILES πŸ“

  • /dev/cmxn β€” character device special file. yes queen, that's your doorway in. 🌈
  • /usr/ports/security/openct β€” OpenCT, a userspace smartcard daemon containing a CCID driver which directly supports cmx devices. bestie in port form. πŸ’œ

πŸ¦‹ COMPATIBILITY πŸ¦‹

userland smartcard code written for the vendor's Linux drivers should work with the cmx driver without modification. no edits, no rewrites, no drama. it just works. iconic. ⭐


πŸ‘€ SEE ALSO πŸ‘€


πŸ“œ HISTORY πŸ“œ

the cmx driver first appeared in FreeBSD 7.1. a whole era. πŸ’–


πŸ‘‘ AUTHORS πŸ‘‘

the cmx driver was written by Daniel Roethlisberger <daniel@roe.ch>, originally based on the Linux driver v1.1.0 by Omnikey GmbH www.omnikey.com. early testing and bug fixes by Marcin Cieslak <saper@system.pl>. we love a collab. 🫢✨


πŸ’€ BUGS πŸ’€

ngl, the way the cmx driver talks to the CardMan 4040 is a bit rough. 😬 due to the complete lack of hardware documentation other than vendor drivers for other operating systems, the gory details of the device's I/O registers are not understood very well. so yeah β€” there may be error conditions which can only be solved by physically reinserting the reader. not me telling you to unplug it and plug it back in. but also yes, literally that. πŸ™ˆ


and that's the tea, bestie πŸ“ β€” this page came from the Debian side of the world, dated July 7, 2007, and it's the CMX(4) manual through and through. go forth and read smartcards. πŸ’…πŸ§šπŸ’œ

πŸ“¦ where this page comes from