Short: PCMCIA CompactFlash driver Author: jaroslav.pulchart@gmail.com (Jaroslav Pulchart), based on work by Torsten Jager and Paul Carter Uploader: jaroslav pulchart gmail com (Jaroslav Pulchart) Type: driver/media Version: 20261127 Replaces: driver/media/cfd.v20261115.lha Requires: AmigaOS 2.0+, PCMCIA slot, CF-to-PCMCIA or SD-to-CF adapter Architecture: m68k-amigaos Kurz: PCMCIA CompactFlash-Treiber A600/1200 PCMCIA CompactFlash driver and supporting tools for Amiga 600/1200. Fork of driver/media/CFD133.lha. COMPONENTS IN THIS RELEASE ========================== - compactflash.device 3.0 (27.11.2026) (new) - compactflash.automount 2.1 (27.11.2026) (new) - ptable.library 3.0 (27.11.2026) (new) - CFInfo 1.40 (03.10.2026) - pcmciaspeed 1.37 (03.10.2026) - pcmciacheck 2.3 (27.11.2026) (new) - lsptres 1.3 (15.11.2026) WHAT'S NEW (27.11.2026) ======================= * Version 1.34 fixed newer cards that were not identified, but why the fix worked stayed a mystery for more than a year. It turned out to work only by a side effect, and a correct fix replaces it now. * The same fix also covers SD-to-CF adapters, so the workaround that 1.33 added for them is gone. * Improved AROS and ApolloOS support. compactflash.device no longer hangs when it is first opened, compactflash.device and compactflash.automount no longer crash with the full build, and inserting a card no longer freezes the system. * When a card's CIS cannot be read right after a reset, compactflash.device reads it again for up to a second instead of releasing the card at once. * Install sets the execute bit on the files it copies. * pcmciacheck 2.3: -identify judges the card by read mode 0, the only mode compactflash.device reads IDENTIFY in. Build and tests: * Improved build. Every change is built and packaged automatically, the same way on every machine, and the release archive comes from that build. * Much improved testing with new integration tests in FS-UAE and an emulated PCMCIA card. They insert, swap and pull out cards, even in the middle of a write, and run automatically on AROS and ApolloOS, and locally also on AmigaOS 3.1 and 3.2.3. See https://github.com/pulchart/cfd/tree/master/tests/integration FEATURES ======== * Supports CompactFlash, MicroDrive, and various adapters (SD, MemoryStick, SmartMedia) * TD64 and SCSI emulation support * Works with fat95 filesystem for FAT32 support, not excluding Amiga native (ffs, sfs, pfs) filesystems * Scans and automounts RDB, MBR, GPT and whole cards without a partition table via ptable.library * Serial debug output for troubleshooting (Flags = 8) * Transfer speeds up to 2.2 MB/s read, 1.9 MB/s write (in multi-sector mode if firmware supports it or with Flags = 16 override) REQUIREMENTS ============ * Amiga 600 or 1200 with PCMCIA slot (A1200 tested) * AmigaOS 2.0 or higher * "CompactFlash to PCMCIA/ATA" adapter card (see images/cf-type-1.jpg, images/cf-type-2.jpg) or SD-to-CF adapter (see images/sd-cf-adapter.jpg) * fat95 filesystem (disk/misc/fat95.lha) recommended * Installer 43.3 or newer for Install (without it, install by hand) INSTALLATION ============ * Double-click Install. It detects the CPU, copies compactflash.device to DEVS: and ptable.library and compactflash.automount to LIBS: (small variant, full in Expert mode), and offers the tools, the CF0 mountlist, the CF0 disk icon and the example cfd.prefs. fat95 is installed separately. In Expert mode it also adds a LoadModule line at the top of S:User-Startup. cfd and fat95 share one LoadModule line. Adapt that line to your system as needed. I recommend putting compactflash.device, compactflash.automount and ptable.library in ROM as resident modules instead of LoadModule. * Double-click Setup to configure the automount feature. It writes ENVARC:cfd.prefs and, if wanted, ENV:cfd.prefs, and sets the handler for DOS/FFS, SFS, PFS and FAT partitions. In Expert mode it also asks for the handler stack and priority, sets the driver flags (FLAGS) and can allow mounting a partition that is already mounted. By hand: 1. Copy the contents of // to SYS: (devs/ to DEVS:, libs/ to LIBS:). - 68020/ for 68020 or higher, 68000/ for 68000/68010 - full (serial debug output, Flags = 8), small (no debug code) 2. Copy c/CFInfo to C: (optional). 3. Install fat95. 4. Optional: copy ENVARC/cfd.prefs to ENVARC: and ENV:. Automount is on by default, see automount.guide for all keys. 5. OS 3.5+: copy def_CF0.info to ENVARC:Sys and ENV:Sys. 6. Without automount, mount with Storage/DOSDrivers/CF0. For autoboot, see AUTOBOOT/AUTOMOUNT below. AUTOBOOT/AUTOMOUNT ================== Boot/automount is provided by ptable.library plus the optional compactflash.automount module (both shipped under //libs/). The plain compactflash.device on its own is a normal mount-only device. compactflash.automount carries two parts: - cold-boot autoboot: at Kickstart cold start it walks the RDB on the card, loads filesystem handlers into FileSystem.resource, and publishes each partition via AddBootNode (bootable) / AddDosNode. This needs compactflash.device + compactflash.automount + ptable.library ROM-resident; a disk-only install is silently ignored. - after-DOS bringup: it opens the device once DOS is up so the card-detect interrupt and the automount agent start. Automount is ON by default everywhere. Disable it with AUTOMOUNT 0 in ENV:cfd.prefs (copy ENVARC/cfd.prefs as shown in INSTALLATION). On removal all supported filesystems are fully unmounted by default; UNMOUNT restricts this, UNMOUNT NONE keeps the handlers. The resident driver re-reads cfd.prefs on every card insert and removal. On disk (no ROM), you get the same run-time automount (hot-swap) by adding to your user-startup-sequence: LoadModule LIBS:compactflash.automount LIBS:ptable.library DEVS:compactflash.device (plus L:fat95). LoadModule cannot provide cold-boot autoboot; that needs a real ROM. The per-filesystem config keys (UNMOUNT and the keys FLAGS, CONTROL, HANDLER, DOSTYPE, FORCE, STACK, PRI) accept only DOS, FFS, SFS, PFS and FAT. Any other name is silently ignored. FAT partitions need fat95 resident, or HANDLER_FAT L:fat95 in cfd.prefs. At cold boot an empty slot is detected by a single Gayle read and costs nothing; with a card present the boot stub polls up to 5 s for a slow one. More details are in automount.guide. MOUNT FLAGS =========== Set in CF0 mountlist (can be combined, e.g. Flags = 24 for debug + enforce): Flags = 0 /* default */ Flags = 1 /* "cfd first" hack for PCMCIA conflicts with other drivers */ Flags = 2 /* unused - was "skip invalid PCMCIA signature" (v1.37+) */ Flags = 4 /* use CardResource API instead of direct chipset access */ Flags = 8 /* output init messages to serial port at 9600 baud (v1.35+ full build) */ Flags = 16 /* force 256 sector transfers regardless of card capability (v1.35+) */ Flags = 32 /* skip multi-sector override auto-detection, use firmware value (v1.37+) */ SERIAL DEBUG EXAMPLE ==================== With Flags = 8, connect serial cable and monitor at 9600 baud. The first line is a version banner that identifies the driver version and CPU tier ([68020] or [68000]): [CFD] compactflash.device 2.2 (15.11.2026) [68020] [CFD] Card inserted [CFD] Identifying card... [CFD] Reset [CFD] Configuring HBA [CFD] ..done [CFD] Setting voltage [CFD] Voltage: 5V [CFD] CIS gate [CFD] ..DEVICE: type=0x0D speed=720ns size=0x00000000 [CFD] ..FUNCEXT: link=0x02, type=0x01, ifc=0x01 [CFD] ..RESULT: accept [CFD] ..CONFIG: addr=0x00000200 (or: [CFD] ..CONFIG: default (0x200)) [CFD] RW test [CFD] ..done, transfer mode: WORD [CFD] Getting IDE ID ... done (ATA) Model: TS4GCF133............................... Serial: G68120052383AC0700C7 FW: 20110407 Max Multi (W47): 8001 Capabilities (W49): 0200 Multi Setting (W59): 0100 LBA Sectors (W60-61): 00777E70 DMA Modes (W63): 0000 PIO Modes (W64): 0003 UDMA Modes (W88): 0000 [CFD] IDENTIFY (raw): W0: 848A 1E59 0000 0010 0000 0240 003F 0077 W8: 7E70 0000 4736 3831 3230 3035 3233 3833 W16: 4143 3037 3030 4337 0002 0002 0004 3230 W24: 3131 3034 3037 5453 3447 4346 3133 3320 W32: 2020 2020 2020 2020 2020 2020 2020 2020 W40: 2020 2020 2020 2020 2020 2020 2020 8001 ... W248: 0000 0000 0000 0000 0000 0000 0000 0000 [CFD] Init multi mode [CFD] ..max multi: 1 [CFD] ..set multi: 1, OK [CFD] ..override test: OK [CFD] ..done, multi RW: 256 [CFD] Card identified OK [CFD] Notify clients [CFD] Card removed Serial debug output at cold boot comes from a full build only and is unconditional, not gated by the mountlist Flags=8 setting. Two components emit output: compactflash.automount uses the [CFD] boot: prefix, and ptable.library uses [PT]. Note that ptable.library opens the device with Flags=0, so the per-card identify log ([CFD] Reset, [CFD] CIS gate, etc.) is not printed during autoboot. [CFD] boot: open ptable.library ... [CFD] boot: ptable.library not preloaded, InitResident()... [CFD] boot: BootScanPartitions(compactflash.device,0) [PT] cold boot: scanning for partitions [PT] whole medium, no partition table [PT] cold boot done, partitions registered: 0 ENFORCE MULTI MODE (FLAG 16) ============================ Forces 256 sector reads/writes per IO regardless of card firmware support to improve IO performance. Same behaviour as v1.33 and earlier versions. WARNING: Verify your card is capable before using for real data! Set the flag and read any text file from CF card. The content should not contain repeating 32-byte pattern after first 512 bytes. See images/multimode-issue.jpg for example of broken output. NOTE: Since v1.37, the driver auto-detects multi-sector override capability and enables 256 sector mode when safe. This flag is now only needed as a manual override if auto-detection fails. Can be combined with MaxTransfer to limit sectors per IO: Flags = 16 MaxTransfer = 0x10000 /* 128 sectors per IO (64 KB) */ Tested configurations (author's experience - your results may vary): SD-to-CF adapter (SanDisk) 32GB - Works SD-to-CF adapter (Samsung) 32GB, 64GB - Works CF cards <=4GB - Works CF cards >4GB - Not working CFINFO UTILITY ============== CFInfo displays detailed information about the inserted CF card. Requires compactflash.device v1.36+ for IDENTIFY data, v1.37+ for driver config. CFInfo ; Show info for compactflash.device unit 0 CFInfo 1 ; Show info for unit 1 Example output: CFInfo 20261127 - CompactFlash Card Information Device: compactflash.device unit 0 === CompactFlash Card Information === Model: TS16GCF133 Serial: G64126022013C4120210 Firmware: 20180926 === Capacity === Size: 15.2 GB (31522736 sectors) Geometry: 30401 cyl, 16 heads, 63 sectors/track === Capabilities === LBA: Yes DMA: No PIO Modes: 0, 1, 2, 3, 4 Multi-sect: Max 1 sectors/interrupt === Card Type === Removable: Yes Type: CompactFlash === Driver Configuration === Driver Ver: 1.37 Mount Flags: 0 (none) Multi-sect: FW=1, Used=256 R/W Mode: WORD/WORD R/W Mode indicates how the driver accesses the PCMCIA: WORD 16-bit word access (standard) BYTE (...) 8-bit byte access variants (fallback) MMAP Memory mapped word access SOURCE CODE =========== Source code available at: https://github.com/pulchart/cfd Licensed under GNU LGPL v2.1 SUPPORT ======= The improvements to this driver are developed in my free time. If you'd like to support ongoing maintenance and experimentation, you can do so on Ko-fi: https://ko-fi.com/jaroslavpulchart HISTORY ======= See docs/changes.guide for release notes and original CFD history. Online version: https://github.com/pulchart/cfd/blob/master/docs/changes.md CHECKSUMS ========= full/68020/devs/compactflash.device 3.0 (27.11.2026) (15040 bytes): MD5: 48762ec222f7705ece2ba25dea3f4709 SHA256: 8b133ce68544e46d21b2f5702a99547fa6892791f5db986f74fa56364a1c5909 small/68020/devs/compactflash.device 3.0 (27.11.2026) (11092 bytes): MD5: 8e6632cd36aeba6c6e84673f36c1622b SHA256: eae7e38abb61bd4958d0d08685532687db191bbb5184e1218b98bcd6b08d3c1a full/68000/devs/compactflash.device 3.0 (27.11.2026) (15164 bytes): MD5: acbeefd0cab990a3a463d62401189399 SHA256: 2d969b01cddfa1990cf75e9b174db4464d2baace546dd4c2ac02d4a2899078b5 small/68000/devs/compactflash.device 3.0 (27.11.2026) (11212 bytes): MD5: e250478ca00d9d7981717038839a4ce2 SHA256: 76c8c4e611afb832be9bcaa2d4e00159e834d7744a854d7f0f11736514834b73 full/68020/libs/compactflash.automount 2.1 (27.11.2026) (1064 bytes): MD5: bd452398b797494f7004016778b381e4 SHA256: 0c993a67bffc76a0d95af951e05ca4ee1f67c03115e075faad5580a26391c8bc small/68020/libs/compactflash.automount 2.1 (27.11.2026) (628 bytes): MD5: 48a988940d42cef9042c2e5ff2bfec04 SHA256: ab0ec9db7b6de2521cb2130e4bb79331e155973159af829d5ad4dcca830246cd full/68000/libs/compactflash.automount 2.1 (27.11.2026) (1064 bytes): MD5: bd452398b797494f7004016778b381e4 SHA256: 0c993a67bffc76a0d95af951e05ca4ee1f67c03115e075faad5580a26391c8bc small/68000/libs/compactflash.automount 2.1 (27.11.2026) (628 bytes): MD5: 48a988940d42cef9042c2e5ff2bfec04 SHA256: ab0ec9db7b6de2521cb2130e4bb79331e155973159af829d5ad4dcca830246cd full/68020/libs/ptable.library 3.0 (27.11.2026) (13296 bytes): MD5: db9e3ca0c2fcbd361f1482c9f130729d SHA256: 4bab838d6a4f853d1ab1f95a87ccfe63ae65daf6ecc9443ba60c1a85bc191b82 small/68020/libs/ptable.library 3.0 (27.11.2026) (11132 bytes): MD5: 90b6ba2a83c1171d8f62b315a9260e9b SHA256: 5e9b24b4ac10b69994a2d199201f01e22183df09296935d92e638f3878bebfd7 full/68000/libs/ptable.library 3.0 (27.11.2026) (13392 bytes): MD5: a97baff1edb525bc66a407d6dacbbfa3 SHA256: 072bca188f1b0561471d38987d3966bb98160c22c16eccc005999240776da2af small/68000/libs/ptable.library 3.0 (27.11.2026) (11224 bytes): MD5: 4ec3250b619a54aaf84c781d9ba204f8 SHA256: f32279216691099bf03ec52d22c4683536ab8bdae99ddad4878f04f71def0fc3 CFInfo 1.40 (03.10.2026) (18452 bytes): MD5: 560cb9d6f14e25b590cd995a49cb8f45 SHA256: dfbe1fd89ded41ce50be4186cfc9eb6c5be8c1d89bcf806f95a4d7c2ec403696 pcmciaspeed 1.37 (03.10.2026) (9248 bytes): MD5: 751a7ed043039b6cf69b034606c2c6b4 SHA256: 9a7496aa443a95a52f0c907fc9d01e443d9800dfc2bb317ee9a97356d2954940 pcmciacheck 2.3 (27.11.2026) (34304 bytes): MD5: cfb90e308880ae8168fc5e8f3293c2f6 SHA256: 5878b449879e04e5391ced577b1b0ecc1cf3f170db99e992c7465cd658f1db5c lsptres 1.3 (15.11.2026) (14352 bytes): MD5: 3e4072af6d903718a33f7d7e9264d004 SHA256: 8817f35993d2821e4ea01ad46cb13fe1ba61230099b6e1f5320f562abbc132ed CONTENTS ======== cfd/Install - Installer script cfd/Setup - Installer script: write cfd.prefs cfd/full// - per-CPU "full" sysroot (debug-capable device + library) cfd/small// - per-CPU "small" sysroot (no debug code/strings) compactflash.device block device driver for PCMCIA CF cards: cfd/full/68020/devs/compactflash.device - 68020+, debug-capable (serial output with Flags=8) cfd/small/68020/devs/compactflash.device - 68020+, no debug code cfd/full/68000/devs/compactflash.device - 68000+, debug-capable (serial output with Flags=8) cfd/small/68000/devs/compactflash.device - 68000+, no debug code ptable.library (required) - partition scanner/automounter (RDB/MBR/GPT/whole card): cfd/full/68020/libs/ptable.library - 68020+, debug-capable (serial output always on at boot) cfd/small/68020/libs/ptable.library - 68020+, no debug code cfd/full/68000/libs/ptable.library - 68000+, debug-capable (serial output always on at boot) cfd/small/68000/libs/ptable.library - 68000+, no debug code compactflash.automount (optional) - boot/automount bringup; install for autoboot (ROM) or DOS-time automount (ROM, or on disk via LoadModule): cfd/full/68020/libs/compactflash.automount - debug-capable (serial output always on at boot) cfd/small/68020/libs/compactflash.automount - no debug code cfd/full/68000/libs/compactflash.automount - debug-capable (serial output always on at boot) cfd/small/68000/libs/compactflash.automount - no debug code cfd/c/CFInfo - Card information utility (displays model, size, capabilities) cfd/c/pcmciacheck - PCMCIA check utility cfd/c/pcmciaspeed - Speed test utility cfd/c/lsptres - partition.resource entry lister (from ptable.library) cfd/Storage/DOSDrivers/CF0 - Mountlist entry (with flags documentation) cfd/Storage/DOSDrivers/CF0.info - Mountlist Workbench icon cfd/ENVARC/cfd.prefs - Example config (copy to ENVARC:cfd.prefs to automount) cfd/docs/cfd.guide - Main documentation cfd/docs/automount.guide - Autoboot, automount, and ENV:cfd.prefs configuration cfd/docs/automount-review.guide - Automount feature review (expected behaviour) cfd/docs/changes.guide - Release notes and original CFD history cfd/docs/CFInfo.guide - CFInfo utility documentation cfd/docs/lsptres.guide - lsptres utility documentation cfd/docs/pcmciacheck.guide - pcmciacheck utility documentation cfd/docs/pcmciaspeed.guide - pcmciaspeed utility documentation cfd/src/ - Full source code cfd/images/cf-type-1.jpg - CF Type 1 adapter photo cfd/images/cf-type-2.jpg - CF Type 2 adapter photo (also MicroDrive) cfd/images/sd-cf-adapter.jpg - SD-to-CF adapter photo cfd/images/multimode-issue.jpg - Example of broken output with unsupported enforce multi mode cfd/LICENSE - GNU LGPL v2.1 "CompactFlash" is (TM) by CompactFlash Association