New AMDPCNet32 Driver for NeXTSTEP 3.3

NeXT Computer, Inc. -> Emulation / Virtualization

Title: New AMDPCNet32 Driver for NeXTSTEP 3.3
Post by: asaladine on November 29, 2024, 11:11:13 AM
Hey Everyone,

Over the past little bit I've been working to write a driver to get networking working in VirtualBox with the AMDPCNet32 (PCNet-PCI II as VirtualBox labels it) managed to finally get it working and figured someone else might get some use out of it. It's still pretty rough and I've got lots of cleanup+features left to do but seems to work good enough so far. Originally I didn't realize there was a PCNet driver available for NeXTSTEP 3.3, but the way I see it having a driver with source available is probably in and of itself valuable for the longevity of the platform.

You can get the source or a tarball of the binaries from github here (https://github.com/AustinWells/AMDPCNet32II)

Hope someone gets some use out of this, if you notice anything broken in it feel free to open an issue on the repo (or a PR  ;) ).


Title: Re: New AMDPCNet32 Driver for NeXTSTEP 3.3
Post by: pTeK on November 30, 2024, 11:48:37 PM
Congratulations that is one heck of a first post 8)

You make it look easy.. Did you develop this all on Virtual Box or did use a different IDE on your host machine?

Will you be porting the driver to Rhapsody DR2 as well?
Title: Re: New AMDPCNet32 Driver for NeXTSTEP 3.3
Post by: asaladine on December 01, 2024, 01:52:47 AM
Quote from: pTeK on November 30, 2024, 11:48:37 PMCongratulations that is one heck of a first post 8)

Thanks, I've been a lurking for a very long time though :P

Quote from: pTeK on November 30, 2024, 11:48:37 PMYou make it look easy.. Did you develop this all on Virtual Box or did use a different IDE on your host machine?

I wrote a driver for Linux first to figure out how exactly the card worked, made debugging a hell of a lot easier. Then the NeXT driver I wrote pretty much entirely on the virtual machine, but now that I have it working I've been developing locally using VSCode and just getting it onto the machine via NFS.

Quote from: pTeK on November 30, 2024, 11:48:37 PMWill you be porting the driver to Rhapsody DR2 as well?

If there's interest I'm happy to do so, I've never really played around with Rhapsody beyond installing it. I'd like to polish up the 3.3 implementation first (another release with some improvements should be up in a couple of day) and get it working on Openstep, but will certainly look into it while I do that.
Title: Re: New AMDPCNet32 Driver for NeXTSTEP 3.3
Post by: pTeK on December 01, 2024, 03:47:54 AM
Quote from: asaladine on December 01, 2024, 01:52:47 AMI wrote a driver for Linux first to figure out how exactly the card worked, made debugging a hell of a lot easier. Then the NeXT driver I wrote pretty much entirely on the virtual machine, but now that I have it working I've been developing locally using VSCode and just getting it onto the machine via NFS.
Yeah some of those comments looked like they were put in place by VSCode which is why I asked.

Quote from: asaladine on December 01, 2024, 01:52:47 AMIf there's interest I'm happy to do so, I've never really played around with Rhapsody beyond installing it. I'd like to polish up the 3.3 implementation first (another release with some improvements should be up in a couple of day) and get it working on Openstep, but will certainly look into it while I do that.
I don't think there is Rhapsody Support for any VirtualBox network hardware at the moment.
Title: Re: New AMDPCNet32 Driver for NeXTSTEP 3.3
Post by: asaladine on December 01, 2024, 01:43:52 PM
Quote from: pTeK on December 01, 2024, 03:47:54 AMI don't think there is Rhapsody Support for any VirtualBox network hardware at the moment.

I didn't realize that, In that case, definitely putting it to my TODO list.
Title: Re: New AMDPCNet32 Driver for NeXTSTEP 3.3
Post by: asaladine on December 01, 2024, 05:59:57 PM
Some news on the Rhapsody front, managed to build the driver there from source (the binary didn't seem to work or even get run) using the following steps:


after that Project Builder was able to build the driver and I could load it up no problem. Seems like I can talk to machines on my local network, FTP with my local machine looks good both directions, can ping my router, etc. But communicating with the web seems broken, for example pinging 8.8.8.8 just hangs. I'm by no means a networking expert but this smells like a configuration issue on my side not really a driver issue (if anyone has any tips that'd be much appreciated) otherwise, I'll push that code and a binary in the next couple days in case someone else wants to give it a go.

But at the very least it's a start.



Title: Re: New AMDPCNet32 Driver for NeXTSTEP 3.3
Post by: pTeK on December 04, 2024, 11:49:41 AM
Quote from: asaladine on December 01, 2024, 05:59:57 PMSome news on the Rhapsody front, managed to build the driver there from source (the binary didn't seem to work or even get run) using the following steps:

  • get the source onto the machine (I just used geniso on my local machine and loaded that into vbox)
  • created a new PB Project for the Driver using the driver template
  • copy pasted the source files into the project and updated the Defaults.table
  • created a symlink for /System/Library/Frameworks/System.framework/Headers/kern/ that points to /System/Library/Frameworks/System.framework/Headers/kernserv/, for whatever reason the built in headers seemed to assume that path existed and had the contents of kernserv
  • Removed the #import for etherdefs.h, prototypes.h and kernelDriver.h (missing definitions, the compiler seems to have figured out the implicit definitions so must be some sort of include path issue)

Great work again. 8)

What do you think the level of difficulty is between storage drivers (SCSI/IDE), sound drivers, video drivers and network drivers?

After completing the AMD network driver do you think the intel network hardware emulated by VirtualBox would also be easy or do you think that could would be a bit more harder as the card is newer?

Any other drivers you are thinking of working on or are you on to the next project?
Title: Re: New AMDPCNet32 Driver for NeXTSTEP 3.3
Post by: asaladine on December 04, 2024, 10:52:49 PM
Quote from: pTeK on December 04, 2024, 11:49:41 AMGreat work again. 8)

Thank you! :)

Quote from: pTeK on December 04, 2024, 11:49:41 AMWhat do you think the level of difficulty is between storage drivers (SCSI/IDE), sound drivers, video drivers and network drivers?

Not too sure, this is my first serious attempt at a device driver so I don't think I could really say until I give it a go. 

Quote from: pTeK on December 04, 2024, 11:49:41 AMAfter completing the AMD network driver do you think the intel network hardware emulated by VirtualBox would also be easy or do you think that could would be a bit more harder as the card is newer?

Any other drivers you are thinking of working on or are you on to the next project?

I'm definitely looking to write more drivers. I was considering the Intel cards since I'm now fairly familiar with the IOEthernet stuff, but I also want to branch out into other types of hardware. Maybe a generic SVGA driver for 3.3 (if possible), or something disk-related, especially given the issues I'm having with the BusLogic controller.

That said, I'm open to suggestions. If there's particular hardware people are interested in seeing a driver for, I'd be more than happy to look into it, so please do let me know.
Title: Re: New AMDPCNet32 Driver for NeXTSTEP 3.3
Post by: wmlive on December 06, 2024, 03:36:23 AM
Quote from: asaladine on December 04, 2024, 10:52:49 PMIf there's particular hardware people are interested in seeing a driver for, I'd be more than happy to look into it, so please do let me know.
A driver enabling PCMCIA controller chipsets more recent than the supported Intel 82365 on white hardware would be a game changer.

For example, the old Thinkpads T60 and T61 run a preinstalled OPENSTEP 4.2 just fine, including the UltraBay CD-ROM drive. But there is no networking and no external storage access via Adapted SlimSCSI or USB.

The built-in PCMCIA slot is based on a 'Texas Instruments PCI1510 PC card Cardbus Controller' for which there is no driver. Therefore the kernel is incapable of recognizing and making work any PCMCIA cards providing networking or SCSI, even if they are already supported.

Making the PCMCIA slot work would enable using the whole range of already supported PCMCIA cards like the Adaptec SlimSCSI 1460b or PCMCIA network cards.

Aparently there are already drivers for this device in OpenBSD and some other BSD variants:

man.openbsd.org/pcmcia.4 (https://man.openbsd.org/pcmcia.4)

bsd-hardware.info/?id=pci:104c-ac56-1071-8381&dev_class=06-07&dev_type=bridge&dev_vendor=Texas+Instruments&dev_name=PCI1510+PC+card+Cardbus+Controller&dev_ident=80ff2 (https://bsd-hardware.info/?id=pci:104c-ac56-1071-8381&dev_class=06-07&dev_type=bridge&dev_vendor=Texas+Instruments&dev_name=PCI1510+PC+card+Cardbus+Controller&dev_ident=80ff2)

The Linux kernel also supports PCMCIA via its yenta cardbus driver.

Not suggesting to add full cardbus suppport, but rather to just enable the hardware's PCMCIA capabilities in order to be able to take advantage of all those PCMCIA cards where a driver already exists.
Title: Re: New AMDPCNet32 Driver for NeXTSTEP 3.3
Post by: wmlive on December 06, 2024, 03:41:54 AM
Another suggestion would be to have a look at USB support.
Source code for rudimentary working USB drivers already exist, but apparently it still needs more work to become really useful. See https://www.nextcomputers.org/forums/index.php?topic=5781.msg32843 (https://www.nextcomputers.org/forums/index.php?topic=5781.msg32843) for further details.
Title: Re: New AMDPCNet32 Driver for NeXTSTEP 3.3
Post by: asaladine on December 06, 2024, 01:52:47 PM
Quote from: wmlive on December 06, 2024, 03:36:23 AMA driver enabling PCMCIA controller chipsets more recent than the supported Intel 82365 on white hardware would be a game changer.

This is a very interesting suggestion, unfortunately looks like the PCMCIA support is missing from what we have in the Darwin 0.3 source, so not too much to look at there, but from disassembling I think I can sorta figure out what the class looks like externally and there's also PCI support which I imagine would get us alot of the way to understanding the kernbus interface (which I'm guessing is where the driver would have to attach), but that's just me thinking out loud.

Curious if anyone else has looked into this before and got far enough to understand what the kernel expects from a PCMCIA driver?

but, I guess the most important question is, are there any emulator that can emulate a newer PCMCIA controller (like the PCI1510)? I see qemu can emulate some PCMCIA hardware, but not sure which chipset it's emulating.

Quote from: wmlive on December 06, 2024, 03:41:54 AMAnother suggestion would be to have a look at USB support.

Another very cool idea! Good to know we have somewhat of a starting point, I think there is also https://github.com/itomato/UsbOHCI.0.5beta/tree/master for OHCI, which might be helpful depending on which USB controller we want to support (or I guess in my case what's available on vbox).
Title: Re: New AMDPCNet32 Driver for NeXTSTEP 3.3
Post by: pTeK on December 06, 2024, 04:33:33 PM
Quote from: asaladine on December 04, 2024, 10:52:49 PMI'm definitely looking to write more drivers. I was considering the Intel cards since I'm now fairly familiar with the IOEthernet stuff, but I also want to branch out into other types of hardware. Maybe a generic SVGA driver for 3.3 (if possible), or something disk-related, especially given the issues I'm having with the BusLogic controller.
You emulate VirtualBox using the BusLogic SCSI adaptor? I used to use that, now I now use NeXTSTEP 3.3 EIDE driver (V3.37) which has support for Intel PIIX3 EIDE (You can find it on this site Software/NEXTSTEP/Drivers/nextstep_3.3/beta/). I don't know where @Nitro got it from.

Just remember to change the /etc/fstab file from /dev/sdX to /dev/hdX if you install the updated driver and change the controller in VirtualBox.

You may have to edit /usr/Devices/System.config/Instance0.table and swap the SCSI driver with the EIDE driver.

Quote from: asaladine on December 04, 2024, 10:52:49 PMThat said, I'm open to suggestions. If there's particular hardware people are interested in seeing a driver for, I'd be more than happy to look into it, so please do let me know.
If you could get the EIDE driver compiled on 3.3 then I would definitely be able to start adding to it (ICHM) code.

A dbkit adapter for mySQL so we can connect to mySQL running on a Raspberry PI?
Title: Re: New AMDPCNet32 Driver for NeXTSTEP 3.3
Post by: asaladine on December 06, 2024, 10:24:11 PM
Quote from: pTeK on December 06, 2024, 04:33:33 PMYou emulate VirtualBox using the BusLogic SCSI adaptor? I used to use that, now I now use NeXTSTEP 3.3 EIDE driver (V3.37) which has support for Intel PIIX3 EIDE (You can find it on this site Software/NEXTSTEP/Drivers/nextstep_3.3/beta/). I don't know where Nitro (https://www.nextcomputers.org/forums/index.php?action=profile;u=3) got it from.

Historically, I've used the EIDE controller, I'm entirely not sure why my VM this time around is using SCSI the rest of my 3.3 VMs are using the IDE driver. But thanks for the tips for migration, just moved over and it worked perfectly!

Quote from: pTeK on December 06, 2024, 04:33:33 PMIf you could get the EIDE driver compiled on 3.3 then I would definitely be able to start adding to it (ICHM) code.

Good Idea, I'll try and give this a shot over the weekend, at the very least get the pb files working on 3.3 and see what kind of code changes (if any) are required.

Title: Re: New AMDPCNet32 Driver for NeXTSTEP 3.3
Post by: pTeK on February 05, 2025, 01:38:18 AM
Some sources to compare notes.
Am79C965A - PCnet™-32 Single-Chip 32-Bit Ethernet Controller (Datasheet) (https://www.amd.com/content/dam/amd/en/documents/archived-tech-docs/datasheets/18219.pdf)
Linux Driver (https://github.com/analogdevicesinc/linux/blob/main/drivers/net/ethernet/amd/pcnet32.c)
OpenBSD driver (https://github.com/openbsd/src/blob/master/sys/dev/pci/if_pcn.c)
Asaladine's NeXTSTEP version. (https://github.com/AustinWells/AMDPCNet32II/tree/main/AMDPCNet32II_reloc.tproj)

Go to top  Forum index