compactflash.device V1.44 - PCMCIA CompactFlash driver for Amiga 600/1200. Fork of driver/media/CFD133.lha.
COMPONENTS IN THIS RELEASE
==========================
- compactflash.device 1.44 (04.06.2026) (new)
- ptable.library 1.1 (07.06.2026) (new)
- CFInfo 1.37 (11.01.2026)
- pcmciaspeed 1.36 (02.01.2026)
- pcmciacheck 1.39 (22.05.2026) (new)
CHANGES IN 09.06.2026
=====================
compactflash.device:
* Fixed a crash in the ROM-resident driver when running WHDLoad (Issue #56)
Programs that take over the machine flush idle libraries and devices to
free memory before they run. The idle ROM-resident compactflash.device
looked unused, got flushed, and that corrupted the program's memory setup,
causing a guru (`0x0100000F`, bad `FreeMem`). Mounting a CF card first
avoided it (the filesystem then held the device open), and so did WHDLoad's
`NoFlushMem` option. The driver now keeps itself in use.
* Non-IDE PCMCIA cards (e.g. ATAPI CD/DVD adapters) (issue #47) are now
released earlier in the identify process. Rejecting after IDENTIFY
is too late: the IDENTIFY attempt could leave the card in a state
where dedicated drivers (such as telmexatapi.device) could no
longer claim it. The CIS gate reintroduced checks for a well-formed
Disk Interface FUNCEXT declaring IDE before IDENTIFY runs, with up to
10 retries to tolerate unstable CIS reads.
Please report if you see any CF card detection regression.
* ATAPI handler is compiled out by default (no real-world user
found, untested; build with ATAPI=1 to keep it).
ptable.library:
* Duplicate RDB drive names are made unique at cold boot (Issue #57).
When two cards carry RDBs that reuse the same partition name (for
example both define DH0), the duplicates appeared together in the
early-startup boot menu. A clashing name now gets a numeric suffix
(DH0.1, DH0.2, ...).
* ptable.library now loads filesystem handlers stored in a compacted
format (RELOC32SHORT relocations).
* A partition with a damaged RDB entry is skipped instead of mounted.
If a card's RDB describes a partition with incomplete settings (a
DosEnvec shorter than the DOSTYPE field), it is now passed over at
cold boot rather than mounted with possibly wrong values.
* Filesystem handlers loaded from a card's RDB now appear in
FileSystem.resource under their own name instead of ptable.library.
pcmciacheck:
* New `pcmciacheck -cis` option prints a readable summary of the
identification data carried by the inserted PCMCIA card (manufacturer,
card type, version, etc.). Handy when you want to understand why an
unusual card is or isn't accepted by the driver, or when reporting a
problem card.
packaging:
* Archive version is now a date (YYYYMMDD). The release bundle ships
several independently-versioned pieces (compactflash.device,
ptable.library, CFInfo, pcmciaspeed, pcmciacheck), each on its own
cadence, so a single v1.x number for the whole archive never matched
what was actually inside.
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] ..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.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 20260609 - 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.44 (04.06.2026) (11428 bytes):
MD5: 9506608bfbfa948915f2ba526f8eedb7
SHA256: 623e0707a17e943b2a047c670ba2e8416a4fdf82cdc7a85e79c29ed6f22c2c94
small/68020/devs/compactflash.device 1.44 (04.06.2026) (8056 bytes):
MD5: 4fad88aceff0deb736efd9a7926eaa4e
SHA256: 2a5a9089d508b3287ca5e933c2905dc72aa9123f2f99355d116b579bda72523f
full/68000/devs/compactflash.device 1.44 (04.06.2026) (11564 bytes):
MD5: 3c5e883b995d594cb1f44929b5d8a95e
SHA256: 45e15b0a320af84b5fdc77e484bf9168f06068d098ff4995c23fcf14ba839d57
small/68000/devs/compactflash.device 1.44 (04.06.2026) (8192 bytes):
MD5: 2c3550275a6269d47eadeb34c1bce51d
SHA256: 98909c388b7451f7d9a635c7999c858f57bb7b6fd7bf505106676a1184b3674f
full/68020/libs/ptable.library 1.1 (07.06.2026) (4344 bytes):
MD5: 22e7578318b2464be6d71a5b93f70a37
SHA256: 15e05937eea7318267c041a1278848f85b58bfa26ffe2db6ac96ae4c71523f56
small/68020/libs/ptable.library 1.1 (07.06.2026) (3584 bytes):
MD5: 25d6753244900b78fe4ec195581148e7
SHA256: d35ba88ead6b748a07f309cc8aa01efa6eea42c3e3d2654426f7259f859f6ed2
full/68000/libs/ptable.library 1.1 (07.06.2026) (4348 bytes):
MD5: 80ff838c5a9561a8f43f473d92bddafc
SHA256: 1b7428b0afb6f192cda03f4fba0b4bb4fb28c76f57c204bb5322fb427b640a3b
small/68000/libs/ptable.library 1.1 (07.06.2026) (3584 bytes):
MD5: 7e011d935e6be45f1a670d9d2ddbffd6
SHA256: ff5c7c869f3876cff810581fcb0efef1a90fb8a6b5171449e1b87427a361f283
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.39 (22.05.2026) (19340 bytes):
MD5: 6ae56a9473d58ec8e2ef3115c06018e5
SHA256: 3a612d559fd8257afc4f4b401bfb555388da0aab9de0ee08db4d86e5702d6e7d
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
|