Message-ID: <3DD5CD1D.CC3504F6@azglobal.com>
From: Richard <rh86@azglobal.com>
Newsgroups: comp.arch.embedded
Subject: Re: documentation to write ne2000 driver
References: <7457019c.0211151510.59cb53bf@posting.google.com>
Date: Sat, 16 Nov 2002 04:43:14 GMT

C++ Shark wrote:
> 
> Hi!
> 
>  I am a college student and my interests are in assembly language
> programming (on IA-32). Lately, I became curious about ethernet cards,
> particularly ne2000, and want to know if there is sufficient
> documentation available on one of them that may allow me to write a
> driver for it.

For such a broadly de facto standard, it's oddly undocumented.  FWIW,
here's what I've collected over the last year...


For register definitions, the best is a combination of
Realtek's specification guide at www.realtek.com.tw and
National Semiconductor's developer's guide (which also
contains sample drivers and procedures).  Combined, you
get a mediocre reference.

By far, the best guide to the NE2000 interface is a set of
application notes by National Semiconductor, makers of the
original NE2000 NIC for Novell.
- Writing Drivers for the DP8390 NIC Family of Ethernet
  Controllers #AN-874                           <-- Excellent!
- Operation of the FIFO in the DP8390 #AN-886
- AT/LANTIC Software Developer's Guide #AN-887  <-- GOLDMINE!! ****
- Guide to Loopback using the DP8390 Chip Set #AN-858
- Loopback Diagnostics Using the DP8390 #AN-937
- DP8390D NIC Network Interface Controller data sheet
- DP83907 AT/LANTIC II ethernet controller data sheet

Aside from these docs, techniques must be derived through
"tribal knowledge" - studying the published works of others
to observe their tricks and workarounds.  Among these sources
are Novell's sample source code for their NE2000 server and
workstation drivers, Linux driver code, the book "TCP/IP Lean"
by Jeremy Bentham, the PicoWeb breadboard project by Bruce
Lightner (see http://www.picoweb.net) and Jeremy Bentham's ChipWeb
project on Microchip's website (http://www.microchip.com).

The NatSemi docs are the best, but you have to ignore the half of the
docs that discusses their shared RAM mode.  In all, you need a
collection of these sources to build a complete picture.


As a starting point for an embedded platform, you could build the
Picoweb breadboard or buy a production Picoweb and roll your own code
for fun, but that'd involve writing your own IP stack or buying their
dev kit ($50).

One design tip: If you're bit-banging an ISA bus, be sure you respect
the CHRDY signal.  If you ignore CHRDY, it'll work but you'll experience
a very high rate of failed / corrupted packets.  This is a shortcoming
of the Picoweb platform unless you insert a lot of waits during I/O
operations.

If you'd rather work on a PC platform, look at Bentham's TCP/IP Lean -
it's designed to run under DOS (e.g., in a Win98 window).  It also comes
with all the code you'd need in C (e.g., IP stack), so you can focus on
just re-writing the driver in ASM and plugging it in.

Have fun!
Richard

