[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What makes AppleShare special?



Tristan Mumford <xtristan.xmumford@xgmail.xcom> wrote:

> I have resumed my experiments on remotely booting my IIgs, and how things
> react to it. It's definitely a learning experience!
> 
> I haven't made GS/OS boot properly yet. By that I mean it loads its core and
> then whatever program is specified in the startup option in the AppleShare
> server... Unless its something like Finder. That just dies.
> I believe that's just the fault of a version mismatch I inadvertently
> introduced. It can load some prodos16 and every prodos8 program I have
> tried so far.
> 
> After it loads prodos8, I noticed that it is network aware. Ie instead of a
> slot allocation for a volume it reported the remote volume as "Network".
> 
> This is what got me wondering. Is there something special about AppleTalk
> built into ProDOS, or is it just a generic networking interface.

AppleTalk and AppleShare support is a complex beast. Here is a quick
explanation of how it works in the areas I understand.

1. ProDOS-8 on an Apple IIe with an AppleTalk Network Card

This was the original implementation. The AppleTalk card has its own
processor and a fair amount of memory. It is hooked into the ProDOS MLI
main entry point, so it gets first crack at all MLI calls, intercepting
those which deal with accessing the file server and passing the rest
back to the MLI for local access.

The "hook in" mechanism is achieved through a file called ATINIT.
ProDOS-8 (from about version 1.5) looks for this file in the root
directory when booted directly, and if present, it loads and executes it
(I don't known where it is loaded into RAM).

The AppleTalk card implements most of the standard MLI calls for
file-level access. You can't do low-level block reads or writes to a
network volume. It also adds some extra calls to the MLI which are used
for network-specific operations (don't recall the details offhand,
probably includes connecting to a server and disconnecting, for
example).

I don't remember how the AppleTalk card deals with the ProDOS concept of
the current unit. I suspect it is not valid while accessing a network
volume. Network volumes are only accessed by pathname (possibly
involving the prefix, as normal).

There are several versions of the ATINIT file:

(a) The one supplied with the AppleTalk Network Card. This contains code
which looks for the card and hooks it into the MLI.

(b) A IIgs-specific one that was licenced by Apple to third parties,
which allows the use of a nework printer when booting directly into
ProDOS-8. This contains code which is installed in another bank, hooks
into ProDOS and makes use of the AppleTalk support code in the IIgs
firmware to implement a bare minimum of AppleTalk features to allow the
use of printers (LLAP, DDP, NBP, ATP and PAP).

(c) The one supplied with GS/OS. This contains no code at all (its first
byte is an RTS.) This normally resides somewhere like */SYSTEM/DRIVERS.

In addition to containing code to patch ProDOS, all versions of the
ATINIT file end with a data block which contains network configuration,
such as the chosen printer. To deal with the variable sized chunk of
code at the beginning, this data is located by counting backwards from
the end of the file.

2. ProDOS-16 when booted from a local volume.

My memory is very hazy on this one, and I haven't looked at it in
detail. I remember seeing files called ATP1.ATROM and ATP2.ATRAM (or
similar). I know that these contain patches for the ROM-based AppleTalk
support code, and adding further layers of the protocol stack.

Under the hook, I expect the mechanism works somewhat like ProDOS-8,
with calls being pre-processed by a network hook then passed back to the
kernel if the request is for a local device.

3. GS/OS when booting from a local volume.

AppleShare support is implemented mainly through the AppleShare FST,
which hooks into GS/OS in the same manner as other FSTs (undocumented),
allowing GS/OS applications to access the server through normal file
system calls. I don't recall how the AppleTalk protocol stack is loaded.

4. ProDOS-8 on a IIgs while booted from GS/OS.

GS/OS handles this when transferring control to ProDOS-8. It patches the
MLI vector to point to code which jumps into another bank to deal with
network-related file calls. The end result is similar to the AppleTalk
card in a IIe, except that the code is using the IIgs implementation of
the AppleTalk protocol stack (partly in ROM, partly patched in RAM, and
the rest loaded into RAM at GS/OS boot time).

5. Network booting.

This is a more complex operation which involves bootstrap loading in
various stages, and I haven't looked at it in detail. At some point,
START.GS.OS or ProDOS-8 should be loaded and have sufficient support
code beneath it to take over the rest of the boot sequence.


To answer your question: ProDOS-8 has very little specifically to
support AppleTalk built into the kernel, just the loading of the ATINIT
file at boot time (when booted directly). Everything else is handled by
external code which is patched into the kernel's MLI entry point.

ProDOS-16 is probably more aware of AppleTalk, but only to the extent of
being able to load some support files (if they are present) and they are
then responsible for inserting themselves into the system correctly.

GS/OS probably has no specific support for AppleTalk - it just loads
generic drivers and FSTs, some of which implement the AppleTalk and
AppleShare support which is then available through standard mechanisms.

> If so where can I find out about the APIs etc?

There are a couple of books which contain relevant data.

For general information about the AppleTalk protocol stack, you need
Inside AppleTalk, which was published by Addison Wesley.

For Apple II specific information, there was a looseleaf book published
through APDA that covers the internals of the AppleTalk support code,
including details about the extended MLI calls and some background on
the boot process.  I don't remember its exact name, but it is probably
something like "AppleShare Programming Guide for the Apple II". I have
it, but it is deeply buried in my basement.

> I just thought it would be nice to have support for other methods of
> filesharing. Ie something not so Apple specific.

ProDOS-8 could be patched in a similar way to support a different
network interface. It would need a card with a lot of memory and the
entire network support in a IIe, but might be possible to do in a IIgs
with code loaded outside banks 0 and 1.

Trying to do this sort of thing in GS/OS is anything from impractical to
impossible, as you would need an FST to hook it into the operating
system in a way that users would like, and the FST to GS/OS layer is
undocumented.

-- 
David Empson
dempson@actrix.gen.nz