No description
  • Assembly 37.5%
  • C 28.8%
  • Python 28.6%
  • Makefile 2.9%
  • HTML 2.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-13 00:13:31 +01:00
analysis Model ACARD firmware ID and confirm whole-image checksum field 2026-11-13 00:13:31 +01:00
firmware Model ACARD firmware ID and confirm whole-image checksum field 2026-11-13 00:13:31 +01:00
modules Add packed ARC765 dual-flash ROM candidate and offline verification 2026-11-12 23:51:50 +01:00
platform Add native 512/4Kn geometry to the packed U3BG169H ROM 2026-11-13 00:10:17 +01:00
tests Add native 512/4Kn geometry to the packed U3BG169H ROM 2026-11-13 00:10:17 +01:00
tools Model ACARD firmware ID and confirm whole-image checksum field 2026-11-13 00:13:31 +01:00
.gitignore Add packed ARC765 dual-flash ROM candidate and offline verification 2026-11-12 23:51:50 +01:00
Makefile Add native 512/4Kn geometry to the packed U3BG169H ROM 2026-11-13 00:10:17 +01:00
README.md Model ACARD firmware ID and confirm whole-image checksum field 2026-11-13 00:13:31 +01:00

ACARD bridge firmware investigation

The targets are a general fix for flash compatibility and support for 4096-byte logical blocks exposed over SCSI, primarily on Amiga hosts. The current checkpoint is a 16 KiB U3BG169H dual-flash and native 512/4096-byte ROM candidate: shared C receive/commit code, packed RAM payloads and assembly hooks fit without removing existing commands. It is offline tested and remains hardware unvalidated.

The candidate is in firmware/experimental/ with its compiler/source/hash sidecar. ROM packing and validation explains the exact budget, preservation boundary, tests and bench requirements. The current image is u3bg169h-dualflash-4kn-experimental.bin; the earlier flash-only checkpoint is retained alongside it. Combined ATAPI is not enabled.

Implementation status:

Artifacts and reproduction

Original downloads from Patrik's ACARD archive are in firmware/originals/. firmware/manifest.json records source URLs, exact sizes, retrieval time and SHA-256 hashes. Original images have not been patched.

Run from this directory:

make all

This needs SDCC and uCsim (brew install sdcc on this development host), a host C compiler and Python 3. make all runs host tests, builds SDCC modules, checks measurement-overlay layout, and runs compiled logic in the 8051 CPU simulator. The build/*size_only.ihx artifacts are unshared reference measurements with no-op timing stubs. The experimental ROM is built separately by make rom and contains a shared engine, packed payloads and an inherited real delay loop. make rom-test tests the actual ROM selector/decoder bytes in uCsim. Geometry tests exercise the patched IDENTIFY, device-cache, reporting and transfer paths with modeled ATA data and controller registers. Original inventory/disassembly can also be reproduced independently:

python3 -m unittest discover -s tools -p 'test_*.py'
python3 tools/triage.py
python3 tools/mcs51.py firmware/originals/u3bg169h.bin --start 0x3322 --end 0x33a7

tools/mcs51.py is a small offline decoder driven by the complete opcode inventory recorded in analysis/8051-opcodes.json from the Keil instruction table. It is not a decompiler or emulator. Linear decoding does not separate code and data. The tests cover operand consumption, endianness, branch-page boundaries, signed relative branches, reversed MOV operands, and truncated instructions.

Findings from local bytes

Addresses below are file offsets. Mapping file offset zero to code address zero is supported by the vectors and code references, but bank switching and relocated flash code require separate runtime mappings.

Finding Evidence and scope
The firmware contains 8051-compatible code Reset LJMP, standard interrupt-vector slots with RETI, and coherent MOVC/MOVX/ACALL flows. Example u3bg169h.bin starts 02 01 5c, jumping to 0x015c. This identifies the instruction set, not every ARC765 hardware feature.
Archive includes two firmware sizes 22 ROMs: ARC765-tagged images are 16,384 bytes; ARC760-tagged images are 32,768 bytes. Full inventory is in analysis/inventory.json.
Filename and board revision are distinct Photo supplied by user shows ARC765-E. These 16 KiB images carry A765D... identifiers at 0x30. Compatibility with the photographed revision needs verification; the differing letters alone do not establish incompatibility.
All 22 downloaded ROMs have byte sum 0x5a modulo 256 Inventory recomputes this for each image. The user supplied the 16-byte AcardFirmwareId layout at 0x30, identifying its last byte (0x3f) as the whole-file balancing checksum. The original flash code independently compares the sum with 0x5a. See image format.
SCSI dispatch in u3bg169h covers opcodes below 0x40 0x1900..0x1927 checks the opcode in internal byte 0x40, indexes 64 big-endian addresses at 0x35dd, and jumps indirectly. Commands above this bound go to 0x2f39 on this path.
READ CAPACITY(10) reports 512 bytes Table entry for opcode 0x25 at 0x3627 points to 0x3322. The handler writes four bytes 00 00 02 00 after the last-LBA field; the 02 immediate is at 0x337f. This is a concrete 512-byte assumption, not evidence that changing that byte would implement 4K I/O.
The h and q files share substantial flash code u3bg169h[0x384f:0x398f] and u3bg173q[0x3c8c:0x3dcc] are byte identical (320 bytes). This includes an erase sequence and byte programming with DQ6-style polling. The remaining code, callers and actual hardware timing are outside that comparison.
The SLVD A/B pair differs mainly near flash routines slvd176a vs slvd176b has 1,938 same-offset byte differences. Before 0x37ad, differences are five metadata bytes and two two-byte call targets (0x1b3d, 0x314f); near the end, routines are replaced or shifted. Treat this as a useful comparison pair, not a drop-in transplant.
Flash command interface is memory mapped Repeated writes to 0xff80, 0xff81, 0xff82 produce address low, address high, data sequences consistent with 5555:AA, 2AAA:55, 5555:80, and sector erase ending in :30. Registers' roles are inferred from the sequences; no ARC765 register manual has been located.
Flash code is copied to RAM before execution u3bg169h loads source 0x384f, destination 0xf800, count 0x0400, calls copy helper 0x3adc, changes control registers and jumps to 0xf800. Listings use file offsets, not relocated runtime addresses.
The host updater contains backup functionality Static strings in SCSIDE.exe include Backup Firmware actions and separate ACARD model modules. The program has not been run and its protocol has not yet been reconstructed.

These are ordinary Python byte-analysis observations, not REA decompilation results. REA is connected but has no configured Ghidra, IDA, Hopper or Kuna provider; its Binwalk-based firmware scan is unavailable on this macOS host. No native target was opened.

Hardware information reported by the user

The user's colleague clarified that Q hard-disk firmware can run from Winbond flash, but its updater programs SST and cannot reflash a Winbond-equipped board. They report that all ACARD hard-disk firmware they have found uses SST update code; Q is not a Winbond programming variant. SLVD A/B optical versions reportedly target Winbond/SST respectively. Firmware execution compatibility and flash programming compatibility must be distinguished; the new updater selects its algorithm by the chip's software ID, never by the filename suffix.

They also report an internal recovery firmware on ARC765, selected by disabling external flash at power-on, that can program Winbond. These are bench observations supplied by the user, not independently verified here. No electrical recovery procedure has been validated by this investigation.

The flash chip's full part number is not readable in the supplied photo; the user subsequently identified the parts as Winbond W29EE512 and SST39SF010A. A public SST39SF datasheet documents matching command patterns, but does not identify the installed chip.

Patch or replacement firmware

The chosen approach is SDCC-built replacement modules in the existing firmware. It requires assembly wrappers preserving live registers, flags, register bank, stack and allocated internal RAM. Linker placement and ROM space must be established before inserting code. Trailing 0xff bytes are not automatically available: flash payloads copy larger fixed regions into RAM.

SDCC supports MCS-51 C compilation, assembler, linker and CPU simulation; its manual describes memory spaces and assembly interoperability. Keil C51 is another C compiler for 8051. CPU toolchains do not supply ARC765-specific SCSI/ATA/DMA drivers or a board support package. A bounded search for "ARC765" "SDK" "firmware" returned no results; that does not prove an SDK never existed.

A complete rewrite remains a possible later project once the memory map, clock, interrupts, DMA/FIFO registers, boot mapping, SCSI phases, ATA transport and flash interface are understood. Generic 8051 simulation alone cannot validate this ASIC.

Remaining implementation questions

  1. Flash compatibility: validate the identified Winbond/SST algorithms, timing, stage reception and copy-back on hardware. Execution compatibility of Q on Winbond does not imply that its vendor updater can program that flash.
  2. 4K: validate native 4096-byte transfers and retained 512-byte operation on physical bridges. Discovery uses ordinary PATA IDENTIFY DEVICE, including through SATA-to-PATA bridges that forward the size fields and longer sectors. 512e remains 512; no block-size translation is implemented.
  3. Trace IDENTIFY data interpretation, READ/WRITE(6/10), MODE SENSE/SELECT, READ CAPACITY, transfer lengths, residuals, boundaries, error recovery and reset handling. The native ATA IDENTIFY response is separate from disk data sectors; do not turn every 512-byte transfer into a 4096-byte transfer.
  4. Establish the ASIC's ability to stream 4096-byte sectors. The firmware's BadExtRAM 1.3K string is not proof of total RAM capacity or a hardware limit.
  5. Validate with both flash families, 512/4Kn disks, and representative Amiga SCSI controllers. A general firmware design still requires a hardware test matrix.

No binaries have been flashed. A patched experimental ROM has been emitted and its actual loader/decoder bytes have run in uCsim fixtures. The complete firmware and ARC765 ASIC have not been exercised on physical hardware.