Build a recursive Human68k SCSI file catalog

The Sharp X68000 can still reach SCSI storage through Human68k, but useful preservation begins above the block layer: with a directory tree that can be walked from its root to every nested folder. The practical aim is to catalog all files on a SCSI drive recursively, but that phrase needs an engineering definition—walk from the root through every nested folder, record what the filesystem exposes and keep going when damaged media or unreadable entries turn a neat scan into a troubleshooting session.

The result is more than a long directory listing. A durable catalogue can act as a manifest for an offline collection, showing byte sizes, modification times and attributes before disks are duplicated or retired. It also gives collectors a baseline for noticing missing media later, especially when filenames contain spaces or Japanese characters that informal notes tend to flatten.

Scope needs stating plainly. The utility operates on the filesystem exposed by Human68k; it does not scan raw SCSI sectors, bypass partitions or recover data from an unmounted target. “All files” therefore means every directory entry reachable beneath the selected drive, including hidden, system and read-only items, while the report must also identify anything it could not inspect.

Australian parts markets add practical context. A Saturday arvo at a Sydney swap meet can turn up a terminated SCSI cable, while eBay Australia and specialist retro dealers cover rarer boards in AUD. Sellers often ask whether an imported Japanese power supply is original, a fair question because Australian mains run at 230 V and 50 Hz rather than 100 V. That check belongs beside the software work, not after the first unpleasant surprise.

Define the catalogue's purpose

Start with a command that names the root and destination clearly. An illustrative Human68k invocation could be CATALOG A:\ CATALOG.CSV, with the real option set kept small: root volume, output path and perhaps flags for hashes or error logging. Writing the catalogue to another volume avoids creating a file inside the tree being scanned; if that is impossible, exclude the destination by exact path.

Each output record should contain the volume, full path, entry name, type, size in bytes, modification timestamp, attributes and scan status. Record directories as entries too, including empty ones, because their presence proves that traversal reached that branch. Where the runtime exposes creation time, file identity or a raw directory attribute, preserve it in optional fields.

Define “all” operationally before writing code. The tool should attempt every entry, continue after a failed stat or read, and write an error row containing the path and reason. A clean exit merely means the scan ended; the catalogue is clean only when no error rows remain and the root itself appears in a summary.

Understand Human68k volumes and directories

A SCSI target, logical unit and filesystem are different layers. The X68000’s boot and X-BIOS layer may expose one target through several partitions, while Human68k presents only mounted volumes to applications. The utility should therefore treat A: as a volume root, not as a promise that every SCSI LUN or partition on the bus is present. Additional volumes need separate roots or runs.

Human68k’s C library is broadly DOS-flavoured, but a modern hosted Linux example can still mislead. Use the directory enumeration and file-information routines supplied by the chosen runtime, whether exposed as an opendir/readdir layer, DOS-style find functions or low-level equivalents. Check returned structures for the actual size and attribute fields; do not assume Linux’s dirent layout, standard-library behaviour or 64-bit size fields.

Path handling is where apparently working scans fail. Preserve drive letters and backslash separators, skip the special . and .. entries, and avoid concatenating past the runtime’s path limit. Keep original name bytes because Human68k installations may use Japanese system code pages. The site’s project diary is a sensible place to record the tested runtime, compiler, path behaviour and sample output.

Implement traversal with bounded memory

An explicit work stack is safer than unbounded recursive calls. The X68000’s available RAM depends on its model and expansions, while a deep directory tree can consume both the C stack and path buffers. Keep one open directory handle at a time, enqueue child directory paths in fixed-size records and release each record after use. The implementation can use a chunked pool if ordinary heap allocation becomes fragmented.

The core algorithm is deliberately small:

push(root)
while stack is not empty:
    path = pop()
    dir = open_directory(path)

    if dir failed:
        log_error(path)
        continue

    while entry = next_entry(dir):
        if entry.name is "." or "..":
            continue

        child = join_path(path, entry.name)

        if entry is a directory:
            push(child)
        else:
            write_record(child, metadata_for(child))

    close_directory(dir)

Translated into Human68k calls, next_entry must preserve the raw name and distinguish a subdirectory from a regular file before the handle is closed. write_record should have its own error handling so one broken output device does not masquerade as a successful scan. Sorting names within each directory makes runs easier to compare, but a large directory may be better sorted later on a modern host.

Path overflow, duplicate directory identities and unsupported special entries need explicit policies. Log an overlong path and skip only that branch, or make the report show the truncation; never let adjacent strings merge into a plausible but false filename. If the filesystem exposes links or reparse-style entries, avoid following them unless identity tracking can rule out a cycle. Hardware confidence should come from testing on the real bus. The account of a custom prototyping board on X68K.NET shows how a new peripheral becomes useful only after its signals, power and software have been checked together. An internal SCSI target should likewise be verified through the X68000’s own boot path, not only through an emulator.

Make the catalogue durable and verifiable

CSV is a practical interchange format, but it must not corrupt names. Quote fields containing commas, escape embedded quote characters and use CRLF where older Human68k tools expect it. Declare the character encoding in a header comment or companion note. Converting Japanese filenames to UTF-8 is useful for a modern spreadsheet; preserving the original byte form in a separate field is safer when the conversion is ambiguous.

Write to a temporary output and rename it only after the scan closes successfully. Keep a separate error log or include a status column, and write a manifest footer containing the root, start and finish times, volume label and tool version. For high-value media, add an optional CRC or cryptographic hash pass, but remember that hashing reads every byte and can expose ageing drives to additional errors.

Preservation goes beyond copying. The Coolscan preservation case argues that an original fluorescent tube materially affects a scanner’s output; likewise, an archive catalogue should retain exact path spelling and raw metadata rather than only a prettified summary. That evidence lets a later reader establish what existed, repeat the check and decide whether a questionable file should be copied again.

Test, publish and preserve the catalogue

Build a small known-answer fixture before touching an irreplaceable disk: nested folders, an empty directory, zero-length files, spaces, Japanese names, hidden and read-only attributes, and one deliberately unreadable entry if the test setup permits it. Save the expected tree independently, run the utility and compare it by normalised path and record type. Repeat with the output on a second volume and with the destination inside the root to confirm the exclusion rule.

Test an emulator image for speed, then repeat critical runs against a real SCSI target and the X68000’s own storage stack. Exercise controller timeouts, a full output device and an unexpected removal, confirming that the process reports failure instead of claiming complete coverage. Australian conditions also deserve attention: coastal Sydney and humid Brisbane can encourage corrosion and media degradation, so store working and master drives in dry, stable conditions with sensible ventilation.

Alternative methods have different strengths:

Approach Recursive coverage Metadata and error handling Effect on the X68000 Best use
Manual DIR output Depends on Human68k command support Limited metadata and redirected output Minimal Quick inspection of a small volume
Human68k shell or batch commands Useful when recursive commands exist, but output limits remain Human68k-specific fields Low One-off inventories and troubleshooting
Custom Human68k C utility Complete traversal beneath each selected root Controlled schema, explicit error rows Predictable memory and I/O use Long-term collection catalogues
Disk image inspected on a modern host Usually complete, provided the filesystem driver is faithful Easy modern tooling and sorting Almost none Pre-audit and post-processing
SCSI block-level diagnostic No filesystem visibility Reports sectors, not files Moderate controller I/O Testing the physical target

Build the first catalogue on a disposable image, publish the source and a sample manifest, and add verified findings to the X68000 community. A native utility, a reproducible manifest and a hardware test note are more valuable together than any one of them alone; together they turn a SCSI drive from an anonymous box of media into a collection another hobbyist can inspect, copy and keep alive.

Nereid-X Expansion Board

A personally-produced LAN+USB+Memory expansion board for Sharp X68000 series computers. Multiple production runs were offered, including a final batch and a later revival reproduction run.

Power Supply Repair

X68 power supply repair and modification services were offered by the site owner, with documentation shared through diary entries spanning 2001–2006.

Server & Networking

Notes on FreeBSD administration, ISP changes, server migration, and networking topics. The site itself ran on FreeBSD with the hns diary system and Namazu search integration.

A two-ink risograph print in muted slate-blue and charcoal on off-white paper, showing a stylized desktop computer monitor beside a circuit board with soft geometric trace lines, conveying a calm retro-computing workshop atmosphere. A two-ink risograph print in deep purple and dark grey on cream stock, depicting a compact expansion card with connector ports and subtle Japanese technical annotations, evoking a hobbyist electronics bench. A two-ink risograph print in teal and charcoal on warm white paper, showing a server rack silhouette with soft network-line motifs and a small weather icon, suggesting a personal server room corner.

Get in touch

X68K.NET connects Sharp X68000 enthusiasts through community links and shared projects. Reach out with questions about the Nereid project or X68 resources.