- How to Use This Driver
- Architectural Overview
- Configuration and Debugging
- Advanced ROM Customization
- Internals
- Contributing and Support
This package contains the open-source firmware for the (Re)A4091 Zorro III Advanced SCSI-2 disk controller. This includes the AmigaOS device driver, the AutoConfig™ ROM, a command-line test utility, and a driver debug tool.
This section provides instructions for users who want to build and install the A4091 driver.
Pre-built releases of the driver, ROM images, and tools are available from the project's GitHub page: https://github.com/A4091/a4091-software/releases
Building the software is a straightforward process. You will need a modern m68k-amigaos-gcc cross-compiler toolchain, such as Bebbo's amiga-gcc.
Compile the Software
Simply run the make command from the root of the repository:
makeThe build process is fully automated. The first time you run make, it will automatically download and initialize the necessary code libraries (git submodules) before compiling the project.
To see the full compiler output, which can be useful for troubleshooting, run make verbose.
This will produce several files:
| File | Description |
|---|---|
a4091.device |
The AmigaOS device driver, which can be loaded from disk. |
a4091.rom |
The AutoConfig™ ROM image to be written to an EPROM or EEPROM. This includes the driver. |
a4091_cdfs.rom |
A ROM image with added CD-ROM boot support. |
a4091_nodriver.rom |
A ROM image without the driver, useful for diagnostics or loading the driver from disk. |
ncr7xx |
A command-line utility to probe and test NCR53C7xx-based SCSI cards. |
a4091d |
A debugging tool to inspect the internal state of the running driver. |
Creating a Floppy Disk Image
An Amiga Disk File (ADF) containing the driver and tools can be created from the disk directory:
cd disk
makeThis will generate a bootable .adf file that can be written to a floppy disk. It contains some documentation and tools useful for your A4091.
The tools and libraries on the disk are packed with L-Packer to save space; they unpack themselves when loaded. The disk build compiles L-Packer for the host from 3rdparty/L-Packer, which needs CMake and a C/C++ compiler. The driver itself is not packed, and the LHA release archive keeps the original, unpacked files.
The A4091 floppy disk is bootable and contains several useful tools and documentation:
| File | Description |
|---|---|
A4091.guide |
Comprehensive AmigaGuide documentation covering installation, configuration, and usage |
a4091.device |
The AmigaOS device driver that can be loaded from disk if not using ROM version |
ncr7xx |
Command-line utility for testing and diagnosing NCR53C7xx-based hardware |
a4091d |
Debug tool to inspect the internal state of the running a4091.device driver |
devtest |
Storage device benchmark and testing tool for any Amiga device |
rdb |
Utility for modifying Rigid Disk Block (RDB) settings on hard drives |
RDBFlags |
Tool to easily toggle the LastDisk flag in the RDB |
scsifix |
Tool to redirect 2nd.scsi.device calls to a4091.device for compatibility |
The disk boots automatically and displays a welcome screen with available tools. All utilities can be run from the shell and include built-in help via the -h or ? options.
The A4091 ROM can be written to a 32KB or 64KB EPROM or EEPROM. For the ReA4091, a Winbond W27C512 EEPROM is recommended. The 64KB size allows for the inclusion of a CDFileSystem for CD-ROM booting.
Use a standard EPROM programmer to write the .rom file to the chip.
The A4092 and A4770 keep their ROM in a 512KB SPI flash and are updated in
the machine with a4092flash. Their ROM images are 384KB: the ROM region
covers the flash below the OEM boot image, NVRAM and manufacturing data. The
floppy carries them ZX0 compressed (ROMs/a4092_cdfs.rom.zx0), and
a4092flash unpacks them while loading. It still accepts 32KB and 64KB
images.
The A4091 firmware is a sophisticated piece of software designed to bridge the Amiga's operating system with the SCSI hardware. It involves a multi-stage process that begins at the earliest stages of the Amiga's boot sequence.
The journey begins with rom.S, a critical piece of assembly code that lives in the A4091's EEPROM. This file serves two primary purposes:
- AutoConfig™ Data: It contains the necessary identification data that AmigaOS uses to recognize the A4091 card on the Zorro III bus during the initial boot-up. This allows the system to "autoconfigure" the card and make it available.
- Driver Loading: Because the Amiga 3000 and 4000 read from the Zorro III ROM in nibbles (4-bit chunks), it's not possible to execute code directly from the EEPROM. Instead,
rom.Sacts as a bootloader. It finds the main driver (a4091.device), which is also stored in the ROM, and copies it into the Amiga's main RAM.
This loading process involves two key components, also written in assembly:
- Relocator: Once in RAM, the driver's code needs to be adjusted so that all its internal memory references point to the correct locations in RAM. The relocator code handles this task, making the driver executable.
- ZX0 Decompressor: To save precious space in the 64KB ROM, the
a4091.devicedriver is compressed using the ZX0 algorithm. A small, fast ZX0 decompressor, written in hand-optimized 68k assembly, is included to unpack the driver into its final, executable form in RAM.
The A4091 uses an 8-bit wide ROM. On Zorro III systems like the Amiga 3000 and 4000, ROM access is limited to nibble-wide reads during the AutoConfig™ phase. Because of this limitation, it is not possible to execute driver code in place from ROM.
To address this, the ROM code relocates the compressed driver image into main RAM, decompresses it using the built-in ZX0 decompressor, and then performs relocation on code and data pointers. This approach results in a boot process that is both compatible with the hardware and faster due to RAM execution speed.
This relocation and decompression is handled by hand-optimized assembly routines in rom.S, reloc.S, and the ZX0 decompressor, and is a core component of the early boot logic. Before relocating, reloc.S checks the decompressed file against the CRC32 in its util/zx0wrap header and refuses a file that fails it: a corrupted driver shows the purple failure screen instead of being started, and a corrupted filesystem is not loaded.
The A4091 ROM includes an optional boot-time diagnostic and configuration menu. You can access it by holding down the right mouse button during power-up or reset.
The boot menu allows configuration of firmware features and diagnostics. It includes:
- ✔️ CD-ROM Boot Enable/Disable: Controls whether the controller attempts to boot from a CD.
- ✔️ Scan past
RDBFF_LAST: By default, an RDB with this flag stops the scan, so devices at higher SCSI IDs, including CD-ROM drives, are not probed. Enable this option to scan all remaining SCSI targets. - 📜 SCSI Device Summary: Displays all detected SCSI targets, gathered by the driver.
- 🎛️ DIP Switch Viewer: Shows the current DIP switch configuration for the controller.
⚙️ These firmware options can be saved across reboots using the Amiga's battery-backed memory (battmem).
The menu is implemented in bootmenu.c and invoked automatically if a right-click is detected during early boot.
The A4091 driver is a hybrid, combining a robust, battle-tested SCSI core with Amiga-specific code.
- From NetBSD: The core of the driver, responsible for handling the low-level SCSI protocol and managing the NCR 53c710 controller chip, is derived from the NetBSD open-source operating system. These files provide a solid foundation for SCSI communication:
ncr53cxxx.*siop.*scsipi*.*
- Unique to A4091: The following files are custom-written for this project and handle the integration with AmigaOS, the AutoConfig process, and the user-facing tools:
rom.S: The aforementioned ROM bootloader.device.c: The main entry point and interface for the AmigaOS device driver.attach.c: Code to handle attaching the driver to the system.cmdhandler.c: Manages the command queue for the driver.ncr7xx.canda4091d.c: The source for thencr7xxtest utility anda4091ddebug tool.mounter.c: Code to automatically mount filesystems from the ROM.
A key component for ease of use is the mounter. It is included in the ROM and is responsible for mounting hard drives at boot time, using the filesystems stored in Kickstart or the ROM (like ODFileSystem or fat95).
Filesystems embedded in the A4091 ROM are loaded on demand through a driver callback. Hard-disk filesystems are requested when the mounter finds a partition whose DosType has no matching entry in FileSystem.resource. With CD-ROM boot enabled, an ISO disc with a CDTV or AMIGA BOOT System ID similarly causes the mounter to request the CD filesystem and create a CD device node. RDB-formatted CDs are scanned for partitions and their filesystems.
Ordinary data CDs and audio CDs are left to the installed OS. This avoids loading the stripped-down ROM CD filesystem for everyday use, where the disk-based filesystem can provide full functionality, including audio-CD support, without a handover from the ROM handler.
On Kickstart 3.0 or newer, the driver retains the exact FileSysEntry created from its ROM. Once DOS has selected the real boot filesystem and started the remaining handlers, a driver-owned RTF_AFTERDOS callback finds every CD node using that entry's handler segment and compares its task with rn_BootProc. A CD boot keeps the ROM filesystem. After a hard-disk boot, the callback stops the unused ROM handlers, removes their DOS and expansion boot nodes, and unlinks the exact ROM-created entry from FileSystem.resource. The detached nodes, entry, and relocated handler remain allocated until reboot, but a fuller disk-based handler is no longer shadowed by the stripped ROM version.
Filesystems are matched by the DosType recorded in the ROM slot (romtool -T), which must match the DosType the filesystem actually serves. After the ROM entry is removed, mounting later media requires a mountlist with a FileSystem= line pointing to a disk-based handler; the DOSDriver shipped with ODFileSystem does exactly this. Older Kickstarts retain the ROM filesystem for the rest of the boot.
The mounter is developed as a separate project that is used by other projects (like lide.device). You can find its source code and more details on its own GitHub repository: github.com/A4091/mounter.
The ncr7xx utility is a powerful command-line tool for testing and diagnosing NCR53C7xx-based SCSI controllers, especially for verifying a newly built card. To perform a comprehensive hardware test, run this from the Amiga Shell:
ncr7xx -tThis will test the card's registers, data/address pins, interrupts, and SCSI pins. A successful run is a good sign that the hardware is working correctly.
Additional options:
ncr7xx -t -LRuns all tests in a continuous loop, counting how many passes have completed. This is useful for burn-in testing - 500+ passes are recommended for validating new builds.
ncr7xx -t56Runs only test numbers 5 and 6. You may specify any subset of test numbers 0 through 8 after -t. Note: Skipping a failing test may cause subsequent tests to behave unpredictably.
The a4091d utility provides a "behind-the-scenes" look at the internal state of the a4091.device driver. Run it from the Shell to get a snapshot of the driver's status.
a4091dYou can specify what information to display:
d: Show device information.u: Show unit (SCSI device) information.o: Show open information.c: Show command information.a: Show all information (default).
Example to show only unit and command info:
a4091d ucFor advanced debugging, you can enable serial output by uncommenting various -DDEBUG_... flags in the Makefile. These messages are sent to the Amiga's serial port (9600 baud, 8-N-1).
Every ROM image ends in a table of contents with the driver and four
filesystem slots (romtoc.h describes the layout). romtool fills them:
each -F <file> -T <DosType> goes into the next slot, starting with slot 1,
and --slot <n> picks the slot for the next one. The driver loads a
filesystem from its slot when the mounter asks for its DosType. The ROMs
built by make carry the CD filesystem in slot 1. A 64KB A4091 ROM with the
CD filesystem has about 13KB left, so the other slots mostly matter on the
384KB A4092/A4770 image, which has over 320KB free.
By default, the ROM is built with the ODFileSystem ROM profile from 3rdparty/ODFileSystem. You can replace it with the official CDFileSystem from AmigaOS 3.2 (or other versions).
Step 1: Extract CDFileSystem from the AmigaOS Install Disk
Use xdftool (from amitools) to extract the filesystem from your AmigaOS Install ADF:
xdftool AmigaOS-3.2-Install.adf unadf L/CDFileSystemStep 2: Replace the Filesystem in the ROM
Use the romtool utility (built with the project) to replace the first filesystem in the ROM. The filesystem type for CDFileSystem is CD01 (hex 0x43443031).
./romtool a4091.rom -o a4091_custom.rom -F CDFileSystem -T 0x43443031The resulting a4091_custom.rom can be flashed to your EEPROM.
You can add support for reading PC-formatted FAT16/FAT32 drives by adding the fat95 filesystem to the ROM.
Step 1: Download the fat95 Filesystem
Download the fat95 archive from Aminet and extract the fat95 file from the l/ directory of the archive.
Step 2: Compile the ROM with Disk Label Support
To use a second filesystem, you must compile the ROM with the -DDISKLABEL flag.
make CFLAGS=-DDISKLABELStep 3: Add fat95 to the ROM's Second Slot
Use romtool to add fat95 to the second filesystem slot (--slot 2), keeping the CD filesystem in the first. The filesystem type for fat95 is FAT (hex 0x46415420).
./romtool a4091_cdfs.rom -o a4091_fat95.rom --slot 2 -F fat95 -T 0x46415420This universal ROM will use the default CD-ROM driver for CDs and automatically use fat95 to mount any hard drive or Zip disk with a FAT partition. This can even enable booting from a FAT-formatted drive.
Feedback, pull requests, and issue reports are welcome at github.com/A4091/a4091-software. If you're unsure where to start, browse the open issues or join the discussion on the project's GitHub page.
If you are using the A4091 and find a bug, please include as much detail as possible - including ROM version, Kickstart version, and any SCSI devices connected.

