Welcome, Guest. Please login or register.

Author Topic: Diskless booting of Amiga  (Read 9022 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
Diskless booting of Amiga
« on: June 06, 2013, 09:05:10 PM »
Is it possible to network boot an Amiga without any disk system whatsoever? (no floppy, hdd etc) Especially is there any code in Kickstart to support this?

Some systems just can't be without their boot blocks.

Like PXE on PCs.
 

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
Re: Diskless booting of Amiga
« Reply #1 on: June 06, 2013, 10:02:49 PM »
Kind of reminds me of harddisk controllers. They often have a boot-ROM. Perhaps pre-loading filesystem via a ROM driver is the only way to do it?

Guess that would be:
CPU loads cold boot vector
Kickstart runs
Kickstart jumps to expansion ROM that set jump table to filesystem driver
Kickstart resumes to boot fully
User see boot screen
?
 

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
Re: Diskless booting of Amiga
« Reply #2 on: June 07, 2013, 03:00:37 PM »
Ok so the recpipe is an extension (EEP)ROM that contains hardware driver, UDP/IP stack, NFS driver.

So does existing hardware drivers, UDP/IP, NFS etc support being ROM:ed ?

Found this ROM collection that perhaps can be used for decompilation:
http://amigaromarchives.limewebs.com/
« Last Edit: June 07, 2013, 03:15:13 PM by freqmax »
 

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
Re: Diskless booting of Amiga
« Reply #3 on: June 07, 2013, 03:28:49 PM »
Catch, I like a clean solution without extra drives clogging up the memory ;)
Ie a computer environment with only NET: not RAD: + NET:

Exec from kickstart v1.2 hints about expansion ROM at 0xF0 0000:
http://wandel.ca/homepage/execdis/exec_disassembly.txt

Perhaps useful:
http://wiki.amigaos.net/index.php/Expansion_Library#The_Expansion_Sequence

Amiga device driver guide:
http://wandel.ca/homepage/execdis/devices_doc.txt

RAM drive disassembly:
http://wandel.ca/homepage/execdis/ramdrive_disassembly.txt

Anyone found source code for a ROM:able driver?
« Last Edit: June 07, 2013, 03:36:32 PM by freqmax »
 

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
Re: Diskless booting of Amiga
« Reply #4 on: June 07, 2013, 10:05:16 PM »
Once you have a fileserver in your network. It makes upgrades etc way easier by just plugging in a network cable and just boot. Centralized backup etc.

The blocks on the disk is only needed to find where filedirectory is? and Amiga kickstart only need specific files? I have a memory it's possible to boot with an empty floppy and get CLI prompt in 320 pixel wide shell window?

So how should a expansion ROM driver that hooks into the filesystem layer look like? a SCSI ROM ought to hook itself into the block layer.
An experimental ROM could provide a preloaded boot disk from ROM just to see if it works.
 

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
Re: Diskless booting of Amiga
« Reply #5 on: June 07, 2013, 11:22:41 PM »
The catch is that AROS 68k doesn't run on the (E)UAE on unix..
But the AROS 68k source code could hint on the hooks required to write a driver. And perhaps some driver for MS-FAT could give enough info on how to provide a filesystem. Ie instead of calling a blockdriver it would call a network driver and supply filenames instead of sector numbers.

Anyway, looking at the nice illustration here:
http://www.jeacle.ie/pub/articles/amitcp/


It seems what has to be preloaded is:
 * SANA-II device driver for Ethernet
 * AmiTCP driver for SANA-II
 * NFS driver for AmiTCP

Such that Kickstart ask "nfs.driver" .. "dude where's my startup-sequence?" .. "dude where's my demo.lha?" etc..

Seems PUAE supports emulation of bsdsocket.library. The catch being that it may be in an unconsistent state at boot time. And will not allow itself to be preloaded..

A source for a skeleton file handler (device) that will attach itself at boot will go a long way.
« Last Edit: June 07, 2013, 11:26:03 PM by freqmax »
 

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
Re: Diskless booting of Amiga
« Reply #6 on: June 08, 2013, 01:20:18 AM »
Some further thoughts:

MessyDOS (MSH) consists of file handler (vfat) and device driver (mfm). The source is included as well. If one removes the mfm part and rewrites the vfat. It could be a base for a network filesystem.

How would one transform it to be a expansion ROM image and show up at boot by installing it as a ROM at 0xF0 000 instead of enabling it when running the operating system?
 

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
Re: Diskless booting of Amiga
« Reply #7 on: June 08, 2013, 01:55:03 PM »
anfs seems interesting.

Quote
@freqmax: A block device filesystem has little to do with a network filesystem.
Sure, but it also has a part which handles requests for files, and that part can be used as a basis to serve files with other methods.

And I like a clean solution that makes it possible to use RAD:, RAM:, DF0: etc for other things. It might also be hard to make that RAD: if there's nothing drive at all to begin with.
 

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
 

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
Re: Diskless booting of Amiga
« Reply #9 on: June 08, 2013, 04:27:51 PM »
Perhaps this is homing in on how to do it:
archive.org: 1993 Thomson randy Rhett anderson Mapping Amiga 2nd edition

"Here is a sample structure, Resident, which is used to make programs that can
survive a reboot."

If it's simple as making a program resident when running the computer under normal conditions. And when it works just write it to a ROM memory area. It would be very simple indeed. Perhaps this is the way RAD: survives too?

Include File: exec/resident.h

elowar.com: exec/resident.h
Code: [Select]
struct Resident {
    UWORD rt_MatchWord; /* word to match on (ILLEGAL) */
    struct Resident *rt_MatchTag; /* pointer to the above */
    APTR  rt_EndSkip; /* address to continue scan */
    UBYTE rt_Flags; /* various tag flags */
    UBYTE rt_Version; /* release version number */
    UBYTE rt_Type; /* type of module (NT_XXXXXX) */
    BYTE  rt_Pri; /* initialization priority */
    char  *rt_Name; /* pointer to node name */
    char  *rt_IdString; /* pointer to identification string */
    APTR  rt_Init; /* pointer to init code */
};

And a dissembly of the ramdrive.device RAD: for comparision with above:
wandel.ca: ramdrive_disassembly.txt (Commodore-Amiga Ram Drive 1.0 1988-04-06)
Code: [Select]
000004  4AFC                         RT_MATCHWORD
000006  0000 0004                    RT_MATCHTAG - pointer back to above
00000A  0000 026C                    RT_ENDSKIP
00000E  01                           RT_FLAGS - RTF_COLDSTART is set
00000F  01                           RT_VERSION
000010  03                           RT_TYPE - NT_DEVICE
000011  14                           RT_PRI - Priority 20
000012  0000 0142                    RT_NAME
000016  0000 0152                    RT_IDSTRING
00001A  0000 026C                    RT_INIT

Is it as simple to just put the above structure in a EEPROM and make it available in the 68k memory space ..?
« Last Edit: June 08, 2013, 04:42:26 PM by freqmax »
 

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
Re: Diskless booting of Amiga
« Reply #10 on: June 08, 2013, 05:30:29 PM »
So where do I find the source code for a boot ROM ..?

Anyway it seems the RAD: calls AddDevice(), MakeDOSNode(), Enqueue(), OpenLibrary()/RT_INIT to add itself to the system after reboot.
(MakeLibrary()?)

Found this amigaos.net/../Example_Device but it's still a block one.

http://wandel.ca/homepage/amiga_sw/scsi/autoboot.txt
Quote
(2) Get "ramkick" from the 1.4 Alpha 16 (or higher) release, and use it
    to install the module "bootstrap".  This is untested, as I don't have
    1.4 Alpha 16, and therefore don't have "ramkick".

This wandel.ca/../devices_doc.txt says it:
Quote
Devices in ROM are found during a scan of the entire ROM for RomTag
structures.
 

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
Re: Diskless booting of Amiga
« Reply #11 on: June 08, 2013, 07:05:00 PM »
So is NetFS "clean" ?
 

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
Re: Diskless booting of Amiga
« Reply #12 on: June 08, 2013, 10:48:17 PM »
anfs + LoadModule seems neat but looking at the anfs source code deeply. One can see that it uses a global variable Global_T defined for use in nfs_handler.c. The next catch is that one needs to tell nfs_handler what to do ie "anfs server:/amigasystem BOOT:".

Perhaps some "Global_T *g" combined with "g = (Global_T *)malloc(..)" and instead of ParseArgs() one can write DCHP_Args() or DummyArgs(). Would solve these issues?

So perhaps this would work:
 * Make globals allocated with malloc()
 * Write static ParseArgs()
 * Call "LoadModule"
 * Save the module from RAM to a file
 * Write said file onto a EEPROM
 * Done?


Something I just can't get is how it uses FindDosEntry() just to collision detect the local devicename and then go on with AddDosEntry() and be able to receive (DOS) packets with Wait() for said local volume, ie if one open() a file or similar. But how does Wait() know which filesystem eg "BOOT:" that is sought? nfs_handler.c has to supply it somewhere?

(FindDosEntry() and AddDosEntry() seems to use struct DevInfo for "name" info)

Perhaps dosextens.h define is the solution to dos.library existance early in the boot process?:
Quote
#define DLT_LATE   3   /* late-binding assign */

(Source code for the DLT_LATE seems to be possible to read at label "AssignLate" in the DOS.lzx archive of dos.library.asm)
« Last Edit: June 08, 2013, 11:51:53 PM by freqmax »
 

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
Re: Diskless booting of Amiga
« Reply #13 on: June 08, 2013, 10:56:59 PM »
Regarding the thread at abime.net:

The following has to be present in ROM:
 * SANA-II driver (for network hardware)
 * IP + UDP stack
 * NFS client

He says dos.library has to be present. Perhaps one could rather add a hook that will be activated when said library is present? it could then initialize SANA-IP-UDP-NFS in one go.

If there absolutely has to be a "disk" present. One could create a few kB "ROM:" with a bootblock and directory entry. Once dos.library feels to show up one does a switch-and-bait and changes this so that it will access the NFS server instead. Just like one can replace files on a live filesystem under NFS/unix.
 

Offline freqmaxTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show all replies
Re: Diskless booting of Amiga
« Reply #14 on: June 09, 2013, 12:11:52 AM »
Found this nice example in comp.os.research in 1993:
User-level Filesystems (was Re: Plan 9)
Quote
Nice example.  For comparison, I'll post an AmigaDOS filesystem.  I'm
writing this off the top of my head, so it probably would need tweaking to
compile.  AmigaDOS, like QNX, converts requests into messages sent to a user-
level process.  I'll try to keep it short and leave out non-relevant parts,
including most of the error-checking.

        Note: this is for a ram disk.  Also, for historical reasons from
Tripos and BCPL, many DOS pointers are BPTR's (longword offsets; i.e. pointers
shifted right by 2.  Ugh.)

Code: [Select]
#include <various header files>

struct DosPacket {
   struct Message *dp_Link;      /* EXEC message              */
   struct MsgPort *dp_Port;      /* Reply port for the packet */
                                 /* Must be filled in each send. */
   LONG dp_Action;               /* See ACTION_... below and
   LONG dp_Res1;                 /* For file system calls this is the result
                                  * that would have been returned by the
                                  * function, e.g. Write returns actual
                                  * length written */
   LONG dp_Res2;                 /* For file system calls this is what would
                                  * have been returned by IoErr() */
   LONG dp_Arg1;                    
   LONG dp_Arg2;
   LONG dp_Arg3;
   ...

};

struct node *root;
struct lock *lock_list;
struct MsgPort *MyPort;
LONG res1,fileerr;

main (struct DosPacket *dp) {
        struct Message    *msg;
        struct DeviceList *devnode,*newnode;
        struct node *node;
        ULONG arg1;

        /* various shared library opens/inits */
        ...

        MyPort = &(FindTask(NULL)->pr_MsgPort);

        root = (struct node *) AllocVec(sizeof(struct node),MEMF_CLEAR);
        root->type = ST_USERDIR;
        strcpy(root->name,&quot;Ram Disk&quot;);
        lock_list  = NULL;
        spaceused  = 1;

        /* add our volume entry to the system */
        newnode = MakeDosEntry(&quot;Ram Disk&quot;,DLT_VOLUME);
        newnode->dl_Task     = MyPort;
        newnode->dl_DiskType = ID_DOS_DISK;
        DateStamp(&(newnode->dl_VolumeDate));
        AddDosEntry(newnode);

        /* our Device node already exists - BPTR */
        devnode = (struct DeviceList *) (dp->dp_Arg3 << 2);
        devnode->dl_Task = MyPort;

        /* init finished successfully, tell system we're ready */
        ReplyPkt(dp,DOS_TRUE,0);

        while (1) {
            sigs = Wait(1L << MyPort->mp_SigBit);

            /* handle dospackets */
            while ((msg = GetMsg(MyPort)) != NULL)
            {
                dp = (struct DosPacket *) msg->mn_Node.ln_Name;

                /* set result to failure, clear secondary result */
                res1 = fileerr = 0;

                /* used by most functions-usually BPTR to filehandle or lock */
                arg1 = dp->dp_Arg1 << 2;       /* save space, do it once */

                switch (dp->dp_Action) {
                case ACTION_WRITE:      /* Write(fh,buffer,len) */
                        res1 = write((struct lock *) arg1,
                                     (CPTR) dp->dp_Arg2, dp->dp_Arg3);
                        break;
                case ACTION_READ:       /* Read(fh,buffer,len */
                        res1 = read((struct lock *) arg1,
                                    (CPTR) dp->dp_Arg2, dp->dp_Arg3);
                        break;
                case MODE_NEWFILE:      /* fh = Open(name,MODE_NEWFILE) */
                        flag = 0;
open:
                        res1 = openmakefile(
                                       (struct FileHandle *) arg1,
                                       (struct lock *) (dp->dp_Arg2 << 2),
                                       BtoC(str1,dp->dp_Arg3),
                                       flag);
                        break;
                case ACTION_END:        /* aka Close(fh) */
                        res1 = closefile((struct lock *) arg1);
                        break;
                etc...

                case ACTION_INHIBIT:
                case ACTION_GET_BLOCK:
                case ACTION_MORE_CACHE:
                default:
                        fileerr = ERROR_ACTION_NOT_KNOWN;
                } /* switch */

                /* we've handled the packet, return it */
                ReplyPkt(dp,res1,fileerr);

            } /* while GetMsg */
        } /* while 1 */
}


Hint at function replacements over kickstart versions?
abime.net/attachment.php?attachmentid=33641&d=1356876093
Quote
To reduce code size, can use V36+ functions like LockDosList() instead of Forbid()/Permit(), and MakeDosEntry(). Also use RemDosEntry() and FreeDosEntry() to replace most of code in RemoveFreeDosEntry routine at offset $3352.
« Last Edit: June 09, 2013, 12:16:52 AM by freqmax »