Welcome, Guest. Please login or register.

Author Topic: Zorro III memory card... now with Ethernet  (Read 11860 times)

Description:

0 Members and 2 Guests are viewing this topic.

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show only replies by tnt23
Re: Zorro III memory card... now with Ethernet
« Reply #14 on: November 18, 2013, 07:00:18 PM »
Quote from: olsen;752892

How do you feel about open sourcing the resulting driver? As things stand, we do not have enough SANA-II Ethernet driver examples which can be reviewed and adapted by anybody interested in the matter. The networking driver source code, as part of the original SANA-II kit, explains how one might create a SLIP driver, but that is so obsolete it's not even funny any more.


I would not mind sharing the driver at all, only there's a bit of chicken and egg problem. To come up with a decent driver I'd take a look at a sample one written by someone else (and preferrably not in assembler). It is really great 3c589.device  sources are available, although the code seems rather complex to me. I think I'm going to hack it quickly to get ping or DHCP reply before posting.
 

Offline olsen

Re: Zorro III memory card... now with Ethernet
« Reply #15 on: November 20, 2013, 08:50:27 AM »
Quote from: tnt23;752975
I would not mind sharing the driver at all, only there's a bit of chicken and egg problem. To come up with a decent driver I'd take a look at a sample one written by someone else (and preferrably not in assembler). It is really great 3c589.device  sources are available, although the code seems rather complex to me. I think I'm going to hack it quickly to get ping or DHCP reply before posting.
I had a quick look at the 3c589.device source code, and it looks good to me (I'd probably rewrite the basic device I/O code to be more paranoid, though, and the cleanup procedures in case of errors should be reworked). It even has support for the SANA-IIR2 packet filter feature which some drivers choose to omit.

As far as I can tell from my past experience, 3c589.device is a good SANA-II Ethernet device driver design. It may appear to be complex, but this is in fact how you would implement this kind of driver. It properly separates the basic device I/O, the individual hardware units, and the low level hardware access. This is really how it's supposed to be done.

More code documentation would always be nice, but not everybody wants his code to be a didactic example ;)
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show only replies by tnt23
Re: Zorro III memory card... now with Ethernet
« Reply #16 on: November 21, 2013, 04:21:40 PM »
Quote from: olsen;753153
As far as I can tell from my past experience, 3c589.device is a good SANA-II Ethernet device driver design. It may appear to be complex, but this is in fact how you would implement this kind of driver. It properly separates the basic device I/O, the individual hardware units, and the low level hardware access. This is really how it's supposed to be done.

Well, give me some more time and we'll see the difference :) I have just implemented my first /INT2 server (which I am very proud of), and the resulting progress so far is slightly over zero.
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show only replies by tnt23
Re: Zorro III memory card... now with Ethernet
« Reply #17 on: November 24, 2013, 05:33:22 PM »
There are some minor issues, but basic RX code is working. SANAUTIL network tool opens device, requests orphan packets and dumps them.
« Last Edit: November 24, 2013, 05:49:30 PM by tnt23 »
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show only replies by tnt23
Re: Zorro III memory card... now with Ethernet
« Reply #18 on: November 26, 2013, 06:32:32 AM »
TX code is working now, too. Packets sent from Amiga are seen on the remote side. (Will have to set up a way to grab screenshots instead of using my mobile phone's camera.)



Remote host (Raspberry Pi running tcpdump):



For that reason I've bought the RoadShow TCP/IP stack last night :)
 

Offline olsen

Re: Zorro III memory card... now with Ethernet
« Reply #19 on: November 26, 2013, 08:20:02 AM »
Quote from: tnt23;753448
TX code is working now, too. Packets sent from Amiga are seen on the remote side. (Will have to set up a way to grab screenshots instead of using my mobile phone's camera.)

Luxury. When I was a lad, we used to make screenshots by using the tiniest stubs of chewn and grubby crayons. But we were happy then.

Quote

For that reason I've bought the RoadShow TCP/IP stack last night :)


I guess it's too late to talk you out of buying Roadshow, but the demo version should be able to handle test setups like these just fine ;)
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show only replies by tnt23
Re: Zorro III memory card... now with Ethernet
« Reply #20 on: November 26, 2013, 08:50:03 AM »
Quote from: olsen;753451

I guess it's too late to talk you out of buying Roadshow, but the demo version should be able to handle test setups like these just fine ;)


Well, I've got enough reasons to reboot on my own to deal with demo's 30 minute expiration :)
 

Offline Bobo68

  • Newbie
  • *
  • Join Date: Dec 2006
  • Posts: 43
    • Show only replies by Bobo68
Re: Zorro III memory card... now with Ethernet
« Reply #21 on: November 26, 2013, 12:07:43 PM »
Quote from: tnt23;753448
(Will have to set up a way to grab screenshots instead of using my mobile phone's camera.)


sgrab ?
A4000T/060, CV64-3D, 146 GB SCSI
 

Offline Themamboman

  • Lifetime Member
  • Full Member
  • ***
  • Join Date: Mar 2002
  • Posts: 164
    • Show only replies by Themamboman
Re: Zorro III memory card... now with Ethernet
« Reply #22 on: November 26, 2013, 02:04:17 PM »
Can you post a better picture of the actual card? Thanks!
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show only replies by tnt23
Re: Zorro III memory card... now with Ethernet
« Reply #23 on: November 26, 2013, 02:07:36 PM »
Quote from: Bobo68;753456
sgrab ?


Will take a look. So far I have tried MasterGrabber and GrabScreen, both kinda work, producing IFF files, and I was hoping for JPG/PNG output.
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show only replies by tnt23
Re: Zorro III memory card... now with Ethernet
« Reply #24 on: November 26, 2013, 02:28:07 PM »
Quote from: Themamboman;753467
Can you post a better picture of the actual card? Thanks!


I'm afraid this one is the best I can do without my DSLR (another one taken with flash is even worse). Should you want some particular closeup just let me know :)
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show only replies by tnt23
Re: Zorro III memory card... now with Ethernet
« Reply #25 on: November 29, 2013, 04:38:09 PM »
Quote from: olsen;753153
I had a quick look at the 3c589.device source code, and it looks good to me (I'd probably rewrite the basic device I/O code to be more paranoid, though, and the cleanup procedures in case of errors should be reworked).

So I've been having fun with sashimi and MiamiDX and at some point have tracked an issue with my driver's code freezing when calling S2_CopyToBuff hook. I will have a look into buffer management the MiamiDX provides when opening the device, but here's a piece of code (borrowed from the abovementioned 3c589 sources) that puzzles me.

An opener structure is being allocated:

Code: [Select]
/* Set up buffer-management structure and get hooks */

request->ios2_BufferManagement = opener = AllocVec (sizeof (struct Opener), MEMF_PUBLIC);

And then it is being filled using GetTagData () calls. If I get it right GetTagData () returns either found tag value or default value (second param). However, the same (uninitialized) opener->rx_function var is provided as the default value:

Code: [Select]
opener->rx_function = (APTR)GetTagData (rx_tags [i], (UPINT)opener->rx_function, tag_list);

This would probably make sense if the AllocVec () call used MEMF_CLEAR in addition to MEMF_PUBLIC, but this is not the case. Even if the allocated memory has been zeroed previously why not provide NULL as the default value? The same very source uses NULL just a couple lines of code further:

Code: [Select]
opener->filter_hook = (APTR)GetTagData (S2_PacketFilter, NULL, tag_list);
opener->dma_tx_function = (APTR)GetTagData (S2_DMACopyFromBuff32, NULL, tag_list);

Or perhaps there is some reason of (not) doing so?

Looked into cnetdevice assembler sources, default value is also NULL:

Code: [Select]
; get copyfrom functions:

 move.l  #S2_COPYFROMBUFF,d0
 moveq   #0,d1
 move.l  a2,a0
 jsr     _LVOGetTagData(a6)

« Last Edit: November 29, 2013, 04:41:12 PM by tnt23 »
 

Offline nyteschayde

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
Re: Zorro III memory card... now with Ethernet
« Reply #26 on: November 29, 2013, 09:20:51 PM »
This is awesome and please don't take this question as a complaint, but with RAM being so cheap, why only 64MB? Is there some limitation that I'm unaware of? Is this so it can be used in Zorro II in addition to Zorro III? I actually am unaware of the limitation per card for these devices in regards to addressable memory.
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline Vlabguy1

  • Hero Member
  • *****
  • Join Date: Aug 2006
  • Posts: 1262
    • Show only replies by Vlabguy1
Re: Zorro III memory card... now with Ethernet
« Reply #27 on: November 29, 2013, 09:28:44 PM »
Very cool..
 

Offline magnetic

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2531
    • Show only replies by magnetic
Re: Zorro III memory card... now with Ethernet
« Reply #28 on: November 30, 2013, 02:06:48 AM »
Yes very exciting GOGOGOGOGGOGOGGOGO
bPlan Pegasos2 G4@1ghz
Quad Boot:Reg. MorphOS | OS4.1 U4 |Ubuntu GNU-Linux | MacOS X

Amiga 2000 Rom Switcher w/ 3.1 + 1.3 | HardFrame SCSI | CBM Ram board| A Squared LIVE! 2000 | Vlab Motion | Firecracker 24 gfx

Commodore CDTV: 68010 | ECS | 9mb Ram | SCSI -TV | 3.9 Rom | Developer EPROMs
 

Offline olsen

Re: Zorro III memory card... now with Ethernet
« Reply #29 from previous page: November 30, 2013, 09:15:00 AM »
Quote

...

This would probably make sense if the AllocVec () call used MEMF_CLEAR in addition to MEMF_PUBLIC, but this is not the case. Even if the allocated memory has been zeroed previously why not provide NULL as the default value? The same very source uses NULL just a couple lines of code further:

Code: [Select]

opener->filter_hook = (APTR)GetTagData (S2_PacketFilter, NULL, tag_list);
opener->dma_tx_function = (APTR)GetTagData (S2_DMACopyFromBuff32, NULL, tag_list);


Or perhaps there is some reason of (not) doing so?


As far as I can tell (the callbacks are initialized exactly once), this is risky, and there is no benefit in initializing the callbacks in this manner.

I would not call it a bug, since every client of the SANA-II driver is likely to provide the proper callbacks. But if it does not, for some reason, then the device will crash.

The 3c589.device should be more paranoid, and verify that each parameter provided by the client is sound.

I already put a snapshot of the whole 3c589.device/pccard.library source code into my SVN repository, for rework, but there's been too little time to rework it so far :-(