02.11.2002 - METAKERN.SYS - a boot menu that replaces the FreeDOS kernel
Updated 26.03.2003: Allow up to 4 boot sectors, 4 partitions, 3 drives.
Updated 01.04.2003: Autogenerate kernel names for several FreeDOS boots.
Updated 18.04.2003: Repaired and improved partition list display
Updated 04.05.2003: You can now compile with -DCLS and -DTIMEOUT
Updated 15.05.2003: Bugfix for timeout option.
Updated 11.10.2003: Made MetaBoot part of the package, "new style".

Usage NEW STYLE for FreeDOS:
   1. change to the bootable drive with "the other OS" on it and write
      the existing ("other OS") boot sector into a file \bootsect.1
   2. copy /b boot\metakern.bin + boot\metaboot.bot +
        \bootsect.1 c:\metakern.sys
   4. Using FreeDOS (install kernel.sys and shell): SYS c:
   3. Using FreeDOS (kernel 2032a or newer): SYS c: /k:metakern.sys

The boot process will FIRST load metakern.sys which will THEN offer to
load either the "other OS", FreeDOS (with help of metaboot) or boot
from A:, C: or one of the primary partitions on the first harddisk.

You can add up to 4 sector files (512 bytes each) like metaboot or
stored boot sectors to MetaKern (since 3/2003, since 4/2003 even
allows several of them being metaboot!). Make sure that your stored
bootsect.1 contains the right data or you will no longer be able to
boot the "other OS". ONLY USE METAKERN IF YOU KNOW HOW TO DO THIS.
New style MetaKern will number kernels as kernel.sys, kernel2.sys,
kernel3.sys ... You use it with new style metaboot which only works
if you call MetaKern itself METAKERN.SYS -  This in turn will only
work if you use the new /K option of SYS to make the boot process
start with METAKERN.SYS instead of kernel.sys ...!!!

But there are important good points: If you SYS again without /K, you
will simply bypass MetaKern, and it is less confusing to have the
actual kernel in kernel.sys (while the old style did put the menu
in there so that you had to rename the actual kernel...).

Since 5/2003, MetaKern has -DCLS, -DCLSin and -DCLSout options to
clear screen on both entering and leaving, only on entering, or only
on leaving the menu. It also has -DTIMEOUT to activate "auto-select
one item after a timeout".




Usage OLD STYLE: ONLY DO THIS IF YOU KNOW WHAT YOU ARE DOING. You will
have to recompile MetaKern AND metaboot with -DOLDSTYLE first.
   1. change to drive / partition X: (must be bootable to make sense)
   2. prepare bootsect.* - I assume that you know how to do this. Feel
      free to ask me for more information (find my email address below).
   3. ren kernel.sys fdkernel.sys
   4. FreeDOS SYS C:
   4. copy /b metakern.bin + bootsect.1 + metaboot.old kernel.sys

This means that MetaKern itself is now called kernel.sys while the
old metaboot loads the actual FreeDOS kernel from fdkernel.sys ...
This has caused lots of confusion among users, so please only use
the new style installation from now on! Old style numbers the FreeDOS
kernels as fdkernel, fdkern2, fdkern3... and needs old style metaboot.




Choice:
   MetaKern will give you the choice to boot either of the OTHER
   partitions or one of the two boot sectors. A typical use would
   be to give it a FreeDOS and a MS DOS for the partition you install
   MetaKern on. MetaKern replaces the original kernel.sys and redirects
   the two boot sectors to fdkernel.sys IF they point to kernel.sys,
   so you want to: 1. give it a FreeDOS boot sector 2. have a complete
   (not Meta) kernel available as fdkernel.sys in the root directory!

Disclaimer:
   This is a beta version. Use it at your own risk. You may end up being
   unable to boot (then SYS again). License: GPL 2. Copyright 2002-2003
   Eric Auer, eric@coli.uni-sb.de - please send feedback or patches. For
   space reasons, please fetch the GPL text at www.gnu.org/licenses/ ...
   Basically it means: Freeware and open source, but may only included
   in projects which are open source, too. I allow you to boot non-free
   operating systems using MetaKern (but not to distribute it with / as
   part of a non-free / non-open operating system or software package).

Compile:
   nasm -o metakern.bin metakern.asm
   or if you want TIMEOUT and CLS features as described:
   nasm -DCLS -DTIMEOUT -o metakern.bin metakern.asm
