Skip to content

How Does ADTPro Serve Apple II Disk Images Over a W5100 UDP Socket?

ADTPro's Uthernet II driver opens W5100 socket 1 in UDP mode to present a remote disk as a local ProDOS volume, following the card's shared-access conventions.

jaden

Published November 23, 2026

Original author: ADTPro ProjectOriginal source (new tab)

How Does ADTPro Serve Apple II Disk Images Over a W5100 UDP Socket?

Components

Hardware components

Project description

ADTPro — Apple Disk Transfer ProDOS — moves disk images between a modern host and a real Apple II. Most people meet it over a serial cable or an audio lead, but it also has an Ethernet path, and that path is the interesting one: with an Uthernet II in the machine, a remote disk image appears to ProDOS as an ordinary local volume. The code that makes it work opens a UDP socket inside the W5100 and leaves the protocol handling to the chip.

A virtual drive, not a file transfer

The Ethernet driver lives under src/client/prodos/ethernet/drive2/, and the file names say what it is: vuiidrive.asm, vuiidriveio.asm, vuiidriveinstall.asm — Virtual Uthernet II Drive. Alongside them sit the chip-level pieces, w5100init.asm, w5100io.asm and w5100const.i, with a separate UDP implementation at src/client/w5100/w5100_udp.s.

Because it is a block device rather than a transfer program, nothing on the Apple II has to know about networking. ProDOS sees a volume; applications read and write files on it; each block request becomes a datagram.

Socket 1, UDP, port 6502

w5100const.i declares the card’s three I/O addresses — mode at $C0B4, addr at $C0B5, data at $C0B7, which is the slot 3 position in the Apple II’s $C080 + slot×$10 I/O space. w5100init.asm then brings the chip up and opens one socket:

RegisterValueMeaning
Socket 1 Source Port6502local port
Socket 1 Destination IPserver addresswhere the disk image lives
Socket 1 Destination Port6502remote port
Socket 1 Mode RegisterUDPdatagram socket in the chip
Socket 1 Command RegisterOPEN 

The 6502 never assembles an IP header. It writes a block request into the socket’s TX buffer, issues a command, and reads the reply out of RX. Checksums, addressing and framing are the W5100’s problem.

It plays by the shared-access rules

Before any of that, w5100init.asm compares the RX Memory Size Register against $06 and, when it is initialising the card itself, writes $0A to both memory-size registers — 4 KB each to sockets 0 and 1. Those two numbers are the W5100 Shared Access conventions the card vendor publishes, so that a ProDOS driver holding the card and a user program that also wants the network can coexist on four sockets instead of fighting over them.

ADTPro’s own documentation covers the failure mode plainly. Pressing Ctrl-Reset puts the Uthernet II back to a default state; VEDRIVE notices on the next access and re-initialises. If a program used the card without following the conventions, Ctrl-Reset recovers the drive. If it did follow them, you touch the virtual drive once after the reset so that the next program can detect VEDRIVE’s presence.

The W5100 driver files carry a 2014 copyright by Oliver Schmidt — the same name on the MACRAW driver in IP65 and on the card vendor’s own TCP demo.

Related — the same chip, a third choice

How Does IP65 Use W5100 MACRAW Mode to Bring TCP/IP to 6502 Machines?

Linked here because the two sit on the same axis and land in different places. IP65 opens Socket 0 in MACRAW and runs IP, UDP and TCP on the 6502, because it is a library that must also drive controllers with no TCP engine at all. ADTPro needs one datagram conversation with one server on one card, so it takes a UDP socket and lets the chip do the rest. Same silicon, same author on the driver, opposite side of the same convention — one writes the program half, the other the system half.

한국어 설명

ADTPro(Apple Disk Transfer ProDOS)는 현대 호스트와 실제 Apple II 사이에서 디스크 이미지를 옮긴다. 대개는 시리얼 케이블이나 오디오 단자로 쓰지만 이더넷 경로가 따로 있고, 그쪽이 흥미롭다. Uthernet II를 꽂으면 원격 디스크 이미지가 ProDOS에게 평범한 로컬 볼륨으로 보인다. 이를 가능하게 하는 코드는 W5100 안에 UDP 소켓을 열고 프로토콜 처리를 칩에 맡긴다.

파일 전송이 아니라 가상 드라이브다

이더넷 드라이버는 src/client/prodos/ethernet/drive2/에 있고 파일 이름이 정체를 말해준다 — vuiidrive.asm, vuiidriveio.asm, vuiidriveinstall.asm, 즉 Virtual Uthernet II Drive다. 그 옆에 칩 레벨 코드 w5100init.asm, w5100io.asm, w5100const.i가 있고, UDP 구현은 src/client/w5100/w5100_udp.s에 따로 있다.

전송 프로그램이 아니라 블록 디바이스이기 때문에 Apple II 쪽에서는 아무도 네트워크를 알 필요가 없다. ProDOS에게는 볼륨이 보이고, 애플리케이션은 거기 파일을 읽고 쓰며, 블록 요청 하나가 데이터그램 하나가 된다.

소켓 1, UDP, 포트 6502

w5100const.i는 카드의 I/O 주소 셋을 선언한다 — mode $C0B4, addr $C0B5, data $C0B7. Apple II의 $C080 + 슬롯×$10 I/O 공간에서 슬롯 3 자리다. 이어 w5100init.asm이 칩을 올리고 소켓 하나를 연다.

레지스터값의미
Socket 1 Source Port6502로컬 포트
Socket 1 Destination IP서버 주소디스크 이미지가 있는 곳
Socket 1 Destination Port6502원격 포트
Socket 1 Mode RegisterUDP칩 안의 데이터그램 소켓
Socket 1 Command RegisterOPEN 

6502는 IP 헤더를 한 번도 조립하지 않는다. 소켓의 TX 버퍼에 블록 요청을 쓰고 명령을 내린 뒤 RX에서 응답을 읽을 뿐이다. 체크섬과 주소 지정, 프레이밍은 W5100의 몫이다.

공유 규약을 지킨다

그 전에 w5100init.asm은 RX Memory Size Register를 $06과 비교하고, 자기가 카드를 초기화하는 경우에는 두 메모리 크기 레지스터에 $0A(소켓 0과 1에 4 KB씩)를 쓴다. 이 두 숫자가 카드 제조사가 공개한 W5100 Shared Access 규약이다. 카드를 점유한 ProDOS 드라이버와 네트워크를 쓰려는 사용자 프로그램이 소켓 네 개를 두고 싸우는 대신 공존하게 하는 장치다.

ADTPro 문서는 실패 상황도 그대로 적어둔다. Ctrl-Reset을 누르면 Uthernet II가 기본 상태로 돌아가고 VEDRIVE가 다음 접근에서 알아채 재초기화한다. 규약을 따르지 않는 프로그램이 카드를 썼다면 Ctrl-Reset으로 드라이브를 복구할 수 있다. 규약을 따르는 프로그램이라면, 리셋 후 가상 드라이브를 한 번 건드려 두어야 다음 프로그램이 VEDRIVE의 존재를 감지할 수 있다.

W5100 드라이버 파일에는 2014년 Oliver Schmidt의 저작권이 붙어 있다. IP65의 MACRAW 드라이버와 카드 제조사의 TCP 데모에 적힌 바로 그 이름이다.

함께 보기 — 같은 칩, 세 번째 선택

How Does IP65 Use W5100 MACRAW Mode to Bring TCP/IP to 6502 Machines?

두 글이 같은 축 위에서 다른 지점에 내려앉기 때문에 링크를 건다. IP65는 Socket 0을 MACRAW로 열고 IP·UDP·TCP를 6502에서 돌린다. TCP 엔진이 아예 없는 컨트롤러까지 구동해야 하는 라이브러리이기 때문이다. ADTPro는 카드 한 장에서 서버 하나와 데이터그램을 주고받으면 되므로 UDP 소켓을 잡고 나머지를 칩에 맡긴다. 같은 실리콘, 드라이버 저자도 같은 사람, 그리고 같은 규약의 반대편 — 한쪽은 프로그램 절반을, 다른 쪽은 시스템 절반을 쓴다.

Comments

Similar projects you might like

Comments