How Does IP65 Use W5100 MACRAW Mode to Bring TCP/IP to 6502 Machines?
IP65 is a 6502 TCP/IP stack whose Apple II driver opens W5100 Socket 0 in MACRAW mode, using the chip as a raw Ethernet MAC rather than its hardwired stack.
0
Components
Hardware componentsProject description

IP65 is a TCP/IP stack written in 6502 assembly for vintage 8-bit machines. On the Apple II it talks to the WIZnet W5100 through the Uthernet II card — but it does not use the chip’s hardwired TCP/IP engine.

It opens Socket 0 in MACRAW mode and treats the W5100 as a raw Ethernet MAC, running its own ARP, IP, UDP and TCP layers on the 6502 itself.
Why MACRAW instead of the hardwired stack
IP65 supports three target systems and five different Ethernet devices, so a single stack has to sit on top of all of them. The driver boundary is therefore defined at the raw-frame level.
| System | Ethernet device |
|---|---|
| Apple II | Uthernet, Uthernet II (W5100), LANceGS |
| Commodore 64 | RR-Net, ETH64 |
| ATARI (XL) | Dragon Cart |
drivers/w5100driver.s simply binds the generic eth entry point to _w5100, and every NIC driver exposes the same four-entry jump table — init, poll, send, exit — behind a signature of $65 $74 $68 ("eth") and Ethernet driver API version $01. The chip is used for its MAC and PHY, while the protocol work stays on the 6502.
How the driver brings the W5100 up
drivers/w5100.s (Oliver Schmidt, 2013, carried over from Contiki) runs this sequence:
| Step | Register | Value | Meaning |
|---|---|---|---|
| 1 | Mode Register | OR $03 | Indirect Bus I/F mode + Address Auto-Increment |
| 2 | $0017 Retry Time-value | read-back probe | presence check |
| 3 | $001A RX Memory Size | compare $06 | detect an already-shared W5100 |
| 4 | Mode Register | $80 | software reset, then poll until the high bit clears |
| 5 | Mode Register | $13 | Indirect Bus I/F + Auto-Increment + Ping Block |
| 6 | $0009 Source Hardware Address | 6 bytes | MAC address |
| 7 | $001A / $001B RX/TX Memory Size | $0A | 4 KB each to sockets 0 and 1 |
| 8 | Socket 0 Mode Register | $44 | MACRAW + MAC Filter |
| 9 | Socket 0 Command Register | $01 | OPEN |
The default MAC begins with $00 $08 $DC — WIZnet’s OUI — hardcoded in the driver’s mac: table, completed by $A2 $A2 $A2.
Apple II bus access
The W5100 appears in the Apple II slot I/O space. The driver declares three addresses as a slot-0 template:
mode := $C084
addr := $C085
data := $C087and rewrites them at run time: init takes the slot number, shifts it left four times (asl ×4) to turn it into a slot I/O offset, and patches every access site in place (the fixup01–fixup14 labels). Indirect Bus I/F with Address Auto-Increment means the driver writes an address once and then streams bytes through the single data port — which is why the card needs a 65C02 or later for that access pattern.
drivers/uthernet2.s is the thin board-specific wrapper: it sets __APPLE2__ = 1 and DYN_DRV = 0, includes w5100.s, and supplies the name string "Uthernet II".
What this gives the user
IP65 ships three things on top of that driver: an assembly library for ca65 programmers, a C library for the cc65 cross compiler, and ready-to-run TCP/IP programs. A machine designed in 1977 gets DHCP, DNS, TCP and HTTP over a WIZnet chip — with the stack itself small enough to live in 6502 address space.
Why not the hardwired stack? One binary has to drive three different controllers
The answer is in drivers/ethernetcombo.s. That file imports three NIC drivers side by side — _w5100, _cs8900a and _lan91c96 — and picks one at run time. drivers/a2combo.s is the Apple II build of it, drivers/c64combo.s the Commodore 64 one. A single program therefore has to work on any of the cards the user happens to own.
Those cards are not variations on one chip. The board wrappers show which controller each one is built around:
| Card | Wrapper file | Controller |
|---|---|---|
| Uthernet II | drivers/uthernet2.s | W5100 |
| Uthernet | drivers/uthernet.s | CS8900A |
| RR-Net | drivers/rr-net.s | CS8900A |
| Dragon Cart | drivers/dragoncart.s | CS8900A |
| LANceGS | — | LAN91C96 |
So the W5100 is one controller out of three, from three different vendors, and only one of the three offers a hardwired TCP/IP engine. Whatever interface the stack standardises on has to be something all three can do, and the only such interface is “hand me an Ethernet frame.”
The driver struct in ethernetcombo.s makes that explicit. Every driver must present the same record:
.struct driver
drvtype .byte 3 ; "eth"
apiver .byte ; $01
mac .byte 6
bufaddr .addr
bufsize .word
init .byte 3 ; jmp
poll .byte 3 ; jmp
send .byte 3 ; jmp
exit .byte 3 ; jmp
.endstructand the symbols it exchanges with the stack are eth_inp, eth_inp_len, eth_outp and eth_outp_len — an inbound frame buffer and an outbound frame buffer. There is no socket in that interface, no connect, no listen. A driver that opened TCP connections inside the chip would have nothing to return through it.
The layering is also historical. The MPL headers on w5100driver.s and uthernet2.s name Jonno Downes as the initial developer of IP65 with a 2009 copyright; drivers/w5100.s is Oliver Schmidt’s, dated 2013 and carried over from Contiki. The API version byte was already $01 when the W5100 arrived. Adding the card meant writing a MAC driver to fit an interface that existed, not redesigning the stack around one card’s accelerator.
Two details in the driver follow from the same decision. MACRAW occupies Socket 0, so the chip is given over to raw mode — the driver allocates buffer memory to sockets 0 and 1 only and uses the one. And before resetting the chip, init reads the RX Memory Size Register and compares it against $06, the 4+2+1+1 KB split: if the W5100 is already configured that way, something else is using it and the driver leaves the configuration alone rather than resetting it out from under another program.
The $06 check is a community convention, not a quirk
Two details in the bring-up sequence look arbitrary until you find the document behind them. A2RetroSystems publishes W5100 Shared Access conventions for exactly this — and names ip65/drivers/w5100.s as a reference implementation of the program side.
The problem it solves is concrete. An Apple II may be running a ProDOS network-drive redirector that owns the card, and then the user launches a program that also wants the network. Defining a software API for the program to call was rejected as too expensive in memory and too binding. Instead both touch the chip directly and agree on a split of its four sockets:
| Socket | TX/RX memory | Owner |
|---|---|---|
| 0 | 4 KB | program — the only socket that can do MACRAW |
| 1 | 2 KB | program |
| 2 | 1 KB | system |
| 3 | 1 KB | system |
That is why the system leaves socket 0 alone: MAC-Raw is available on socket 0 only, and the system has no use for it, so the one scarce mode goes to whoever needs it.
The handshake is a single register read. A program checks the RX Memory Size Register at 0x001A for 0x06 — the 4+2+1+1 KB split. If it finds it, a system is already running: do not reset the chip, and presume only the Mode Register, the MAC address and the two memory-size registers are valid. Gateway, subnet mask and source IP must not be presumed. The MAC in the Source Hardware Address Register must be reused, especially for DHCP, so the lease matches.
And the $0A this driver writes when it is alone is deliberate for the same reason. The convention suggests 0x0A rather than 0x06 in the non-shared case precisely so that a program starting later does not mistake an idle card for a shared one.
The Ping Block bit has a caveat the convention spells out: a MACRAW program answering ICMP itself may enable it, but only once the chip’s IP registers match its own setup, and it must clear the bit on exit — the author adds that living with duplicate ICMP replies is often the better trade.
The other road: the same author’s hardwired-TCP demo
MACRAW is not the only way to drive an Uthernet II, and the clearest proof of that sits in the card vendor’s own repository. demo/stream.c and demo/stream.h in a2retrosystems/uthernet2 are a TCP client for the Apple II that uses the W5100’s hardwired stack. Its API says so plainly: stream_init(base_addr, ip_addr, submask, gateway), stream_connect(server_addr, server_port), stream_disconnect(). You hand the chip an IP address and a gateway, ask it to connect, and then only move bytes.
The striking part is who wrote it. The BSD header on stream.h is Oliver Schmidt, 2014 — the same engineer whose name is on drivers/w5100.s in IP65, dated 2013. One person, one chip, two opposite choices a year apart. That rules out habit or unfamiliarity as the explanation and leaves the constraints.
Put the two initialisation paths side by side and they are the same code until a single byte:
| Step | IP65 driver (MACRAW) | Vendor demo (hardwired TCP) |
|---|---|---|
| Mode Register | OR $03 | *stream_mode |= 0x03 |
| Retry Time-value probe | $0017 | get_word(0x0017) != 2000 |
| Shared-use check | $001A vs $06 | get_byte(0x001A) != 0x06 |
| Software reset | $80, poll | 0x80, poll |
| RX/TX Memory Size | $0A | set_byte(0x001A, 0x0A) |
| MAC address | $00 $08 $DC … | {0x00, 0x08, 0xDC} … |
| Chip IP / subnet / gateway | never written | 0x000F SIPR, 0x0005 SUBR, 0x0001 GAR |
| Socket 0 Mode | $44 — MACRAW | 0x01 — TCP |
| After OPEN | frames in and out | S0_PORT = 6502, wait for S0_SR = 0x13 (SOCK_INIT), destination IP to 0x040C |
| Interrupts | polled | 0x0016 IMR, socket IRQ via 0x0015 / 0x0402 |
So which one is right?
Neither, on its own — the question is what else has to work.
The hardwired stack wins when the Uthernet II is the only card you care about. The TCP state machine, retransmission, windowing and checksums all run inside the W5100. A 1 MHz 6502 never touches them; it writes a destination address, waits for a status byte, and reads payload. For a single application shipped for one card, that is strictly less code and strictly less CPU.
MACRAW wins when the code has to run on hardware you have not seen. IP65 is a library, not an application: it is linked into other people’s programs, and those programs run on whatever card the owner of a 40-year-old machine managed to find. Two of the three controllers IP65 drives have no TCP engine to delegate to. A stack built on the W5100’s sockets would not be a stack at all on the other two — it would be a second, incompatible product.
There is a cost, and it is worth naming. Running IP, TCP and UDP on the 6502 spends cycles and memory that the chip would otherwise have absorbed, and MACRAW gives up the per-socket acceleration entirely. IP65 pays that to keep one code path. The vendor demo pays portability to keep the 6502 idle. The chip supports both because the same silicon can be a protocol engine or a plain MAC — which mode you open Socket 0 in decides which product you are building.
Related — the same chip, the opposite decision
How Does Net4CPC Put a W5100S on the Amstrad CPC Bus in Indirect Parallel Mode?
That write-up covers an Ethernet card for the Amstrad CPC whose CP/M software takes the other road: it configures the chip’s own IP, gateway and subnet, opens Socket 0 as 01H — TCP — and lets the W5100S establish connections while the Z80 only moves payload. It is linked here because the two make sense as a pair: the same silicon, the same socket mode register, opposite values written into it.
What separates them is not the machine and not performance. On raw numbers the chip wins either way; no 8-bit CPU wants to run a TCP state machine. The deciding factor is how many different controllers the code has to survive. KCNet targets one board, so it can delegate. IP65 is a library linked into other people’s programs, driving three controllers from three vendors, and two of them have no TCP engine to delegate to — which leaves the raw frame as the only interface it can standardise on.
There is a second axis worth noticing. The Net4CPC driver exposes all six socket modes, MACRAW included, and dispatches on whichever one the caller asks for. So even on that card the hardware does not force the choice. Across both projects the pattern is the same: the board decides nothing, the value written to the socket mode register decides everything.
Source
- github.com/cc65/ip65 — driver at
drivers/w5100.s, board wrapper atdrivers/uthernet2.s, C API atapps/w5100.h - Project wiki
- Uthernet II card (A2RetroSystems)
한국어 설명
IP65는 8비트 빈티지 머신용으로 6502 어셈블리로 작성된 TCP/IP 스택이다. Apple II에서는 Uthernet II 카드를 통해 WIZnet W5100과 통신하는데, 칩의 하드와이어드 TCP/IP 엔진은 쓰지 않는다.

Socket 0을 MACRAW 모드로 열어 W5100을 순수 이더넷 MAC으로 쓰고, ARP·IP·UDP·TCP 계층은 6502에서 직접 돌린다.
왜 MACRAW인가
IP65는 머신 3종과 이더넷 장치 5종을 지원한다. 하나의 스택이 이들 위에 전부 얹혀야 하므로 드라이버 경계를 원시 프레임 수준에 둔다.
| 머신 | 이더넷 장치 |
|---|---|
| Apple II | Uthernet, Uthernet II (W5100), LANceGS |
| 코모도어 64 | RR-Net, ETH64 |
| ATARI (XL) | Dragon Cart |
drivers/w5100driver.s는 범용 진입점 eth를 _w5100에 연결할 뿐이고, 모든 NIC 드라이버가 init·poll·send·exit 네 개짜리 점프 테이블과 $65 $74 $68("eth") 시그니처, API 버전 $01을 동일하게 노출한다. 칩은 MAC과 PHY로만 쓰이고 프로토콜 처리는 6502에 남는다.
초기화 시퀀스
drivers/w5100.s(Oliver Schmidt, 2013, Contiki에서 이식)의 순서는 위 영문 표와 같다. 핵심은 Socket 0 Mode Register에 $44(MACRAW + MAC Filter)를, Command Register에 $01(OPEN)을 쓰는 것, 그리고 Mode Register $13으로 Indirect Bus I/F·Address Auto-Increment·Ping Block을 함께 켜는 것이다. 기본 MAC은 드라이버의 mac: 테이블에 WIZnet OUI인 $00 $08 $DC가 하드코딩돼 있다.
Apple II 버스 접근
W5100은 Apple II 슬롯 I/O 공간에 나타난다. 드라이버는 슬롯 0 기준 템플릿 주소(mode := $C084, addr := $C085, data := $C087)를 선언해 두고, init에서 슬롯 번호를 네 번 좌시프트(asl ×4)해 슬롯 오프셋으로 바꾼 뒤 fixup01~fixup14 지점을 런타임에 전부 패치한다. Address Auto-Increment 덕분에 주소를 한 번만 쓰고 data 포트로 바이트를 연속 전송할 수 있는데, 이 접근 패턴 때문에 65C02 이상이 필요하다.
drivers/uthernet2.s는 보드별 래퍼로 __APPLE2__ = 1, DYN_DRV = 0을 설정하고 w5100.s를 include한 뒤 "Uthernet II" 이름 문자열을 제공한다.
왜 하드와이어드 스택을 안 쓰나 — 바이너리 하나가 컨트롤러 셋을 구동해야 하기 때문이다
답은 drivers/ethernetcombo.s에 있다. 이 파일은 NIC 드라이버 셋을 나란히 import한다 — _w5100, _cs8900a, _lan91c96 — 그리고 런타임에 하나를 고른다. drivers/a2combo.s가 Apple II 빌드, drivers/c64combo.s가 코모도어 64 빌드다. 프로그램 하나가 사용자가 가진 어떤 카드에서든 동작해야 한다는 뜻이다.
그 카드들은 같은 칩의 변형이 아니다. 보드별 래퍼 파일이 각각 어떤 컨트롤러인지 보여준다.
| 카드 | 래퍼 파일 | 컨트롤러 |
|---|---|---|
| Uthernet II | drivers/uthernet2.s | W5100 |
| Uthernet | drivers/uthernet.s | CS8900A |
| RR-Net | drivers/rr-net.s | CS8900A |
| Dragon Cart | drivers/dragoncart.s | CS8900A |
| LANceGS | — | LAN91C96 |
즉 W5100은 서로 다른 제조사의 컨트롤러 셋 중 하나이고, 그중 하드와이어드 TCP/IP 엔진을 가진 것은 하나뿐이다. 스택이 표준으로 삼을 인터페이스는 셋 다 할 수 있는 것이어야 하고, 그런 인터페이스는 "이더넷 프레임을 건네달라" 하나뿐이다.
ethernetcombo.s의 드라이버 구조체가 이를 명시한다. 모든 드라이버가 동일한 레코드를 제시해야 하며, 스택과 주고받는 심볼은 eth_inp, eth_inp_len, eth_outp, eth_outp_len — 수신 프레임 버퍼와 송신 프레임 버퍼다. 이 인터페이스에는 소켓이 없고 connect도 listen도 없다. 칩 안에서 TCP 연결을 여는 드라이버는 이 인터페이스로 돌려줄 것이 없다.
계층 구조는 역사적이기도 하다. w5100driver.s와 uthernet2.s의 MPL 헤더는 IP65의 초기 개발자로 Jonno Downes를 2009년 저작권과 함께 명시한다. drivers/w5100.s는 Oliver Schmidt의 것으로 2013년이고 Contiki에서 이식됐다. W5100이 합류했을 때 API 버전 바이트는 이미 $01이었다. 카드를 추가한다는 것은 이미 존재하는 인터페이스에 맞는 MAC 드라이버를 쓰는 일이었지, 한 카드의 가속기를 중심으로 스택을 다시 설계하는 일이 아니었다.
드라이버의 두 가지 세부도 같은 결정에서 나온다. MACRAW는 Socket 0을 점유하므로 칩이 원시 모드에 넘겨진다 — 드라이버는 소켓 0과 1에만 버퍼 메모리를 할당하고 그중 하나를 쓴다. 그리고 리셋 전에 init은 RX Memory Size Register를 읽어 4+2+1+1 KB 분할인 $06과 비교한다. 이미 그렇게 설정돼 있으면 다른 무언가가 쓰고 있다는 뜻이므로, 남의 설정을 밀어버리지 않고 그대로 둔다.
$06 확인은 커뮤니티 규약이지 기벽이 아니다
초기화 시퀀스의 두 군데는 문서를 찾기 전까지는 임의로 보인다. A2RetroSystems가 바로 이 문제를 위해 W5100 Shared Access 규약을 공개하고 있고, 프로그램 쪽 참조 구현으로 ip65/drivers/w5100.s를 직접 지목한다.
풀려는 문제는 구체적이다. Apple II에서 ProDOS 네트워크 드라이브 리다이렉터가 카드를 점유한 상태인데 사용자가 네트워크를 쓰는 프로그램을 또 띄우는 상황이다. 프로그램이 호출할 소프트웨어 API를 정의하는 안은 메모리를 너무 쓰고 종속을 만든다는 이유로 기각됐다. 대신 양쪽이 칩을 직접 건드리되 소켓 네 개의 분배에 합의한다.
| 소켓 | TX/RX 메모리 | 소유 |
|---|---|---|
| 0 | 4 KB | 프로그램 — MACRAW가 가능한 유일한 소켓 |
| 1 | 2 KB | 프로그램 |
| 2 | 1 KB | 시스템 |
| 3 | 1 KB | 시스템 |
시스템이 소켓 0을 건드리지 않는 이유가 여기 있다. MAC-Raw는 소켓 0에서만 되고 시스템은 그 모드를 쓸 일이 없으니, 희소한 모드 하나를 필요한 쪽에 넘긴다.
핸드셰이크는 레지스터 한 번 읽기다. 프로그램은 0x001A의 RX Memory Size Register가 0x06(4+2+1+1 KB 분할)인지 본다. 그렇다면 시스템이 이미 돌고 있는 것이니 칩을 리셋하지 말고, Mode Register와 MAC 주소, 메모리 크기 레지스터 둘만 유효하다고 가정한다. 게이트웨이·서브넷·소스 IP는 가정하면 안 된다. Source Hardware Address Register의 MAC은 반드시 재사용해야 하며, 특히 DHCP에서 리스가 어긋나지 않게 하기 위해서다.
이 드라이버가 단독일 때 쓰는 $0A도 같은 이유로 의도적이다. 규약은 비공유 상황에서 0x06이 아닌 0x0A를 권하는데, 나중에 시작한 프로그램이 유휴 카드를 공유 상태로 오인하지 않게 하기 위해서다.
Ping Block 비트에는 규약이 명시한 단서가 붙는다. ICMP에 직접 응답하는 MACRAW 프로그램은 이 비트를 켤 수 있지만, 칩의 IP 레지스터가 자기 설정과 일치할 때만이고 종료 시 반드시 꺼야 한다. 저자는 중복 ICMP 응답을 그냥 감수하는 쪽이 대개 낫다고 덧붙인다.
다른 길 — 같은 저자가 쓴 하드웨어 TCP 데모
Uthernet II를 MACRAW로만 쓸 수 있는 것은 아니다. 가장 분명한 반례가 카드 제조사의 저장소 안에 있다. a2retrosystems/uthernet2의 demo/stream.c와 demo/stream.h는 W5100의 하드와이어드 스택을 쓰는 Apple II용 TCP 클라이언트다. API가 그대로 말해준다 — stream_init(base_addr, ip_addr, submask, gateway), stream_connect(server_addr, server_port), stream_disconnect(). 칩에 IP와 게이트웨이를 쥐여주고 연결을 시킨 뒤, 6502는 바이트만 옮긴다.
눈에 띄는 것은 저자다. stream.h의 BSD 헤더는 Oliver Schmidt, 2014년이다. IP65의 drivers/w5100.s에 적힌 그 이름, 2013년이다. 한 사람이 같은 칩을 두고 1년 간격으로 정반대 선택을 했다. 습관이나 무지로는 설명되지 않고, 남는 것은 제약뿐이다.
두 초기화 경로를 나란히 놓으면 한 바이트 전까지 같은 코드다.
| 단계 | IP65 드라이버 (MACRAW) | 제조사 데모 (하드웨어 TCP) |
|---|---|---|
| Mode Register | OR $03 | *stream_mode |= 0x03 |
| Retry Time-value 확인 | $0017 | get_word(0x0017) != 2000 |
| 공유 사용 확인 | $001A vs $06 | get_byte(0x001A) != 0x06 |
| 소프트웨어 리셋 | $80, 폴링 | 0x80, 폴링 |
| RX/TX 메모리 크기 | $0A | set_byte(0x001A, 0x0A) |
| MAC 주소 | $00 $08 $DC … | {0x00, 0x08, 0xDC} … |
| 칩의 IP·서브넷·게이트웨이 | 쓰지 않음 | 0x000F SIPR, 0x0005 SUBR, 0x0001 GAR |
| Socket 0 모드 | $44 — MACRAW | 0x01 — TCP |
| OPEN 이후 | 프레임 입출력 | S0_PORT = 6502, S0_SR가 0x13(SOCK_INIT)이 될 때까지 대기, 목적지 IP를 0x040C에 |
| 인터럽트 | 폴링 | 0x0016 IMR, 0x0015·0x0402로 소켓 IRQ |
그래서 어느 쪽이 맞나
둘 중 하나가 옳은 게 아니라, 같이 돌아가야 할 것이 무엇이냐의 문제다.
Uthernet II 한 장만 고려한다면 하드와이어드 스택이 맞다. TCP 상태기계와 재전송, 윈도잉, 체크섬이 전부 W5100 안에서 돈다. 1 MHz 6502는 그것들을 건드리지 않고 목적지 주소를 쓰고 상태 바이트를 기다렸다가 페이로드를 읽을 뿐이다. 카드 한 종류를 겨냥한 단일 애플리케이션이라면 코드도 적고 CPU도 덜 쓴다.
본 적 없는 하드웨어에서 돌아야 한다면 MACRAW가 맞다. IP65는 애플리케이션이 아니라 라이브러리다. 남의 프로그램에 링크되고, 그 프로그램은 40년 된 기계의 주인이 구할 수 있었던 아무 카드에서나 돌아간다. IP65가 구동하는 컨트롤러 셋 중 둘은 위임할 TCP 엔진 자체가 없다. W5100의 소켓 위에 세운 스택은 나머지 둘에서는 스택이 아니라 호환되지 않는 별개 제품이 된다.
대가도 분명히 해두는 게 맞다. IP와 TCP, UDP를 6502에서 돌리면 칩이 흡수했을 사이클과 메모리를 쓰게 되고, MACRAW는 소켓 단위 가속을 통째로 포기하는 것이다. IP65는 코드 경로 하나를 지키려고 그 값을 치르고, 제조사 데모는 6502를 놀리려고 이식성을 포기한다. 칩이 양쪽을 다 지원하는 이유는 같은 실리콘이 프로토콜 엔진도 되고 평범한 MAC도 되기 때문이며, Socket 0을 어느 모드로 여느냐가 어떤 제품을 만드는지를 결정한다.
의미
이 드라이버 위에 ca65용 어셈블리 라이브러리, cc65용 C 라이브러리, 바로 실행 가능한 TCP/IP 프로그램이 얹힌다. 1977년에 설계된 머신이 WIZnet 칩을 통해 DHCP·DNS·TCP·HTTP를 쓰게 되며, 스택 자체는 6502 주소 공간에 들어갈 만큼 작다.
함께 보기 — 같은 칩, 반대 결정
How Does Net4CPC Put a W5100S on the Amstrad CPC Bus in Indirect Parallel Mode?
그 글은 Amstrad CPC용 이더넷 카드를 다루는데, CP/M 쪽 소프트웨어가 정반대 길을 간다. 칩 자신의 IP·게이트웨이·서브넷을 설정하고 Socket 0을 01H — TCP — 로 열어, 연결은 W5100S가 맺고 Z80은 페이로드만 옮긴다. 여기에 링크를 걸어둔 이유는 둘이 한 쌍이기 때문이다. 같은 실리콘, 같은 소켓 모드 레지스터, 거기 쓰는 값만 반대다.
둘을 가르는 것은 기계도 성능도 아니다. 숫자만 보면 어느 쪽이든 칩이 이긴다. 8비트 CPU 중에 TCP 상태기계를 떠안고 싶어 하는 것은 없다. 답을 정하는 것은 그 코드가 몇 종류의 컨트롤러에서 살아남아야 하는가다. KCNet은 보드 하나를 겨냥하므로 위임할 수 있다. IP65는 남의 프로그램에 링크되는 라이브러리로 제조사 셋의 컨트롤러를 구동하는데 그중 둘에는 위임할 TCP 엔진이 없다 — 그래서 표준으로 삼을 수 있는 것이 원시 프레임뿐이다.
눈여겨볼 축이 하나 더 있다. Net4CPC 쪽 드라이버는 MACRAW를 포함해 소켓 모드 여섯 개를 전부 노출하고 호출자가 요청한 모드로 분기한다. 그 카드에서도 하드웨어가 선택을 강제하지는 않는다는 뜻이다. 두 프로젝트를 관통하는 패턴은 같다 — 보드는 아무것도 정하지 않고, 소켓 모드 레지스터에 쓰는 값이 전부를 정한다.
