Building a Human68k driver for a PCMCIA Ethernet card

Adding network access to a Sharp X68000 is a satisfying way to make an old machine useful without losing its original character. A PCMCIA Ethernet card can provide an inexpensive path to file transfers, disk images, remote administration and access to modern retrocomputing resources, provided the X68000 can address the card through suitable hardware.

The difficult part is rarely the Ethernet cable itself. The real work lies in understanding the PCMCIA socket or adapter, identifying the card’s register layout, fitting the interrupt model to the X68000, and presenting packets in a form that a Human68k networking package can use. A small, carefully designed driver is usually more dependable than a large port filled with assumptions from a different DOS platform.

Start with the hardware boundary

A standard X68000 does not provide a normal PCMCIA slot. The computer therefore needs an expansion board, custom adapter or other interface that exposes the card’s I/O registers, memory window and interrupt signal to the X68000 bus. This hardware boundary must be documented before any driver code is written. A PCMCIA card cannot simply be inserted into an unrelated adapter and expected to behave like an ISA network board.

The first task is to record how the interface maps resources. Find the base address used for attribute memory, the address range for card I/O, the method used to enable the socket, and the signal connected to the X68000 interrupt controller. Some adapters may translate PCMCIA accesses into a fixed window, while others may require explicit register programming before the Ethernet controller becomes visible.

Power deserves equal attention. Many older PCMCIA cards expect 5 V, while later cards can be sensitive to voltage sequencing or draw more current during transmission. Check the adapter’s regulation and decoupling rather than relying on a generic supply. If the host is being repaired at the same time, notes from floppy drive restoration are a useful reminder that a mechanical or electrical fault elsewhere can look like a software problem.

Choose a realistic Ethernet chipset

The easiest target is generally a 16-bit PC Card using a familiar NE2000-compatible controller, such as a design based on the National Semiconductor DP8390 family or a compatible clone. Compatibility is not guaranteed merely because a card is labelled “NE2000”. PCMCIA cards often add attribute-memory configuration, an EEPROM, a different reset sequence or a bus-width register around the network controller.

Card identification should therefore begin outside the packet path. Read the CIS, or Card Information Structure, if the adapter makes it available. The CIS can reveal manufacturer data, supported voltage, configuration indexes and requested I/O ranges. If the card has a documented datasheet, preserve a copy with the project because second-hand listings can disappear and identical-looking cards may contain different silicon revisions.

Avoid starting with a modern CardBus card. CardBus is a 32-bit PCI-based technology and needs a completely different host controller. A 16-bit PCMCIA Ethernet card is the more suitable choice for an X68000 project, especially when the aim is to write a small Human68k driver with predictable register access.

Define the driver contract first

Human68k is derived from the MS-DOS family but has its own conventions, system calls and device-driver expectations. Before writing assembly or C, decide whether the program will be a resident character device, a packet-driver-style interface, or a module designed for a specific TCP/IP stack. These choices affect the entry points, buffer ownership, interrupt handling and configuration syntax.

A useful first milestone is a diagnostic utility rather than a complete network driver. It should reset the card, read the station MAC address, display the detected register values and report link status if the hardware provides it. A diagnostic tool can run from the command line and fail safely, whereas a resident driver that mishandles an interrupt can hang the entire machine.

The software should separate four layers:

  • Socket and PCMCIA configuration
  • Ethernet controller register access
  • Interrupt and packet-buffer management
  • The interface expected by Human68k networking software

This separation makes debugging much faster. If a packet never reaches the receive ring, the fault is probably below the protocol interface. If packets arrive but TCP/IP cannot use them, the problem is more likely an API, byte-order or buffer-lifetime mismatch.

Map registers and initialise the card

Most NE2000-style controllers use a page-selected register model. Common registers include command, interrupt status, interrupt mask, data-port, receive configuration, transmit configuration, boundary and current-page registers. The exact offsets and reset behaviour must come from the controller documentation or careful hardware testing, not from a familiar header file copied from an ISA driver.

Initialisation normally follows a disciplined sequence. Place the controller into a stopped state, issue a reset, wait for the reset indication, configure the data width, set the transmit and receive ring boundaries, install the MAC address, clear pending interrupts, and enable only the interrupt sources that the driver can service. Receive mode should initially be conservative: accept directed packets and perhaps broadcast packets, but leave promiscuous mode disabled.

The packet memory layout is especially important. A typical controller uses a transmit buffer at one end of shared memory and a circular receive ring in the remainder. The ring contains status, next-page information, packet length and packet data. The driver must validate every length and page pointer before copying data. A corrupted ring pointer can turn a damaged packet into an endless interrupt loop.

Component Driver responsibility Useful test
PCMCIA socket Configure voltage, reset and I/O window Card responds after insertion
Ethernet controller Reset, select page and set MAC address Known register values are readable
Receive ring Track boundary and current pages Broadcast frame is copied once
Transmit path Reserve buffer and start transmission Small frame leaves the card
Interrupt handler Acknowledge and dispatch events No repeated interrupts when idle
Protocol interface Supply complete Ethernet frames Ping or file transfer succeeds

Handle the X68000 interrupt model carefully

An Ethernet interrupt is asynchronous, so the handler must be short, predictable and safe around Human68k’s system environment. Save every register that the handler may modify, acknowledge the controller’s interrupt source, determine whether the event is receive, transmit, error or reset-related, and defer expensive work where possible.

Do not perform console output, disk access or large memory copies from the interrupt routine unless the chosen environment explicitly permits it. A practical design can copy a received frame into a queue and let the foreground portion of the driver process it later. This costs some memory but makes failures easier to diagnose and avoids spending too long at interrupt level.

The X68000’s 68000-family CPU has no built-in cache coherency problem like a later PCI system, but it still has alignment and bus-width concerns. Word accesses should be used where the controller expects them, and odd-address handling should be tested deliberately. A PCMCIA data port that appears to work for byte reads may return incorrect results for word transfers, or vice versa.

Start with polling if interrupt wiring is uncertain. A polling diagnostic can prove that the card receives and transmits frames before the interrupt vector becomes another variable. Once polling works, add interrupts and compare register traces. This staged approach is particularly valuable when the adapter is a hand-built board or a scarce Japanese expansion obtained through an Australian collector.

Make packet movement robust

A driver should treat every incoming Ethernet frame as untrusted data. Check that the reported length is at least the Ethernet header size, does not exceed the receive buffer, and fits within the ring segment being copied. Handle wraparound explicitly rather than assuming the controller presents each packet as one contiguous block.

The transmit path needs similar discipline. Ethernet frames under the minimum size may need padding, depending on the controller. The driver should not reuse a transmit buffer until the controller reports completion, and it should distinguish a normal completion from a collision, underrun or excessive-retry error. A timeout and reset path is essential because old cards can remain busy after a cable change or malformed command.

MAC addresses should be read from the card’s configuration area when possible instead of hard-coding a value. If a replacement card has no reliable address, allow a user-supplied address in the configuration file, while warning that two devices on the same network must never share it. Keep the default network settings simple during development: a fixed IP address and local subnet are easier to troubleshoot than DHCP.

For Australian users, a direct connection to a small home switch is often easier than testing through an old hub. Many homes in Sydney, Melbourne and Brisbane now use routers with aggressive power-saving or auto-negotiation behaviour, so a basic unmanaged 10/100 switch can provide a calmer test environment. Do not assume that an old 10BASE-T card will negotiate correctly with every modern router.

Connect it to Human68k software

The network API is where many otherwise successful hardware ports fail. Ethernet hardware deals in raw frames, while a TCP/IP package expects a defined packet-driver interface, interrupt entry point or resident device protocol. Find the documentation for the exact Human68k networking software being targeted and implement its contract literally.

Check the expected byte order, frame layout, receive notification method and buffer ownership. A common mistake is to pass a pointer to a buffer that the interrupt routine later reuses. Another is to strip the Ethernet header when the upper layer expects the complete frame, or to leave it in place when the API expects only the payload.

Configuration should expose the hardware values without forcing users to rebuild the driver. A typical setup might specify the I/O base, interrupt level, packet-memory window, MAC address and polling or interrupt mode. Keep the diagnostic utility separate from the resident driver so that users can inspect the card without loading a potentially unstable networking stack.

Documentation matters as much as the binary. Record the tested card model, adapter wiring, memory map, compiler or assembler version and known limitations. If an X68000 video repair later requires sourcing an uncommon part, the preservation notes in replacement video encoder ICs illustrate why project records should remain useful even when the original components are no longer easy to buy.

Test from registers to file transfers

Testing should proceed in layers. First confirm that the PCMCIA card resets and exposes stable identification data. Next verify that the MAC address can be read, then transmit a deliberately simple Ethernet frame to a second machine. After that, receive broadcast traffic, test unicast frames, and only then bring up IP.

A packet capture on another computer is invaluable. It can show whether the X68000 is transmitting a valid source address, whether the Ethernet frame has the correct length, and whether replies are returning. A modern laptop running Wireshark is suitable, although a cheap USB Ethernet adapter may be more convenient than configuring a primary workstation.

Use repeatable tests rather than relying on a single successful ping. Transfer a small file, then a larger file, and test several packet sizes. Watch for dropped frames, receive-ring exhaustion, transmit timeouts and failures that occur only after sustained traffic. A driver that handles one ping may still fail during a disk-image transfer.

Local sourcing can affect the test plan. Australian eBay and Gumtree listings often describe PCMCIA cards poorly, while retro stalls in Melbourne or Sydney may provide an opportunity to inspect the label before buying. Budget for postage and avoid assuming that a card advertised as “working” was tested in a 16-bit socket. If the project includes a replacement power supply, have it checked for Australian 240 V operation and safe isolation before networking faults are investigated.

A working first version does not need every feature. Reliable reset, raw transmit, raw receive, correct interrupt recovery and clear diagnostics are enough to establish a sound foundation. Promiscuous mode, multicast filtering, DMA-like optimisations and automatic configuration can be added after ordinary file transfers are stable.

A Human68k Ethernet driver becomes valuable when it is reproducible rather than merely clever. Publish the register map, adapter assumptions, source code, build instructions and test results alongside the driver. Include photographs or schematics where licensing permits, and document failed cards as carefully as successful ones. That record helps another enthusiast distinguish a defective PC Card from a software defect and keeps the X68000 networking ecosystem usable.

If you are developing this project, begin with a known 16-bit card, a simple diagnostic program and a packet capture on a separate machine. Build each layer in isolation, test it on real hardware, and preserve the results so the next X68000 owner can turn an obscure expansion into a dependable network interface.

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.