Commodore PC 20-III Emulator Network Support
It is now possible to access the network with my pc20iii emulator. This is accomplished by emulating the NE2000 compatible DP8390 Ethernet NIC chip as well as managing an internal TCP/IP network stack. The DP8390 is assigned to IRQ 3 which is usually reserved for the COM2 port but that secondary port not present on a PC 20-III.
The internal network stack is similar to the user mode network stack in QEMU so no root privileges are needed. In this emulated network the emulator acts as the remote host and gateway at IP address 10.0.0.1 with Ethernet MAC address 11:11:11:11:11:11, and the local IP address for the application(s) running within is expected to be 10.0.0.2 with MAC address 22:22:22:22:22:22. These hardcoded addresses can be changed through recompilation if needed. ARP and ICMP echo (ping) is handled internally while UDP and TCP opens sockets to the outside world. An internal DHCP server response is also generated to make autoconfiguration easier.
The main purpose of the network support was to make the excellent mTCP network stack for DOS usable inside the emulator. It was tested along with the NE2000 DOS packet driver from Crynwr. The FTP and Telnet applications from mTCP should work fairly well. Note that the TCP/IP implementation in the emulator is rather simple and does not implement the proper TCP statemachine. In addition IP fragmenting and TCP window sizes are completely ignored. ELKS is also bootable and can connect on the network but large transfers causes its buffers to fill up.
A bug was fixed with the configuration switch settings. In previous versions the "floppy drives present" bit was not actually set. DOS did not care about this but some other software (like ELKS) would report that no floppy drives were present. The emulated XT hard drive is now also writable, and the disk image can be saved from the debugger if any changes are made.
Here is a screenshot of ELKS booted:
And here is a screenshot of the mTCP telnet client:
You can download the updated version 0.3 here or check the Git repository.
Here is a video showing mTCP FTP and Telnet usage.