DOS Packet Drivers


Introduction

All hardware needs software to control it. Networking hardware is no different.

A long time ago somebody figured out that standard interfaces/APIs for network hardware were desirable because it lets you change the hardware piece of the solution without throwing away all of the software. This is true in the DOS networking world as well. For DOS networking the 'packet driver' specification is the standard way for higher level software to talk to networking hardware. Software such as TCP/IP is written to use the programming interface defined by this specification, and hardware comes with device drivers (a packet driver) that provide that standard programming interface. The end result is that you can write a piece of software that uses networking equipment without even knowing what the networking equipment is!  As long as the software and the hardware (and the associated packet driver) speak to each other using the same 'language' it does not matter.

Packet driver diagram

Another way to look at it is that your networking software never really talks directly to the networking hardware. It talks to the packet driver for that hardware, and as far as the networking software is concerned all packet drivers all look and behave the same way. The complexity of the hardware is hidden by the packet driver. An 8-bit Western Digital WD8003 Ethernet card from 1989 is very different from a NE2000 clone in a 486 PC, yet the packet drivers for each card make them look the same to the rest of the system.

Inside the packet driver is code to talk to a specific piece of hardware. That hardware might be a network card, an Ethernet chipset connected through the parallel port, or even just a plain serial port. Your TCP/IP code really does not care because the packet driver provides a consistent way to send packets and receive packets from the chosen network hardware.

A packet driver makes the hardware and network accessible in an easy manner. It is not just for TCP/IP code either - you can define your own communication protocols or use others such as NetBIOS. The packet driver and hardware do not care .. they are just sending and receiving bytes for you.

A collection of open source packet drivers and the packet driver specification can be found at the Crynwr home page ( http://www.crynwr.com/ ).  Older Ethernet cards generally come with a DOS packet driver. If they do not, the card is probably not going to be usable for DOS networking unless you can write a packet driver. In which case, you probably do not need to read this page ...

Using a Packet Driver

The packet driver is a DOS TSR (Terminate and Stay Resident) utility. Instead of doing something and ending like a normal program it gives you control back right away but stays in memory so that your other programs can use it later. It is like loading an extension to DOS; once it is loaded your computer knows how to do something new. (In this case, talk to a piece of networking hardware.)

Every packet driver is designed to talk to a specific Ethernet card. Sometimes a packet driver can talk to other similar cards too. When the packet driver loads it is going to look for the Ethernet card and try to communicate with it to ensure that the Ethernet card is available. To find the Ethernet card, the packet driver is going to talk to a set of I/O ports. Usually you have to specify those I/O ports on the command line of the packet driver. If the packet driver can not find the expected Ethernet card at the specified I/O ports, it will give up and not load itself.

The packet driver will probably require other command line options too:
As mentioned earlier, all packet drivers talk to higher level software using the packet driver interface/programming API. The packet driver makes itself available to higher level software by taking control of a software interrupt. After the packet driver is installed, other software will use the packet driver by setting parameters and issuing the software interrupt.

For this system to work you need to tell the packet driver what software interrupt it should claim. You also need to tell the other software what software interrupt that the packet driver is listening too. The software interrupt to use is usually specified on the command line when the packet driver is loaded.  Here are some examples:

Davicom 9008 Ethernet card (an NE2000 clone) in an AMD 386-40 using software interupt 0x60.  The hardware interrupt is 0xA and the hardware I/O port address is 0x300.

C:\PACKET>pkt9008 0x60
Packet driver for UM9008, version 11.4.3
Packet driver skeleton copyright 1988-93, Crynwr Software.

System: [345]86 processor, ISA bus, Two 8259s
Packet driver software interrupt is 0x60 (96)
Interrupt number 0xA (10)
I/O port 0x300 (768)
My Ethernet address is 00:80:AD:C9:14:50


Xircom PE3 10BT Parallel-port to Ethernet Adapter running on a PCjr with software interrupt 0x61 and hardware interrupts disabled.

C:\ETHERNET\PACKET>pe3pd sint=61 int=0

Xircom Pocket Ethernet Adapter III Packet Driver, V3.08 (940920)
Packet Driver (C) Copyright 1990-1994 Xircom Inc.

Configuration:    SINT 0x61, LPT2:, No IRQ, Bidirectional

Ethernet Address: 00:80:C7:2E:F3:3B


At this point your machine is physically ready to talk on your network. A 'software service' for sending and receiving raw Ethernet packets is in place, courtesy of the packet driver. Next you will need to add software that will send and receive data using the packet driver.  Continue to read about software by clicking here ...



Created August 13th 2007 last updated March 22nd, 2008
(C)opyright Michael B. Brutman, mbbrutman@yahoo.com