
Contents

1.0 ) Boot sectors
1.1 ) Master boot sector
1.2 ) Dosfs boot sector
1.3 ) Minixfs boot block
1.4 ) Tar boot sector
1.5 ) Skip boot sector
1.6 ) Panic boot sector

2.1 ) Booting i86 standalone executable
2.2 ) Booting Elks kernel
2.3 ) Booting Linux-i386 [b]zImage

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

1.0 ) Boot sectors

   These boot sectors are mostly designed for floppy use, the exceptions
   being the MinixFS and Master boot sectors.

   The makeboot program makes them very easy to install just format the
   disk add the correct filesystem then run a command like ...

   $ makeboot minix /dev/fd0

   As far as I know all boot sectors and programs are 8086 clean, with
   the exception that, obviously, the Linux-i386 loader needs access to
   extended memory.

1.1 ) Master boot sector

   This MBR is a very simple one with no frills by default.

   The actual code is less that 254 bytes long so it can be used as
   an MBR for a disk with old style 'Disk manager' partitions.
   The code now only boots one of the last four partitions.

   Option 2 is a boot message that displayed as soon as the MBR loads.

   Option 3 is code to accept a keypress from the user to select which
   partition to boot (or the floppy).

1.2 ) Dosfs boot sector

   Install with makeboot, there is also a version for 16 bit FAT
   filesystems for big floppies (eg LS-120 disks) or hard disk
   partitions. This boot sector loads and executes a binary BOOTFILE.SYS
   from the root directory of the floppy.  The file can be any length
   and is loaded at $07C00. Because of the load address this boot sector
   can be configured to load another boot sector, for example LILO can
   be succesfully used in this way.

   Note this boot sector loads the executable 1 sector at a time, as far
   as my testing has gone this is only significant on 8086 machines, all
   others (286 8Mhz +) are fast enough to keep up at a 1-1 interleve.

   But some versions of superformat can defeat this because they do
   not correctly calculate intersector gaps. I suggest using fdformat
   as this uses a 'safe' layout for standard 1440k disks.

1.3 ) Minixfs boot block

   This boot block has varients for floppy and harddisk and works similarly
   for both. For the hard disk it must be installed in the partition boot
   block with a normal MBR in sector zero of the disk. This boot sector can
   be installed with makeboot or simply by copying the 1k file to the start
   of the partition (or floppy) to be booted.

   The sector looks for a file or directory called 'boot' if it's a
   directory it loads that and does the search again. When it finds a
   file it loads it at location $10000 and executes it, note this
   is limited to a file size of 519k.

   There is also support for a helper boot which mean this is the only
   boot sector able to load an ELKS image (almost) directly.

1.4 ) Tar boot sector

   This boot sector converts a tar file with a GNU Volume label into a
   bootable floppy image. The boot sector loads and executes the first
   item in the tar file after the label:

   $ tar cvfV the_file.tar ENIAC monitor.sys item2 item3
   $ makeboot tar the_file.tar
   $ cp the_file.tar /dev/fd0

   This sequence makes a bootable floppy that tar sees as a normal labeled
   tar file but when booted from will load and execute 'monitor.sys' at
   location $00800  (Yes thats 2k!)

   Warning: the tar boot sector moves the BPB to the location $666.

1.5 ) Skip boot sector

   This bootsector displays a message then loads and executes the hard disk
   MBR at location $07C00

1.6 ) Panic boot sector

   Displays the message 'PANIC! NO OS Found!' (or the message specified
   on install) and freezes.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

2.1 ) Booting i86 standalone executable

   All the boot sectors (dos, minix, tar) check for a ELKS-i86 magic number
   at the start of the file they load and will correctly set the segment
   registers before calling. The executable should be a 'standalone'
   executable compiled with 'bcc -Ms ...' or similar.

2.2 ) Booting Elks kernel

   Only the minix boot sector can directly boot an elks kernel and even that
   needs a helper function because of the complexity. The helper is called
   'minix_elks.bin' and needs to be copied onto the disk as '/boot/boot'
   with the ELKS image copied on as '/boot/linux'. This works, with the
   correct boot block, on either floppy or harddisk.

2.3 ) Booting Linux-i386 [b]zImage

   None of the boot blocks can _directly_ boot a Linux-i386 kernel the
   program 'monitor.sys' must loaded by the boot sector and this can
   load a zimage or bzimage from an MSDOS, Minix or Tar floppy. It can
   also load the image from a minix hard disk filesystem.

   This example is for and MSDOS floppy, Tar is very similar except that
   'monitor.sys' must be the first file in the tar and can have any name.

   Note also for a tar file the 'ramdisk.gz' file must start on the first
   disk but can extend across as many floppies as is needed.

   $ mformat a:
   $ makeboot dos /dev/fd0
   $ mount -t msdos /dev/fd0 /mnt
   $ cp monitor.sys /mnt/bootfile.sys

   $ cp /usr/src/linux/arch/i386/boot/zImage /mnt/vmlinuz
   $ echo 'root=/dev/ram ramdisk_file=ramdisk.gz mem=80M' > /mnt/vmlinuz.cfg
   $ cp /archive/ramdisk.gz /mnt/ramdisk.gz
   $ umount /dev/fd0

   The stuff about ramdisk is only if you want an init ramdisk. If
   the ramdisk isn't on this floppy monitor.sys will ask for the
   right floppy. If you specify multiple ramdisk files then will be
   concatenated and passed to the kernel as one ramdisk, each file 
   can be on a different floppy.

   If the file isn't called 'vmlinuz' you can still boot it by typing "=linux"
   at the prompt '>' where 'linux' is the name of the bzImage file.

   Escape or ^C will interrupt the boot and drop you to the '>' prompt.
   ^C at the '>' prompt will reboot

   A file called 'help.txt' will be displayed upto the first line that starts
   with a '%', chunks after that (seperated by '%'s) will be displayed when
   the user presses a function key, home, page up or page down.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Robert de Bath <robert$@debath.co.uk>
