Descr:  NetBSD/Amiga bootstrap loader
Author: Michael van Elst
Uploader: Michael van Elst
Keywords: loadbsd boot kernel

The original loadbsd program requires the presence of ixemul.library
on the system disk. This also requires an existing ASSIGN for
ENV: and possibly for LIBS:.

In an effort to write a real RDB-installable bootloader I started
with a gobsd tool that replicates the loadbsd functionality and
compiles with SAS C. It no longer needs anything else on the
disk and should work with no startup-sequence.

Under AmigaOS2.0+ it will use standard ReadArgs() argument passing.
Under AmigaOS1.3 it will use a simpler argument string. I didn't
bother to write some user-friendly argument parser for 1.3.

Parameters for ReadArgs():

MULTIUSER/S      - boot into multiuser mode, default is single user
ASKROOT/S        - ask for root device
MACHINE/N        - tell gobsd the machine number to get reasonable
                   defaults for motherboard ressources when the
                   automatic detection fails. Use 500 for A500,
                   600 for A600, etc..
RESERVE/S        - Do not use the first 4 Megabytes for the kernel
MEMLIMIT/N       - Memory usage limit in kbytes.
TWOSEG/S         - Use two memory segments
MANYSEG/S        - Use all memory segments
FIRSTSEG/S       - Use the segment with the highest priority instead of
                   the largest segment for the kernel
TEST/S           - Test mode
SYMBOLS/S        - Load kernel symbol table
KDB/S            - Start kernel debugger
AGA/S            - Ask kernel for AGA console if applicable
NOSYNC           - String specifying SCSI targets with synchronous transfers
                   disabled (like "146" to disable target 1, 4 and 6).
                   You can specify separate target lists for up to 4 host
                   adapters separated by a comma.
DRIVER           - name of the exec device for your controller ("scsi.device")
UNIT/N           - device unit of the disk with the root partition (0)
VOLUME           - name of the root partition, default is to search for
                   the partition marked with a root-dostype.
FAST             - force sufficiently recent kernel to bootstrap directly
                   into fast memory. This is tried automatically if there
                   is not enough chip memory for the boot
KERNEL           - Name of the kernel image. Default is "netbsd" in the
                   current directory.

If one of the DRIVER, UNIT or VOLUME parameters is given then gobsd
reads the kernel image directly from the specified BSD filesystem.
The KERNEL name should then be a real filename in the root directory
(i.e. no symbolic link).

Parameters for 1.3:

gobsd [-abk123ptSDA] [=machine] [+memlimit] [kernel]

-a  == MULTIUSER/S
-b  == ASKROOT/S
-k  == RESERVE/S
-1  == TWOSEG/S
-2  == MANYSEG/S
-3  == TWOSEG/S and MANYSEG/S
-p  == FIRSTSEG/S
-t  == TEST/S
-S  == SYMBOLS/S
-D  == KDB/S
-A  == AGA/S
-F  == FAST/S

=machine  == MACHINE/N
+memlimit == MEMLIMIT/N
%nosync   == NOSYNC
~driver   == DRIVER
#unit     == UNIT
:volume   == VOLUME

Version history:

1.04 - start routine is now properly aligned, previously a symbol table
       could prevent this and cause the loader to crash.
     - default volume is now the first partition marked as root in the
       dostype, previously the volume name "bsd_root" was searched for.

Michael van Elst