First post, by Yoghoo
- Rank
- Oldbie
As there was no DOS packet driver for the Realtek RTL8169 Gigabit network card I thought it would be a nice project to create one (for the first time) with the help of Claude. It is tested on real hardware with EtherDFS and MTCP (FTP/NTP etc).
Features
- PCI bus detection via the PCI BIOS (INT 1Ah).
- Full RTL8169 initialisation: descriptor-ring based TX/RX (bus-master DMA, not the older RTL8139 ring-buffer style), interrupt handling, IRQ8-15 cascade handling.
- 10/100/1000 Mbit auto-negotiation (no forced speed - see "Design notes" for why).
- A minimal, functional subset of the Packet Driver Specification: driver_info, access_type, release_type, send_pkt, terminate, get_address, reset_interface, get_statistics - enough for a single TCP/IP stack such as mTCP or WatTCP.
- A safe, spec-compliant -u uninstall option that unhooks the driver and frees all of its memory (including the DMA descriptor rings and packet buffers, which live outside the normal resident program image).
- No <stdio.h>/<stdlib.h> dependency, to keep the resident footprint small.
Requirements
- A Realtek RTL8169 (PCI vendor:device 10ec:8169) network card.
- Open Watcom v2, 16-bit DOS target (wcl, not wcl386). Only needed if you want to compile it yourself of course.
- DOS or a DOS-compatible environment (tested with MS-DOS version 7.10).
Examples
- RTL8169P 0x60
- RTL8169P -u 0x60
- RTLDEBUG -s 0x60
Normally you only need the RTL8169P.EXE executable. But if you need to debug problems there is also a RTLDEBUG.EXE executable available on Github which can output statistics and even create a Wireshark compatible capture file. The debug version uses around 2.2KB extra memory. The standard version with default options uses about 48KB memory. This can be reduced by adjusting the TX/RX parameters (-t, -r) but be aware that using too low values can cause lost packet issues. For an explanation about these and other parameters please take a look a on the project page.
Project page is located on Github: https://github.com/Yoghoo/RTL8169P. Sources are included there as well (GPLv3).
It was quitte an extensive project and I won't bore you with all the details here. But if you are interested in the details look at the README.md and DESIGN.md files on Github.
Please report bug and problems on Github (preferred) or in this thread.