Jump to content

MacToTheFuture SE30 Network Card Driver

Recommended Posts

Hi guys


My apologies for the long hiatus on my project to build a network card for the SE/30. Mark and I have been busy at work the last six months, and I have two small kids (3.5yo and 1yo), so haven’t had a load of time, but I took a look again at Christmas to see if I could make some progress.


We were having some issues with random bus errors and crashed after writing to the card’s address space. Mark scratched his head a bit and figured out what was wrong with our CPLD logic. Its now rock solid.


Once that was fixed, I managed to generate a Slot Resource descriptor and write it into the ROM on our card. A few reboots later and its now showing up in the Slot Manager. Yay!


Sending & Receiving packets also works fine from my test application, so now its time to get my code hammered into a form where it will integrate with the Apple ENET driver, and fit in with AppleTalk, MacTCP and OpenTransport.


This is where I’m running a bit dry on documentation. I wondered if anyone had any stashes of ancient Apple Dev Support sample code or tech notes that explained exactly how to write an Ethernet driver?


By the looks of things there is a shell Apple ENET driver that AppleTalk, MacTCP and AppleTalk open to talk to the network card.


This shell ENET driver looks for a board-specific driver in ‘enet’ resources to find one that handles a board in a given slot.


So I need to build a DRVR ‘enet’ resource, ID matching the BoardID in my Slot Descriptor.


The question is can I just put this inside an Extension in the Extensions folder? I’m going to try that obviously, and I’ve been dissecting what other 3rd party Ethernet card drivers I can find.  


Quite a few ship as Resource files that the installer appears to merge into the System file, but I’d prefer not to go that route.


I’d like to merge the driver into the ROM too, but that’s a bit tedious during development (which might also wear out the EPROM).


Just looking to see if anyone had a secret stash of Ethernet driver code!

Share this post

Link to post
Share on other sites

I’ve written a small DRVR, put it into an ‘enet’ resource whose ID matches my board ID, and copied it into my System file.


Yay, the OS loads it!


I’ve put a DebugStr in DRVROPEN and it pops up in Macsbug.


So I can at least get the OS to load my driver. Next I’ll try putting it in an INIT file and see if its detected that way.


(I’ll put all my code on GitHub once I’m done.)

Share this post

Link to post
Share on other sites

I think you pretty much beyond all of us here currently, at least when it comes to apple dev. There are a few guys here that do it, but only one or two of us that have done drivers. 

Share this post

Link to post
Share on other sites

Agreed. Hardware is my thing. Might even need to engage you for help with customizing a driver for what I am currently working on.

Share this post

Link to post
Share on other sites
On 1/20/2019 at 11:52 PM, ants said:

Perhaps the Basilisk II source might help? Here is the ethernet driver:



Yes indeed, it has been quite helpful. It confirms that I need to implement the E_AttachPH protocol handler stuff, as that's what MacTCP, OpenTransport, etc use. I'll need  a small amount of assembly glue to do that, but it seems straightforward.


I've also been disassembling the Dayna DaynaPORT drivers, which helpfully were compiled with the debugging symbols left in, so I've got some annotations in the disassembly to look at.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now