Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sample 6502 code for programming the Uthernet

62 views
Skip to first unread message

D Finnigan

unread,
Feb 20, 2013, 6:45:19 PM2/20/13
to
Some visitors to Mac GUI recently probably saw the picture of UDP
communication with the Apple IIe where I was sending UDP packets to the
Apple IIe over the Uthernet card and printing them on the screen in ASCII.

All this code I have written for the Uthernet hopefully will appear in a
future Juiced.GS article, also with full explanation of how to program the
Uthernet with its CS8900A Ethernet chip and PacketPage memory addresses.

In the mean time, starting now, all my Apple II code that I will write will
be PUBLIC DOMAIN. That includes this Uthernet code.

I have Ethernet packet send and receive code, as well as Uthernet
configuration code that will set the MAC address and configure the Uthernet
for send and receive. I also have code that sends a gratuitous ARP.

All of it is in 6502 machine code, but I have added comments to it all.

If you can't wait for the Juiced.GS article, I will be glad to send the code
to anyone who asks. You will get ASCII source files.

In the future I want to write some code for an IP stack. We'll see where
this goes. :-)

--
]DF$
Apple II Book: http://macgui.com/newa2guide/
Usenet: http://macgui.com/usenet/ <-- get posts by email!
Apple II Web & Blog hosting: http://a2hq.com/

Egan Ford

unread,
Feb 20, 2013, 6:53:24 PM2/20/13
to
On 2/20/13 4:45 PM, D Finnigan wrote:
> In the future I want to write some code for an IP stack. We'll see where
> this goes. :-)

Isn't there already some 6502 IP code floating around? I think I have
it somewhere on my HD.

I'm still waiting for the Uthernet to go back on sale.

Is there PPP or SLIP 6502 (Apple II preferred) code floating around?

D Finnigan

unread,
Feb 20, 2013, 7:01:50 PM2/20/13
to
Egan Ford wrote:
> On 2/20/13 4:45 PM, D Finnigan wrote:
>> In the future I want to write some code for an IP stack. We'll see where
>> this goes. :-)
>
> Isn't there already some 6502 IP code floating around? I think I have
> it somewhere on my HD.

Yes, that's IP65. Which is open-source, but not public domain.

My code was written based only on the CS8900A technical reference and the
relevant RFCs for TCP/IP and Ethernet networking.

>
> Is there PPP or SLIP 6502 (Apple II preferred) code floating around?

I don't think so. SLIP is super-simple to implement. We could have had
TCP/IP over SLIP 25 or more years ago with our Super Serial Cards, but there
was no motivation to implement it. No one had TCP/IP networks in their homes
back in the 80s.

My design plans for a new IP stack include two network interfaces: one for
the Uthernet, and another for the Super Serial Card using SLIP.

All of this is on paper right now. I only have working code for the Uthernet
device driver, as well as the demonstration code that prints the data
payload of UDP packets (it dumbly assumes that all incoming packets are of
type UDP).

Egan Ford

unread,
Feb 20, 2013, 7:44:32 PM2/20/13
to
On 2/20/13 5:01 PM, D Finnigan wrote:
> My design plans for a new IP stack include two network interfaces: one for
> the Uthernet, and another for the Super Serial Card using SLIP.

If you need a beta tester let me know.

Now I need a SLIP/Ethernet or SLIP/Wifi bridge. Thinking RPi. It would
be nice to build something smaller that would just stick to the SSC DB25.

D Finnigan

unread,
Feb 20, 2013, 7:56:24 PM2/20/13
to
Egan Ford wrote:
> On 2/20/13 5:01 PM, D Finnigan wrote:
>> My design plans for a new IP stack include two network interfaces: one
>> for
>> the Uthernet, and another for the Super Serial Card using SLIP.
>
> If you need a beta tester let me know.

Will do.

I want to make the API look like BSD sockets. :-)
I think I can manage.

Distant future plans involve wrapping the TCP/IP stack into a larger
multi-tasking operating system. I have a 1 MB RamWorks Apple IIe with all
the hardware to support a multitasking OS. Just need to write the code. It's
a legend.

>
> Now I need a SLIP/Ethernet or SLIP/Wifi bridge. Thinking RPi. It would
> be nice to build something smaller that would just stick to the SSC DB25.

Wi-Fi on the Apple II would be really neat. If Glenn Jones gets this out to
us, I'd be happy to write a device driver for it.
http://www.a2retrosystems.com/blog/?p=166

Egan Ford

unread,
Feb 20, 2013, 8:13:42 PM2/20/13
to
On 2/20/13 5:56 PM, D Finnigan wrote:
> Distant future plans involve wrapping the TCP/IP stack into a larger
> multi-tasking operating system. I have a 1 MB RamWorks Apple IIe with all
> the hardware to support a multitasking OS. Just need to write the code. It's
> a legend.

I'm thinking simple things like a VT100 telnet client. SSH if the 6502
can handle it. Twitter perhaps. It would make development and testing
easier if Virtual ][ emulated Uthernet. IIRC, AppleWin supports it.

> Wi-Fi on the Apple II would be really neat. If Glenn Jones gets this out to
> us, I'd be happy to write a device driver for it.
> http://www.a2retrosystems.com/blog/?p=166

That was posted over a year ago. I wonder if he is still around. :-)

D Finnigan

unread,
Feb 20, 2013, 9:51:21 PM2/20/13
to
Egan Ford wrote:
> On 2/20/13 5:56 PM, D Finnigan wrote:
>> Distant future plans involve wrapping the TCP/IP stack into a larger
>> multi-tasking operating system. I have a 1 MB RamWorks Apple IIe with all
>> the hardware to support a multitasking OS. Just need to write the code.
>> It's
>> a legend.
>
> I'm thinking simple things like a VT100 telnet client. SSH if the 6502
> can handle it. Twitter perhaps. It would make development and testing
> easier if Virtual ][ emulated Uthernet. IIRC, AppleWin supports it.

Probably the top-priority for me after a telnet client would be an AppleTalk
over Ethernet client so I can do AppleShare.

The only problem: I need AppleTalk documentation, which I lack right now.
:-(

Once you got over the public-key cryptography algorithms, SSH shouldn't be
too bad.

>
>> Wi-Fi on the Apple II would be really neat. If Glenn Jones gets this out
>> to
>> us, I'd be happy to write a device driver for it.
>> http://www.a2retrosystems.com/blog/?p=166
>
> That was posted over a year ago. I wonder if he is still around. :-)
>

I believe he's still among the living.

Steven Hirsch

unread,
Feb 21, 2013, 9:29:42 AM2/21/13
to
On 02/20/2013 09:51 PM, D Finnigan wrote:

>> I'm thinking simple things like a VT100 telnet client. SSH if the 6502
>> can handle it. Twitter perhaps. It would make development and testing
>> easier if Virtual ][ emulated Uthernet. IIRC, AppleWin supports it.
>
> Probably the top-priority for me after a telnet client would be an AppleTalk
> over Ethernet client so I can do AppleShare.
>
> The only problem: I need AppleTalk documentation, which I lack right now.

Last I looked, "Inside AppleTalk" was a freebie. If you cannot find it, give
me a yell privately. I think AFP-over-TCP may be a stretch, though. You
probably should stick with AFP-over-DDP.

Those few of us with Apple-prototype ethernet cards (well, one of us - Tony
Diaz) are able to run Appletalk over an ethernet link right now. I'm not sure
how much of the smarts for that were on the card. Geoff Body probably knows
more about this than anyone else here.




David Schmidt

unread,
Feb 21, 2013, 10:39:45 AM2/21/13
to
On 2/21/2013 9:29 AM, Steven Hirsch wrote:
> Those few of us with Apple-prototype ethernet cards (well, one of us -
> Tony Diaz) are able to run Appletalk over an ethernet link right now.
> I'm not sure how much of the smarts for that were on the card.

Hint: just about all of it. It had/has its own CPU.

Sean Fahey

unread,
Feb 21, 2013, 12:44:23 PM2/21/13
to
On Thursday, February 21, 2013 9:39:45 AM UTC-6, schmidtd wrote:

> > Those few of us with Apple-prototype ethernet cards (well, one of us -
> > Tony Diaz) are able to run Appletalk over an ethernet link right now.
> > I'm not sure how much of the smarts for that were on the card.
>
> Hint: just about all of it. It had/has its own CPU.

<facepalm>
Argh - I forgot to send you my Apple Ethernet card and the other serials)!
</facepalm>

We need to clone the Apple card and just call it the official board.

D Finnigan

unread,
Feb 21, 2013, 4:25:07 PM2/21/13
to
Steven Hirsch wrote:
> On 02/20/2013 09:51 PM, D Finnigan wrote:
>
>>> I'm thinking simple things like a VT100 telnet client. SSH if the 6502
>>> can handle it. Twitter perhaps. It would make development and testing
>>> easier if Virtual ][ emulated Uthernet. IIRC, AppleWin supports it.
>>
>> Probably the top-priority for me after a telnet client would be an
>> AppleTalk
>> over Ethernet client so I can do AppleShare.
>>
>> The only problem: I need AppleTalk documentation, which I lack right now.
>
> Last I looked, "Inside AppleTalk" was a freebie. If you cannot find it,
> give me a yell privately. I think AFP-over-TCP may be a stretch, though.
>
> You probably should stick with AFP-over-DDP.

Thanks. I see that the 2nd edition is used on Amazon for reasonable prices,
so I'll probably buy it there. I prefer having the hard copy book.

D Finnigan

unread,
Feb 21, 2013, 4:30:34 PM2/21/13
to
Sean Fahey wrote:
>
> We need to clone the Apple card and just call it the official board.

Now that we have the firmware and device driver, cloning the hardware is the
last step needed.

Egan Ford

unread,
Feb 21, 2013, 5:19:09 PM2/21/13
to
On 2/21/13 7:29 AM, Steven Hirsch wrote:
> Last I looked, "Inside AppleTalk" was a freebie.

Can you look again?

I lent out my copy 20 years ago and never got it back.

I found a PDF floating around, but the diagrams are missing in the
Introduction section.

Steven Hirsch

unread,
Feb 21, 2013, 6:22:29 PM2/21/13
to
Does anyone have one of these to donate for depopulation and
reverse-engineering? Does it have programmable logic? And if yes to the
last, are the security fuses blown?


0 new messages