Ethernec drivers & NetUSBee on TT: I think I see the problem.

News,announcements,programming,fixes,game patches & discussions.

Moderator: troed

User avatar
stephen_usher
Posts: 5580
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Ethernec drivers & NetUSBee on TT: I think I see the problem.

Post by stephen_usher »

I've been trying to investigate why the Ethernec (ENEC.STX/ENEC3.STX) drivers don't work with my NetUSBee-lite when all the test programs do and I think I may have found the issue, lack of delays before reading the ethernet chip registers.

I've been reading through the source of the Amiga cnet driver to try to work out how the NE-2000 device should be accessed and within the comments is a nice tidbit about having to leave at least 2ms between issuing the request for the data and reading from the chip registers. On the standard Amiga (and hence ST) the processor is often slow enough to not need a delay added but on faster processors it does.

Tellingly, the ethernec NE.S driver source seems to have only one delay in the probe routine on the first read and not for subsequent ones, so I guess that if you happen to have a fast reacting NE-2000 chip in your device, or your TT is fast at reading for some reason, the data won't be ready.

This may explain why the test programs, such as HT2NEC.TOS can read the chip ROM correctly and extract the MAC address but the driver just gets zeros.

I must admit that I'm a bit dubious of the code, especially in BUSENEC.I where there's a macro which uses tst.b with a comment, "write by reading". I have no idea how that might work as it seems tst.b only updates the status register.

Unfortunately I don't have Turbo-C 2.0, though I can get Devpac2, so I can't experiment with building the drivers with delays added. :-/
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
User avatar
arf
Posts: 74
Joined: Sun Oct 29, 2017 9:30 am

Re: Ethernec drivers & NetUSBee on TT: I think I see the problem.

Post by arf »

PureC as a fully compatible replacement of TurboC is available online, including the assembler.
--
Against signature spam!
Steve
Posts: 2570
Joined: Fri Sep 15, 2017 11:49 am

Re: Ethernec drivers & NetUSBee on TT: I think I see the problem.

Post by Steve »

that's weird, my netusbee has no issues with my TT. Its always connected to irc and ftp without problems.
Steve
Posts: 2570
Joined: Fri Sep 15, 2017 11:49 am

Re: Ethernec drivers & NetUSBee on TT: I think I see the problem.

Post by Steve »

Just FYI I use the assemsoft driver not the Dr Richard one.
User avatar
stephen_usher
Posts: 5580
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: Ethernec drivers & NetUSBee on TT: I think I see the problem.

Post by stephen_usher »

Steve wrote: Sat Apr 21, 2018 4:08 am Just FYI I use the assemsoft driver not the Dr Richard one.
OK. I'll take a look at that. It won't help get UIP-Tool working though (I think the author uses the ethernec code internally).

Some TTs work fine with the ethernec driver, some don't. I'm guessing that there may be timing differences between motherboard revisions and it's pot luck if it works with your machine or not. From what I've seen, it's only TTs which have any issues and they are, of course, running double the clock rate of the Falcon.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
User avatar
stephen_usher
Posts: 5580
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: Ethernec drivers & NetUSBee on TT: I think I see the problem.

Post by stephen_usher »

arf wrote: Sat Apr 21, 2018 12:54 am PureC as a fully compatible replacement of TurboC is available online, including the assembler.
From the comments in the code, it's not a plug-in replacement at the assembler level if you want to link in external assembler routines.

I'm not sure why the developers used Turbo C/Devpac2 and not Pure C/Devpac3 given that it was written in 2000. The 030 version of the driver has to use hex values of the instruction codes as Devpac2 only supports the 68000. Devpac3 would have fixed this as it supports the 030 natively.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
User avatar
stephen_usher
Posts: 5580
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: Ethernec drivers & NetUSBee on TT: I think I see the problem.

Post by stephen_usher »

Steve wrote: Sat Apr 21, 2018 4:08 am Just FYI I use the assemsoft driver not the Dr Richard one.
Oh, no STiNG driver, only newer MiNTnet one and no source. I've only MiNT 1.10 installed until I can port my MiNTOS code to a newer kernel. I'm not sure I like the way MiNT changed direction in the late 90s, after Eric Smith left the project. (I wonder how much of my loadavg code is still in there.)
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
User avatar
stephen_usher
Posts: 5580
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: Ethernec drivers & NetUSBee on TT: I think I see the problem.

Post by stephen_usher »

I've managed to get a build environment using Pure C and Devpac3 and done some experiments.

If I increase the delay after the reset in the driver STING now picks up the MAC address correctly, though it still doesn't seem to work sending or receiving packets. However, it's interesting that it's getting somewhere.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
User avatar
stephen_usher
Posts: 5580
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: Ethernec drivers & NetUSBee on TT: I think I see the problem.

Post by stephen_usher »

OK. After turning on debugging in the driver. I can see that the device is receiving broadcast/multicast packets but not able to send any. I wonder if it's writing the registers correctly.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
User avatar
stephen_usher
Posts: 5580
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: Ethernec drivers & NetUSBee on TT: I think I see the problem.

Post by stephen_usher »

OK. I'm giving up. I'm seeing phantom received packets when the hard disk is active!
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
Post Reply

Return to “SOFTWARE PROGRAMMING & DISCUSSION”