compactflash.device V1.42 - PCMCIA CompactFlash driver for Amiga 600/1200. Fork of driver/media/CFD133.lha.
CHANGES IN 1.42 (16.05.2026)
============================
compactflash.device:
* Autoboot from RDB at cold-boot:
a bootable RDB partition on the inserted card boots straight into Workbench.
All RDB partitions appear at cold start without `DEVS:DOSDrivers/` entries.
Filesystem handlers stored on the card are loaded automatically.
Requires `ptable.library` to be ROM-resident; disk-only install is
mountable-only without it.
* Stricter CIS gate:
as the CIS detection code improved over time, the fallback that accepted
cards without a readable `CISTPL_FUNCID` was dropped. Such cards now fail
the CIS gate, freeing them for their proper driver.
Others:
* Release archive version and compactflash.device version are now tracked independently
* New distribution layout: two build flavors per CPU tier are stored in dedicated folders:
cfd/full/<cpu>/ - debug-capable (serial output enabled with Flags=8)
cfd/small/<cpu>/ - no debug code
where <cpu> is 68000 (any 68k) or 68020 (68020+)
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
* 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-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
INSTALLATION
============
The archive ships two flavours (full / small) and two CPU tiers,
each as a sysroot ready to drop onto SYS:.
68020+ (A1200 stock, 68020+):
full/68020/devs/compactflash.device debug-capable
small/68020/devs/compactflash.device no debug code
full/68020/libs/ptable.library debug-capable
small/68020/libs/ptable.library no debug code
68000 (stock A600, 68000+):
full/68000/devs/compactflash.device debug-capable
small/68000/devs/compactflash.device no debug code
full/68000/libs/ptable.library debug-capable
small/68000/libs/ptable.library no debug code
Choose based on your needs:
- Use the full flavour if you need serial debug output (Flags = 8)
- Use small for minimal memory footprint (no debug strings/code)
Steps for normal mount-only use (no autoboot):
1. Drag the contents of <flavor>/<cpu>/ onto SYS: the inner devs/
and libs/ drawers map onto SYS:Devs/ and SYS:Libs/ directly.
- A1200 (68020+): full/68020/ (or small/68020/)
- A600 (68000+): full/68000/ (or small/68000/)
2. Copy c/CFInfo to C: (optional, card info utility)
3. Have fat95 installed on your system
4. Mount the drive by double-clicking Storage/DOSDrivers/CF0
For autoboot, see the AUTOBOOT section below.
For OS 3.5+:
Copy def_CF0.info to sys:prefs/env-archive/sys and env:sys
AUTOBOOT/AUTOMOUNT
==================
Autoboot is now provided by a separate ptable.library shipped under
<flavor>/<cpu>/libs/. At Kickstart cold start the compactflash.device
opens ptable.library and asks it to walk the RDB on the inserted card,
load any filesystem handlers carried in into FileSystem.resource,
and publish each partition via AddBootNode (bootable) or AddDosNode
(non-bootable).
Both the compactflash.device and the ptable.library MUST be ROM-resident
for this to work. A disk-only ptable.library install is silently ignored.
The device driver still works as a normal mount-only device.
On cold boot the driver tolerates slow cards and adapters by polling
for up to ~1.8s. When a card is present and stable the delay is zero.
More details can be found in fat95's guide and GitHub project page.
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 1.42 (03.05.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] ..FUNCID: 0x04
[CFD] ..RESULT: accept
[CFD] ..CONFIG: addr=0x00000200
(or: [CFD] ..CONFIG: default (0x200))
[CFD] RW test
[CFD] ..done, transfer mode: WORD
[CFD] Getting IDE ID
[CFD] ..done
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.device uses the [CFD] boot: prefix, and ptable.library uses [RDB].
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: BootScanRDB(compactflash.device,0)
[RDB] scan
[RDB] no RDB
[RDB] done
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.42 - 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
=========
full/68020/devs/compactflash.device 1.42 (16.05.2026) (12068 bytes):
MD5: b28d64ea0e38373f3e0a6d8f6e0d8a06
SHA256: 0d08cebb4e010ecbd5a5ed30cb6750185e897e42400eed680717b3568f8da21f
small/68020/devs/compactflash.device 1.42 (16.05.2026) (8916 bytes):
MD5: 37fe6d2669a34cc7946d606c5c57dac1
SHA256: f0f263c255a4f6de8cbb161797a9ee3c78c65d5e2f55747f82ab679657740e96
full/68000/devs/compactflash.device 1.42 (16.05.2026) (12204 bytes):
MD5: 752f61acaf854a0121cb40ec7ca81829
SHA256: d983d3bd75067adcfddee2263e49ce0be64e88fe892f341dab094ddee1cff441
small/68000/devs/compactflash.device 1.42 (16.05.2026) (9052 bytes):
MD5: 8a0960536cde85a8a679aadcb42692ce
SHA256: bc75d361beb2a9359ae001eeff7195d420fbcacd1bb79c6d808eaf787f6a06b5
full/68020/libs/ptable.library 1.0 (16.05.2026) (3712 bytes):
MD5: 3294f304a03f232becf2fb20aaafe937
SHA256: 098bca9d1c4decfe45d446c703ca8cac117ce53da0598b9974be457f382c7021
small/68020/libs/ptable.library 1.0 (16.05.2026) (3008 bytes):
MD5: 2f33966011227a286d73fe090678843d
SHA256: 0ed35576239db060d3a28674db164ab9efc7ed5ba6ce5e142d395a9d2e0fa748
full/68000/libs/ptable.library 1.0 (16.05.2026) (3712 bytes):
MD5: 89352a130a34644b8da2fcc04a3c98aa
SHA256: 1a256f004d6b455ae469dec38eb592014aa5781ac80296c126744b98ccfd1a5f
small/68000/libs/ptable.library 1.0 (16.05.2026) (3008 bytes):
MD5: 12514a4eab6a4f0f97fdf1871cd14b65
SHA256: 62841eebb388118c9827fe7d834929c4e912c97df3d2672e8fd3636e6af891dd
CFInfo 1.37 (11.01.2026) (15564 bytes):
MD5: 40f7c1221f3a3a2466e31818d3f9f9ea
SHA256: 036f51b0b4310ba43a60db62decb035afabd917aed954500677bb0f45ec5ac49
pcmciaspeed 1.36 (02.01.2026) (9264 bytes):
MD5: 47212b103dd94ffa3116ef07b3a4cdef
SHA256: 32ea11e0f4d1587fbc85587a39bee21c66abc62a33e301651eed585535c88610
pcmciacheck 1.38 (22.01.2026) (14144 bytes):
MD5: 27ea335a8606c8d49c5301423f60329b
SHA256: f583ed64aa20c439ea45460bef2baaf10357ae56b6aa1abaeb191b49b33b9c8a
CONTENTS
========
cfd/full/<cpu>/ - per-CPU "full" sysroot (debug-capable device + library)
cfd/small/<cpu>/ - 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 (optional) enables autoboot and automount from RDB-partitioned cards;
must be ROM-resident to work, disk-only install has no effect:
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
cfd/c/CFInfo - Card information utility (displays model, size, capabilities)
cfd/c/pcmciacheck - PCMCIA check utility
cfd/c/pcmciaspeed - Speed test utility
cfd/Storage/DOSDrivers/CF0 - Mountlist entry (with flags documentation)
cfd/Storage/DOSDrivers/CF0.info - Mountlist Workbench icon
cfd/docs/cfd.guide - Main documentation
cfd/docs/CFInfo.guide - CFInfo 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
|