STING NE2000 driver

C and PASCAL (or any other high-level languages) in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Post Reply
artik-wroc
Captain Atari
Captain Atari
Posts: 177
Joined: Fri Jan 06, 2006 1:30 pm
Location: Wroclaw - POLAND
Contact:

STING NE2000 driver

Post by artik-wroc »

I want to compile the driver for Netusbee under 68000 from source:
http://web222.webclient5.de/prj/atari/d ... therne.zip
but the makefile is there and it's all based on Mupfel shell. I was able to do this under MiNT / bash, but the resulting driver does not work (maybe it is a question of the presence of the 68030 processor), although the process itself ran without errors.

Image

Someone could write me how to convert it to PRJ file for TurboC. I'm only interested in getting the "enec.stx" file, all the rest is unnecessary (for the compilation to run under TOS).
ThorstenOtto
Atari God
Atari God
Posts: 1408
Joined: Sun Aug 03, 2014 5:54 pm

Re: STING NE2000 driver

Post by ThorstenOtto »

Basically, it should like this:

Code: Select all

etherne.stx
.C[-Iinc_stng]
.C[-Iinc_mnet]
.L[-S=0]
=
enestng.c
nestng.s
ne.s
uti.s

tctoslib.lib
(substitute tctoslib.lib by pctoslib.lib when using Pure-C instead of Turbo-C)

However, there will be some changes needed to the assembler files due to different syntaxes (especially for macros) when using tasm/pasm. There might also some quirk while looking at the main() function: it is declared static, which means that at least Pure-C (not sure about Turbo-C) will simply not link it in, because it is nowhere referenced. You should better use a simple startup source as first file in the project, which just does:

Code: Select all

          .xref main
           .text
            jmp main
and remove the "static" attribute from the main function.
mikro
Hardware Guru
Hardware Guru
Posts: 2345
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: STING NE2000 driver

Post by mikro »

If you are interested, you can find my work on the same source code here: https://github.com/mikrosk/etherne

It contains all the tools and shell, should work out of the box. Altough the source code is modified so beware.
artik-wroc
Captain Atari
Captain Atari
Posts: 177
Joined: Fri Jan 06, 2006 1:30 pm
Location: Wroclaw - POLAND
Contact:

Re: STING NE2000 driver

Post by artik-wroc »

Success, it worked.
I tried Turbo C and Pure C, but The mupffel worked and everything went smoothly.
Once I was sure the compilation went well for NetUSBee, I was able to take the next step and compile the package for Hades, with the Panther/2 fixes.
Now you can use the NE2000 ISA cards with the Panther/2 adapter, not only in MiNT. I am enclosing the STING driver.
For now it only works with GAL Mach32, address on card 300. I won't have a problem with that (I think) and I will fix it to make it work with every GAL..
Thank you for your help.
You do not have the required permissions to view the files attached to this post.
User avatar
frank.lukas
Hardware Guru
Hardware Guru
Posts: 2055
Joined: Tue Jan 29, 2008 5:33 pm
Location: Germany

Re: STING NE2000 driver

Post by frank.lukas »

thanks ...
fancy Atari Musik anDA Dance "Agare Hinu Harukana" 1998 ATARI http://www.youtube.com/watch?v=JX10fxb5eYE
User avatar
Cyprian
10 GOTO 10
10 GOTO 10
Posts: 2189
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: STING NE2000 driver

Post by Cyprian »

well done artik-wroc
Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
artik-wroc
Captain Atari
Captain Atari
Posts: 177
Joined: Fri Jan 06, 2006 1:30 pm
Location: Wroclaw - POLAND
Contact:

Re: STING NE2000 driver

Post by artik-wroc »

There is also a version for Magic (not tested).
EDIT: works, checked :)

1,1MB file download:
a) TOS, Litchi - 1:03 (polling)
b) Magic, aFTP - 0:12 (polling)
c) MiNT, aFTP - 0:06 (interrupt)
You do not have the required permissions to view the files attached to this post.
ThorstenOtto
Atari God
Atari God
Posts: 1408
Joined: Sun Aug 03, 2014 5:54 pm

Re: STING NE2000 driver

Post by ThorstenOtto »

Well done. Maybe you can add the needed changes for the Panther/2 to mikro's repository?

PS.: did you find out why your original approach using bash did not work? As far as i have seen, mupfel is used only to run the makefile, but should not have any effect on the generated driver files. Unless there was something wrong with your Turbo-C installation (in the screenshot i only see invocations of genst2, but not of tcc).

Edit: found one reason why there might be things going wrong. The makefile is set up such that it copies the hardware depend bus*.i file to bus.i, then does a "make drivers". However, that won't recompile the source file(s) that depend on it. So if you do a "make all", you end up with wrongly compiled sources. @mikro: for the same reason, changing the "mv" to "cp" was not a good idea, since that leads to the test programs not being recompiled with the correct bus definitions. Solution: change the line back to "MV=mv", and remove the objects before calling make recursively. A patch is attached.
You do not have the required permissions to view the files attached to this post.
artik-wroc
Captain Atari
Captain Atari
Posts: 177
Joined: Fri Jan 06, 2006 1:30 pm
Location: Wroclaw - POLAND
Contact:

Re: STING NE2000 driver

Post by artik-wroc »

Successfully compiled under bash / MiNT.
The reason, as usual, is trivial.
1) remove * .o files
2) in lines referring to programs (Devpac, TC) - slash
3) lines with "MV" - backslash
or vice versa :)
I used the package from.

EDIT:
The driver for Panther/2 is identical to the one for Hades. The only difference is the ISA_BASE address.
* hardware addresses
*ISA_BASE EQU $FED00000 ; ISA base address for TsengET4000(Panther/2)
*ISA_BASE EQU $FEC00000 ; ISA base address for ATIMach64(Panther/2)
ISA_BASE EQU $FE900000 ; ISA base address for ATIMach32(Panther/2)

I wanted the address to be read from a cookie (like in the SMC driver), but it's probably easier to make 3 drivers, depending on the GAL chip on Panther/2. The more that the driver does not detect interrupts, and the cookie is the effect of P2INT.PRG, which initiates the handling of interrupts.
Fewer programs, more free memory :D
I attach files with added option for Panther/2.
You do not have the required permissions to view the files attached to this post.
User avatar
Cyprian
10 GOTO 10
10 GOTO 10
Posts: 2189
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: STING NE2000 driver

Post by Cyprian »

Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
ThorstenOtto
Atari God
Atari God
Posts: 1408
Joined: Sun Aug 03, 2014 5:54 pm

Re: STING NE2000 driver

Post by ThorstenOtto »

That's the homepage of Thomas Redelberger, the one who originally designed the hardware, and you can also still download the original source archive there.
artik-wroc
Captain Atari
Captain Atari
Posts: 177
Joined: Fri Jan 06, 2006 1:30 pm
Location: Wroclaw - POLAND
Contact:

Re: STING NE2000 driver

Post by artik-wroc »

I tried to adapt part of the Linux test program for NE2000 cards (ne2k_diag). To make it more interesting, the program is written in GFA Basic :)
It recognizes the card properly, but the MAC address is incorrect. When the driver (STING) is loaded everything is fine (I think).

without driver
Image

with the driver
Image
ThorstenOtto
Atari God
Atari God
Posts: 1408
Joined: Sun Aug 03, 2014 5:54 pm

Re: STING NE2000 driver

Post by ThorstenOtto »

That's strange, because the sting driver (at least in the original source) has the ioctl which would set the MAC address disabled, so there must be someone else setting it:

Code: Select all

static int16 cdecl my_cntrl (PORT *port, uint32 argument, int16 code)
{
	int16 result = E_NORMAL;
	static int16  type = -1;

	if (port != & my_port) return (E_PARAMETER);

	switch (code) {
/* we do not allow to change the MAC address
	case CTL_ETHER_SET_MAC :
		if (memory)
			memcpy (& ((VIRT_INIT *) memory)->addr[0], (uint8 *) argument, 6);
		break;
*/
....
Edit: I think i found the reason: The MAC address that is returned by CTL_ETHER_GET_MAC is not read from the cards PROM, but instead returned from some some drivers memory that is filled when the card is probed. So maybe that diag program just does not know how to get the address without a driver loaded?
artik-wroc
Captain Atari
Captain Atari
Posts: 177
Joined: Fri Jan 06, 2006 1:30 pm
Location: Wroclaw - POLAND
Contact:

Re: STING NE2000 driver

Post by artik-wroc »

outb_p(E8390_NODMA + E8390_PAGE1, ioaddr + E8390_CMD)

So much is in the original code. And then reading from registers. Theoretically there should be an address there, but maybe other steps are needed.

"PAR0-5: Physical Address Registers (01H - 06H; Type=R/W in Page1) These registers contain my Ethernet node address and are used to compare the destination adderss of incoming packets for acceptation or rejection."
ThorstenOtto
Atari God
Atari God
Posts: 1408
Joined: Sun Aug 03, 2014 5:54 pm

Re: STING NE2000 driver

Post by ThorstenOtto »

In the sting drivers, this is done in ei_probe1 in ne.s (around label t4_probe1). The MAC address is copied there to dev_dev_addr. And afterwards NS8390_init is called, which seems to write it back to the card.
artik-wroc
Captain Atari
Captain Atari
Posts: 177
Joined: Fri Jan 06, 2006 1:30 pm
Location: Wroclaw - POLAND
Contact:

Re: STING NE2000 driver

Post by artik-wroc »

Drivers for Panther / 2 (ET4000 GAL).
ET4000.zip
You do not have the required permissions to view the files attached to this post.
User avatar
Mark_G
Atari Super Hero
Atari Super Hero
Posts: 552
Joined: Sun Feb 05, 2006 11:55 am
Location: Belgium

Re: STING NE2000 driver

Post by Mark_G »

As written in my former post, the UIP tool works well with the Lotharek Netusbee, but refuses to work with my EtherNEC Ethernet adapter and a NE2000 Realtek 8019 Network adapter card. Notwithstanding they claim to be compatible.

Do someone know how this new compiled drivers works for :
- The original “ENEC Ethernet adapter using NE2000 compatible Ethernet card”
- The 2 versions of Netusbee (which are hardware wise not 100% identical) - original Lyndon Amsdon and remake Lotharek

(If I'm correct a Netusbee was also produced by Ingo/Tuxie. But I don't know if this is a remake without our with HW modifications.)

The original driver works fine on my Falcon with mint (old version) with both the adapter and both Netusbee’s.
However, I'm not in the possibility to do some tests myself at the moment.

Also, Do someone have an in depth explanation of the differences between those adapters, and possible impact on the drivers ?

Mark
artik-wroc
Captain Atari
Captain Atari
Posts: 177
Joined: Fri Jan 06, 2006 1:30 pm
Location: Wroclaw - POLAND
Contact:

Re: STING NE2000 driver

Post by artik-wroc »

artik-wroc wrote: Sun May 02, 2021 8:50 am Drivers for Panther / 2 (ET4000 GAL).ET4000.zip
Only for the Panther/2 adapter, and it NOT work with any version of NetUSBee.
User avatar
TheNameOfTheGame
Atari God
Atari God
Posts: 1672
Joined: Mon Jul 23, 2012 8:57 pm
Location: Almost Heaven, West Virginia

Re: STING NE2000 driver

Post by TheNameOfTheGame »

artik-wroc wrote: Sun May 02, 2021 8:50 am Drivers for Panther / 2 (ET4000 GAL).ET4000.zip
Thanks, I will try these out when I get my PuPla/2 jumpers sorted out.. :cheers:

I see the MagicNet and STiNG drivers are included, but what is the HT2ENE.TOS file?
artik-wroc
Captain Atari
Captain Atari
Posts: 177
Joined: Fri Jan 06, 2006 1:30 pm
Location: Wroclaw - POLAND
Contact:

Re: STING NE2000 driver

Post by artik-wroc »

- HT2ENE.TOS (see also source HT2ENE.S)
This software resets and initialises the NE2000 card and tries to read
the PROM from the card. Please do not run STing or MNet while
performing this test as these would interfere. The PROM holds the MAC
address plus some "signature" bytes specific for a NE2000 or NE1000
card or to the card manufacturer.
Post Reply

Return to “C / PASCAL etc.”