Installation notes for the AmigaDOS(tm) Virtual File System under
Amiga(tm) Unix(tm) Version 2.x or later.

$Id: INSTALLATION,v 1.2 1992/11/23 03:27:13 root Exp root $
--
AmigaDOS and Amiga are trademarks of Commodore Business Machines.  Unix
is a trademark of Unix System Laboratories.
Copyright (c) 1991, 1992 by Frank J. Edwards
All rights reserved.  (However, I'm flexible.  Go ahead and ask. :-)
--
[Well, I think it's done!  And it's only been 12 months or more!]

This package contains my latest version of the AmigaDOS virtual filesystem
for use under Amiga Unix versions 2.03 and later.  (Note that in order
to use CFLOW or LINT on this code requires fixes to the "sys/immu.h" and
"sys/inline.h" files which don't properly check for "#ifdef lint" when
using the GNU compiler in certain cases.)

This kernel modification allows a user with appropriate privileges to
"mount" an AmigaDOS filesystem (DOS0, DOS1, DOS2, DOS3, DOS4, or DOS5)
under Unix.  Currently, I've only finished read-only support.  There will
be a read-write version available in the future, although the terms of
its distribution have yet to be decided.  Note that source for this
read-only version is provided; however, I retain the copyright on all
code included here.  As Ford's and Keith's help was invaluable, I'm
providing source as a demonstration to others that it really _can_ be
done and as a jumping off point.  Future releases may or may not be in
source form.

Unshar the two parts and concatenate.  Then uudecode to generate a Zoo
file with a ".zoo" extension.  (If you don't have a Zoo executable, I can
email you one.  Or use Ford's ARUN program and an AmigaDOS version!  Or
obtain the sources from comp.sources.unix and compile your own.)

[Some distributions of this code may be simple compressed files.  After
uudecoding, examine the resulting file's name.  If it ends in ".Z",
uncompress that file, generating a ".tar" file, and then run "tar"
instead of Zoo in the following instructions.]

Read through the entire set of directions until you have an understanding
of what procedures you will be using to extract and install these files.
Make a note of any files that will be modified that you may wish to backup
first.  For instance, "/etc/vfstab".  After you've read through the
instructions once, read them again!  (Just in case. :-)  Then proceed to
the next step which describes making a backup.

All of the install files will be in a subdirectory of /usr/sys/local.  It
is my suggestion that you backup that directory first, perhaps just a
"tar -cvf local.tar /ysr/sus/local" would be sufficient.  The instructions
which follow will create files and directories below that point, and will
modify the Makefile that is in that directory, hence the backup.

The zoo file should be placed in /usr/sys/local and extracted using "zoo
x// ados_vfs" which will create a directory heirarchy with ADOS at the
top and a file called "Makefile.ADOS".  The new makefile should be
copied to the existing "Makefile" in that directory (/usr/sys/local). 
Below that will be the directories "source", "master.d", and "mount". 
The "mount" directory should either be moved or copied to /usr/lib/fs/ados.
A symbolic link from /usr/lib/fs/ados to the newly created directory
would also work.  "master.d" contains two files that need to be in
"/usr/sys/master.d" -- copy them, I suppose, but save your originals
first (the originals in that directory will not have been saved
automatically by the backup you did above unless you used a different
command).  The "source" directory contains the real code for the vfs.
In the "sbin" directory is a shell script called "addados" which will
add entries to your /etc/vfstab if you give it a device name on the
command line.  Basically it scans the output of "rdb -H" and puts all
supposedly AmigaDOS partitions at the end of the vfstab.  Read the first
few lines of that shell script for details, in addition to the usage notes
below.

[There will be a script called "fixproto" that you won't have on your
machine.  It's job is to create a prototypes file for the provided
source.  My "source/Makefile" uses this to see if the prototypes header
file is out of date and conditionally rebuild the source in that
directory.  It's not needed for what you're going to do, and
"source/Makefile" should not even try to use it.]

I provided an executable for "mount" since it was so small.  There's
also a program called "lsfs" in the same directory which simply lists
out the contents of the vfssw table in the kernel; used to verify that
"ados" really did get linked into the operating system.
------------------------------------------------------------------------
Alright, enough of all that.  Now to the good part.

Run addados and give it a partition name of a drive in your system.
Such as,

    # addados c6d0s0
    ...

and it'll add all AmigaDOS partitions on that drive to your /etc/vfstab.
Check the vfstab just to make sure there aren't any syntax errors.  ;-)

Change directory to /usr/sys and rebuild the kernel using "make force"
or something similar.  If it built okay, install it and reboot.  (There
will be two warnings during compilation of "debug.c", and a single
"incompatible assignment" warning during "vfsops.c" at or near line 78. 
I'm not concerned about the first two, and unfortunately there's nothing
I can do about the second without changing the system include headers,
and I don't want to do that.)

Log in as root.  If you want to see trace output of what the vfs is
doing, you can run "strace" in a terminal session somewhere else while
you work on the console.  All of the debugging output by the vfs goes
into the STREAMS trace log by default; normally that data is thrown
away, but if you run strace you'll get to see it.  Or rather, most of
it.  The kernel can output data to a user process faster than the user
process can gather it and display it, so you'll likely see jumps in the
sequence number (first column of output of strace).

Then type:

    # mount /Work
       - or -
    # mount /WB_2.x

to mount whichever of those might appear on your "drive #6" from the
"addados" command, above.  There'll be some disk activity and when
the prompt returns, try out "ls -lF /WB_2.x" and see what you get!

You'll note quite a time lag when reading any AmigaDOS directory that
contains a number of subdirectories.  This is because I wanted to fill
in the "link count" field of the Unix <stat> structure and the only
way to do so was to traverse all of the directory hash chains for one
level down.  (Perhaps Randall could arrange for the fourth longword of
the directory key block to contain a number_of_blocks value like it
does for ordinary files!? ;-)

Adding an entry for the floppy should be simple once you see what the
format in the /etc/vfstab file looks like, but here's my entry:

    /dev/dsk/fd0 /dev/rdsk/fd0	 /floppy ados	2	no	l=1760,ro

You'll note that all of the entries have "ro" tacked onto the end.
The filesystem expects the mount command to pass it the read-only flag
set, so don't remove those two letters!

I don't have manual pages yet for "mount" and "addados", but I'll put
them together soon -- they're not very tough.  In addition, I'll
probably document what I've discovered about the format of the AmigaDOS
filesystem structure.

Good luck with the installation, and let me know what you think.
I thrive on attention from my fans.  <grin>
-- 
Frank "Crash" Edwards            Edwards & Edwards Consulting
Fax:  813/786-6526               [Our office is moving; watch this space
Home: 813/786-3675               for the new phone number.]
    "You can't have everything.  Where would you put it?"
	    -- Steven Wright
