Subject: Re: Help with new ethernet driver? (Macronix)
To: None <lists@lunedale.demon.co.uk>
From: Ken Nakata <kenn@synap.ne.jp>
List: port-mac68k
Date: 05/05/1998 01:50:30
On Mon, 4 May 1998 16:44:41 +0100,
Chris Bennett <lists@lunedale.demon.co.uk> wrote:
> On Mon, 4 May 1998, Ken Nakata wrote:
> 
> > Yup.  So, if he's luccky, it may be just a matter of finding the right
> > addresses.  MacsBug is the friend... ;-)
> 
> I managed to miss the compatibility with the NS DP83902 the first time
> I looked at the datasheet (even if it is in big, bold letters right at
> the top...). I've been looking at <http://www.macbsd.com/macbsd/
> howto/video.html> for general information about using MacsBug for this
> sort of thing, but it's got me a bit lost -- the last time I worked with
> assembly language was about 15 years ago and it wasn't certainly 68k!

Actually, you don't really have (or at least I hope not) to
disassemble anything to get the card to work.  I didn't have to when I
managed to get Kinetics EtherPort SE/30 to work.

First, you have to make a note of the MAC address (Ethernet address)
of the card.  I forgot how to get that information under MacOS, but
you should be able to get it if you have working MacOS device driver.

Second, you have to find the address where the MAC address is stored
in the ROM.  If the card is in the slot <n>, the NuBus base address
for the card is 0xfn000000.  You may be able to use MacsBug's search
feature to find the offset from the base address.  Note, however, that
the 6 byte long MAC address may not be stored in consequtive memory.
I've seen an Ethernet card on which the MAC address for the card is
stored in every other byte.  It may even be stored in every fourth
byte.

Thirdly, you have to find the offset of the shared RAM on the card.
This may be a bit harder than finding the MAC address, but shouldn't
be too hard.  When its device driver is inactive, whatever value you
store in the RAM should be retained as far as you don't rewrite the
address.

Fourth part is finding the base address of the NIC register file.
Usually a controller chip's register file has a distinctive bit
pattern when dumped in a certain state.  For example, register file
area usually has a length that is a power of 2.  If that's the case, a
same bit pattern might repeat every 2^n bytes.  And from the
datasheet, you should know the pattern a status register shows in the
idle state.

This may not be an ideal instruction how to modify a device driver,
but it's very close to the best I can give you.

As I wrote before, some of us might be able to help you when you get
stuck, if you give us enough information.

I wish you the best luck getting the card working.

Ken