compactflash.device V1.37 - PCMCIA CompactFlash driver for Amiga 600/1200. Fork of driver/media/CFD133.lha.
CHANGES IN 1.37 (17.01.2026)
============================
Driver:
* Improved card detection reliability
- Fixes unreliable CopyTuple CIS reads by using the card's ATA IDENTIFY
data instead. Seen with Transcend CF 133 4GB (Firmware 20110407) and ACA1234
- The config address is still read from the card CIS when available,
with an automatic fallback to the standard address.
- `Flags = 2` is deprecated (the fallback is now automatic).
* Autodetect multi-sector override capability
- Driver estimates by simple test if multi-sector override works
- If test passes, 256 sector mode auto-enabled for best performance
- If test fails, falls back to firmware-reported value
- Flags = 16 still available as manual override to force 256
- Flags = 32 skips auto-detection, uses firmware value directly
* CFD_GETCONFIG command (0xED) to retrieve driver internal configuration
Tools:
* CFInfo shows driver configuration (flags, multi-sector, transfer modes)
* pcmciacheck tests all 5 transfer modes including memory-mapped (mode 4)
Others:
* Typo fixes throughout documentation
FEATURES
========
* Supports CompactFlash, MicroDrive, and various adapters (SD, MemoryStick, SmartMedia)
* TD64 and SCSI emulation support
* Works with fat95 filesystem for FAT32 support
* 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 (3.2.3 tested)
* "CompactFlash to PCMCIA/ATA" adapter card (see images/cf-pcmcia-adapter.jpg)
or SD-to-CF adapter (see images/sd-cf-adapter.jpg)
* fat95 filesystem (disk/misc/fat95.lha) recommended
INSTALLATION
============
Two versions of the driver are included:
compactflash.device 10796 bytes Driver with debug to serial console flag support
compactflash.device.small 8348 bytes Driver without debug to serial console support
Choose based on your needs:
- Use the full version if you need serial debug output (Flags = 8)
- Use small for minimal memory footprint (rename to compactflash.device)
Steps:
1. Copy devs/compactflash.device to DEVS:
(or copy compactflash.device.small as DEVS:compactflash.device)
2. Copy c/CFInfo to C: (optional, card info utility)
3. Have fat95 installed on your system
4. Mount the drive by double-clicking devs/CF0
For OS 3.5+:
Copy def_CF0.info to sys:prefs/env-archive/sys and env:sys
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:
[CFD] Card inserted
[CFD] Identifying card...
[CFD] Reset
[CFD] Configuring HBA
[CFD] ..done
[CFD] Setting voltage
[CFD] Voltage: 5V
[CFD] Reading tuples
[CFD] Tuple CISTPL_CONFIG found
(or: [CFD] CISTPL_CONFIG not available, using standard 0x200)
[CFD] RW test
[CFD] ..done
[CFD] Transfer: WORD
[CFD] Getting IDE ID
[CFD] ..done
[CFD] Model: TS4GCF133...............................
[CFD] Serial: G68120052383AC0700C7
[CFD] FW: 20110407
[CFD] IDENTIFY:
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] ..card supports max multi: 1
[CFD] ..setting multi mode to: 1
[CFD] ..OK
[CFD] ..testing multi-sector capability...
[CFD] ..DRQ issue not detected
[CFD] ..auto-enabling 256 sector mode
[CFD] ..multi-sector RW size: 256
[CFD] ..done
[CFD] Card identified OK
[CFD] Notify clients
[CFD] Card removed
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 1.37 - 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 https://github.com/pulchart/cfd/blob/master/README.md for complete history
CHECKSUMS
=========
compactflash.device (full, 10796 bytes):
MD5: 369dbfb0123a490d95a26bf721858fbd
SHA256: a440eb4bb548847bd0299f930c9cd6e748be486897e8ffbfe18a16ca98e84d2c
compactflash.device.small (no debug, 8348 bytes):
MD5: 94212a616580925f8305c793e74df79e
SHA256: bc5390779dbdb47ca5f241de5cd49d66b1b6f8a5f905f304b7ecdeb6b227c0e3
CFInfo (15564 bytes):
MD5: 40f7c1221f3a3a2466e31818d3f9f9ea
SHA256: 036f51b0b4310ba43a60db62decb035afabd917aed954500677bb0f45ec5ac49
pcmciacheck (14236 bytes):
MD5: bbcb2fdb34a45528d586ded5a3bf9110
SHA256: ec27d007f04f5c65be8dc85752540cc73e30d1b6f920eb99b215d7a32a2b7729
pcmciaspeed (9264 bytes):
MD5: 47212b103dd94ffa3116ef07b3a4cdef
SHA256: 32ea11e0f4d1587fbc85587a39bee21c66abc62a33e301651eed585535c88610
CONTENTS
========
cfd/c/CFInfo - Card information utility (displays model, size, capabilities)
cfd/c/pcmciacheck - PCMCIA check utility
cfd/c/pcmciaspeed - Speed test utility
cfd/devs/CF0 - Mountlist entry (with flags documentation)
cfd/devs/compactflash.device - Driver with debug to serial console flag support
cfd/devs/compactflash.device.small - Driver without debug to serial console support
cfd/docs/cfd.guide - Main documentation (AmigaGuide)
cfd/docs/CFInfo.guide - CFInfo utility documentation (AmigaGuide)
cfd/docs/pcmciacheck.guide - pcmciacheck utility documentation (AmigaGuide)
cfd/docs/pcmciaspeed.guide - pcmciaspeed utility documentation (AmigaGuide)
cfd/src/ - Full source code (assembler + C)
cfd/images/cf-pcmcia-adapter.jpg - CF-to-PCMCIA adapter photo
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
|