
LOADLIN and LOADLINX User Guide                                   94-05-14

============================================================================

   LOADLIN v1.4 (C) 1994 Hans Lermen (lermen@elserv.ffm.fgan.de)

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 2 of the License or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You may have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


============================================================================



      CONTENTS
      ========


1.    Why use LOADLIN or BOOTLIN (and not LILO) ?

2.    Why LOADLIN if you already have BOOTLIN ?

3.    How to use LOADLIN
3.1.  What you need
3.2.  Booting from the DOS prompt
3.2.1 Quick start
3.2.2 Quick help
3.2.3 Starting Linux from a batch file (LINUX.BAT)
3.2.4 Floppys and Ramdisks
3.2.5 System constraints
3.3   Booting from CONFIG.SYS
3.3.1 Example of a CONFIG.SYS file
3.3.2 Constraints in CONFIG.SYS syntax

4.    The LOADLIN command line parameters
4.1   Maximum length of the command line
4.1.2 Patch needed for Linux <1.0.5  (command_line size = 80 bytes)
4.1.3 Patch not needed for Linux >=1.0.5 (command_line size = 256 bytes)

5.    If you have problems
5.1.  Example problem 1
5.2.  Example problem 2
5.3.  Confusion regarding device-file MINOR numbers
5.4.  Problems with some DOS memory managers and "Stealth" modes
5.4.1 Creating REALBIOS.INT
5.4.2 Using REALBIOS.INT
5.5.  Description of debug output (-v,-t,-d)

6.    The LOADLINX pre-processor for booting UMSDOS systems
6.1.  The LOADLINX command line

7.    Where to send comments and bug reports

8.    Contributions and Credits


                         --------- +++  --------



1.    Why use LOADLIN or BOOTLIN (and not LILO) ?
      ===========================================

      LOADLIN or BOOTLIN is the safest way to boot Linux (>0.99.14) from
      your hard disk.  Most Linux-newbees are too impatient to read the
      very good (but too long) documentation of LILO, and start using it
      incorrectly ... bang !!!   Goodbye DOS.

      (FDISK /MBR is not the Superman of disk repair.)


                         --------- +++  --------


2.    Why LOADLIN if you already have BOOTLIN ?
      =========================================

      BOOTLIN is clear and simple and very efficient.  The information found
      in the source code of BOOTLIN was the base for LOADLIN.

      LOADLIN, however, can pass a "command line" to the kernel to configure
      the behaviour of Linux (root device, video mode, drivers, etc.).
      It also accepts a parameter file (a file containing the command line
      parameters) so the 128-byte limit of the DOS command line ceases to be
      a problem.

      It may be that there is a newer version of BOOTLIN (from F.Coutant)
      somewhere on the internet, but I couldn't find it, so I wrote LOADLIN
      from scratch and added more testing for unusual situations.  LOADLIN
      is also capable of booting a UMSDOS-based system from a DOS drive (by
      using the LOADLINX pre-processor utility).

      Some options (-v, -t, -d) produce debug information, so if you have
      problems, you can follow what is really being done by LOADLIN.

      LOADLIN also can load out of Virtual-86 mode (which is normal when
      using EMS drivers) if a VCPI server is present.



                         --------- +++  --------



3.    How to use LOADLIN
      ==================

      NOTE:

      LOADLIN is a utility which starts a "logical reload" of your machine,
      causing DOS to be completely overlaid with Linux.  When you wish to
      return to DOS you must use the Linux "reboot" command.


3.1.  What you need
      -------------

      1. A 386 or higher CPU (of course!)
      2. Any compressed linux kernel image  ( >0.99.14).
      3. The  LODLIN14  package, which includes among other things:

          LOADLIN.EXE
          Example parameters file, TEST.PAR
          PARAMS.DOC
          BIOSINTV.SYS
          REALBIOS.EXE
          BOOTSECT.BIN
          LOADLINX.EXE
          MANUAL.TXT (this file)



3.2.  Booting from the DOS prompt
      ---------------------------

3.2.1 Quick start
      -----------

      For the rest of this documentation I will assume that you have
      unpacked  LODLIN14.TGZ  into the directory  C:\LOADLIN.

      Before you start using LOADLIN you should do some configuration:
      you should either include "DEVICE=C:\LOADLIN\BIOSINTV.SYS" as
      the *very* first command in your CONFIG.SYS, or install REALBIOS.INT
      as described in section 5.4.1.

      BIOSINTV.SYS is quite small (~700 bytes).  It must not be loaded high
      by any memory manager.

      After this (at the DOS prompt) you can type, for example:

         C:> CD \LOADLIN
         C:\LOADLIN> LOADLIN zimage /dev/hdb1 ro vga=extended

      or, if you have more parameters than will fit into the 128-byte
      DOS command line:

         C:\LOADLIN> LOADLIN @params

      An example params file is "test.par".    Please read it.
      Currently the parameters file is not supported by LOADLINX.

      A detailed collection (extracted from kernel sources) of all current
      command line parameters can be found in the file  PARAMS.DOC



3.2.2 Quick help
      ----------

      You can get online help and configuration analysis by typing:

         C:\LOADLIN> loadlin <enter>

      or, perhaps a bit more helpful:

         C:\LOADLIN> loadlin | more <enter>


      You then get an output like this (from my machine) ....

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

      USAGE:
        LOADLIN @params
        LOADLIN [zimage_file] [options] [boot_params]
          without any params, LOADLIN displays this help message.
          @params:
             params is a DOS file containing all other options
          zimage_file:
             DOS file name of compressed Linux kernel image
          options:
             -v        verbose, show information on params and configuration
             -t        test mode, do all but starting Linux, also sets -v
             -d file   debug mode, same as -t, but duplicates output to "file"
             -rb       search for REALBIOS before BIOSINTV
             -rx       don't check REALBIOS' ROM-date
          boot_params:
             root=xxx  filesystem to be mounted by Linux as "/"
                  xxx = hex number (e.g. root=201 for /dev/fd1)
                      = /dev/mmmn (e.g. root=/dev/hda2)
                             mmm = fd,hda,hdb,sda,sdb...
                             n   = 1..10.. decimal
                             n   = 01..0a.. or 0x1..0xa.. or a..f  hex number
             ro        mount "/" readonly
             rw        mount "/" read/write
             ramdisk=x install ramdisk of size x Kbytes.  If also root=/dev/fdx,
                       then LOADLIN prompts for a floppy (copied into ramdisk)
             vga=xxx   vga mode (e.g. -3..0.., ask, normal, extended)
             (for more boot params see file PARAMS.DOC)

      Your current DOS/CPU configuration is:
        load buffer size:   0x80000
        total memory:     0x0FE0000
        V86 mode:      YES
        BIOSINTV.SYS:  YES
        stat5: VCPI_present, physmap=logmap, all OK for switch to realmode
        input params size 0x0000
        input params:

        LOADLIN started from DOS-prompt

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



3.2.3 Starting linux from a batch file (LINUX.BAT)
      --------------------------------------------

      Most DOS users have disk caching (e.g. SMARTDRV) activated.
      If "write-behind" caching is supported by the cache program,
      then any unwritten cache buffers MUST be flushed before
      LOADLIN is called.

      Example:

       C\LOADLIN> smartdrv /C    do this to "sync" your disk (usually not
                                  needed for DOS 6.2, but it doesn't hurt)
       C\LOADLIN> loadlin ....


      It would be much smarter to use a batch file something like this:

      +-------------------- start of LINUX.BAT
      |
      |  SMARTDRV /C
      |  C:\LOADLIN\LOADLIN C:\LOADLIN\ZIMAGE root=/dev/hdb2 ro vga=3
      |
      +-------------------- end of LINUX.BAT


      So you could simply type:

       C> linux

      ... and you are on the road!

      A sample LINUX.BAT file is provided with the LOADLIN package.



3.2.4 Floppys and Ramdisks
      --------------------

      If LOADLIN encounters  ramdisk=xxxx  together with  root=/dev/fdx
      it loads the kernel image into memory, but before starting up
      Linux it prompts for insertion of the root floppy.

      This enables you to boot DOS (and start LOADLIN) from the same
      floppy drive as the root disk.

      Of course, this is a two-floppy boot, but with Linux becoming
      bigger and bigger there will be no room on the root floppy to
      hold both the kernel image and the root filesystem.  With
      LOADLIN there is no need for any fancy tricks to install a
      distribution when your drive configuration doesn't match that
      of the distribution.

      Examples:

        LST 1.07 distribution comes only with a 3.5 inch floppy
        but your drive A: is 5.25 inch.

        Slackware 1.2 has a big directory tree with lots of possible
        drive constellations.  With LOADLIN you need only the image disk
        and an appropriate root disk.


3.2.5 System constraints
      ------------------

      1. There must be enough memory to load the kernel and its setup
         program (between the start of LOADLIN and 090000h).

         The field "load buffer size" of the LOADLIN verbose output
         tells you what you really have.


      2. I recommend that you put the following line AT THE TOP of
         your CONFIG.SYS:

            DEVICE=C:\LOADLIN\BIOSINTV.SYS

         This driver saves default BIOS values for the interrupt vector.
         It is approx.700 bytes, so it won't use too much low memory.
         BIOSINTV.SYS must NOT be loaded high by any memory manager!

         If you don't have the BIOSINTV.SYS driver in your CONFIG.SYS,
         LOADLIN may or may not work.  If any TSRs or drivers intercept
         INT15, Linux can get the wrong total available memory reported.
         Some DOS memory managers (like QEMM) will cause this problem
         when using what is commonly called "Stealth" techniques.

         If this happens, you can then put  mem=xxxx  in the LOADLIN
         command line, where xxxx is the total size of memory in bytes.
         (NOTE: the motherboard BIOS may have mapped some 128Kb for
                Shadow RAM).


         The field "total memory" of the LOADLIN verbose output will
         tell you what Linux would see as total RAM available.

         As an alternative, you can install the  C:\REALBIOS.INT  file
         (see 5.4.1).


      3. DOS programs can be executed only in the so-called real mode
         (or on >386 in virtual-86 mode (V86)).

         Linux, however, runs in protected mode, and the kernel must be
         able to enter privilege level 0 (P0, supervisor mode).  However,
         from V86 it is impossible to switch to protected mode P0 if the
         V86 server does not allow this (as is the case with DPMI).

         Therefore:
         - You must be in 86 real mode (no EMS driver, no WINDOWS, ...).
             or
         - You must have the VCPI server enabled in your EMS driver (still
           not running WINDOWS, however).

         VCPI allows P0 and is supported by most EMS drivers (if EMS is
         enabled), but never under MS-WINDOWS (MICROSOFT doesn't like P0
         for users).

         Physical-to-Virtual memory mapping must be identical for the first
         640K of RAM, which is a given under normal conditions but which
         also can be forced, typically by an EMS driver option like:

           EXCLUDE=1000-A000     (for 386MAX)
             or
           B=A000                (for EMM386.EXE).


         Check the manual for your EMS driver for details.


         You also MUST install the BIOSINTV.SYS driver (see 3.2.4.2):

           DEVICE=C:\LOADLIN\BIOSINTV.SYS

         or have the  C:\REALBIOS.INT  file installed (see 5.4.1).


         But don't worry, if something is missing LOADLIN will tell you.





3.3   Booting from CONFIG.SYS
      -----------------------

      Starting with DOS version 6.0 it is possible to boot different
      configurations during the startup of MSDOS. This is handled at the
      time of CONFIG.SYS interpretation.  Therefore this is often a good
      place to put the LOADLIN/LOADLINX/Linux stuff.

      Even if you have decided to boot DOS, you can boot Linux later,
      either from the DOS command line or from a batch file.



3.3.1 Example of a CONFIG.SYS file
      ----------------------------

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

      rem    Put  BIOSINTV.SYS  at the TOP !!! (before [MENU])
      rem    or install the  C:\REALBIOS.INT  file (see 5.4.1)

      rem    If you have both,  BIOSINTV.SYS  will be used.

      DEVICE=C:\LOADLIN\BIOSINTV.SYS

      SWITCHES=/F


      [MENU]
      menuitem=DOS, DOS boot
      menuitem=LINUX_1, LINUX boot (SLS 1.03)
      menuitem=LINUX_2, LINUX boot (Slackware, LST)
      menuitem=LINUX_3, LINUX boot (UMSDOS, with C: as DBLSPACE'd drive)
      menuitem=LINUX_4, LINUX boot from 3.5 inch floppy B:
      menuitem=LINUX_5, LINUX boot (Slackware, high partition number)
      menuitem=LINUX_6, Create a dump file for bug report


      [DOS]
      device=c:\dos\himem.sys
      device=c:\dos\emm386.exe 2048 min=64 B=a000 ram
      DOS=HIGH,UMB
      SHELL=C:\COMMAND.COM C:\ /e:1024 /p
      ...   etc.,  etc.,  etc.


      [LINUX_1]
      shell=c:\loadlin\loadlin.exe c:\loadlin\zimage vga=ask root=/dev/hdb3


      [LINUX_2]
      shell=c:\loadlin\loadlin.exe c:\loadlin\zimage vga=-3 root=/dev/hdb2 ro


      [LINUX_3]
      rem  The UMSDOS filesystem is on NON-compressed drive D: (/dev/hdb1)
      device=c:\dos\dblspace.sys
      rem                     v----- we are using LOADLINX preprocessor
      shell=c:\loadlin\loadlinX.exe d:\linux\zimage.{15 root=D: vga=ask
      rem  This is a UMSDOS filename ---------------^^^      |
      rem  This will be translated to root=/dev/... ---------+

      [LINUX_4]
      shell=c:\loadlin\loadlin.exe c:\loadlin\zimage root=/dev/fd1 ramdisk=1440


      [LINUX_5]
      shell=c:\loadlin\loadlin.exe c:\loadlin\zimage root=/dev/hdb10
      rem  NOTE: the partition number is decimal 10 (not 16, as the kernel would
      rem        decode).  LOADLIN translates this to avoid conflicts with
      rem        existing device names and MINOR numbers in /dev of Slackware
      rem        distribution.


      [LINUX_6]
      shell=c:\loadlin\loadlin.exe c:\loadlin\zimage -d c:\dump.txt root=/dev/fd1 ramdisk=1440
      rem                                            ^^^^^^^^^^^^^^
      rem  This writes debug information to a file ---------^
      rem  All is set up as usual, but Linux is not loaded and LOADLIN idles.
      rem  CAUTION: Don't do this if you haven't a [MENU] in CONFIG.SYS,
      rem           because you then need a DOS System floppy to boot normally.


      [COMMON]
      rem   Here we put any other "common" configuration stuff ....

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



3.3.2 Constraints in CONFIG.SYS syntax
      --------------------------------

      1. All parameters on the "shell=" lines are converted to uppercase
         by DOS, but Linux parameters are case sensitive. LOADLIN converts
         the following parameters back to lowercase:

           mem=...
           no387
           single
           auto

         The following parameters are not put onto the commandline, but
         converted to numeric values for the boot sector:

           vga=...
           ramdisk=
           root=...
           ro
           rw


      2. You can bypass the uppercase/lowercase problem by using a parameter
         file.   An example  CONFIG.SYS  line would be:

         [LINUX]
         shell=c:\loadlin\loadlin.exe @c:\loadlin\params


         An example parameter file is "test.par".  Please read it.
         Currently the parameter file is not supported by LOADLINX
         for UMSDOS systems.


                         --------- +++  --------




4.    The LOADLIN command line parameters
      ===================================

      Note that if you use a parameters file (for example  @TEST.PAR),
      this must be the FIRST parameter you use on the LOADLIN command
      line.  Other parameters, including the name of the zImage file,
      are contained within the parameters file.

      When Linux boots it gets a runstring passed from setup
      (the program that checks the basic hardware configuration
      and puts the machine into protected mode ). This string, the
      command line, is then checked for some well known compiled-in
      keywords.  Some are used to change kernel variables (such as
      mem=, root=, ro, rw, no387), some are passed to the device
      drivers (such as ether=, hd=, sound=) and some (such as single
      and auto) are passed as options to /etc/init (or /bin/init or
      /sbin/init, whatever is found first).

      See the file "PARAMS.DOC" for details.

      Any unknown keywords of format "keyword=value" are placed in
      "envp_init", which is also passed to /etc/init.  This environment
      string can be checked in /etc/rc* (/etc/rc.d/rc.*).

      For example, the command "set >/etc/boot_env_string" in  rc.local
      will place the contents of  envp_init  into a file which can then
      be accessed by other processes.  Don't put this command in any  rc
      file which gets executed before the filesystem is mounted r/w !



4.1   Maximum length of the command line
      ----------------------------------

      The length of a DOS command line can be 127 bytes (including
      the program name).  With a params file (@param, see 3.2.2)
      the length of the string passed to the kernel can in theory be
      2047 bytes, but the string is held in a temporary place and must
      be copied by the kernel to a save static buffer in init/main.
      This forces the maximum length to a compiled-in constant.



4.1.2 Patch needed for Linux <1.0.5  (command_line size = 80 bytes)
      --------------------------------------------------------------

      In kernel versions below Linux 1.0.5 there is a small problem
      (in init/main.c).  The static buffer in  main.c  is only 80 bytes.
      LOADLIN compacts the parameters, but too many parameters may cause
      the kernel to hang at boot time, because the length is not checked.

      So, please change the line in "main.c":
          static char command_line[80];

      to: static char command_line[256];

          (the maximum command_line size can be 2047)

      If you have the Linux 1.0 kernel you can apply the patch "kernel.dif",
      but patching manually is also possible for lower version numbers
      (init/main.c has not changed much since 0.99.14).

      NOTE: "kernel.dif" does NOT conform with the Linux 1.0.5 official
            patch, which uses a "def" instead.


4.1.3 Patch not needed for Linux >=1.0.5 (command_line size = 256 bytes)
      ------------------------------------------------------------------

      Starting with Linux 1.0.5, "command_line[]" is set according to the
      def COMMAND_LINE_SIZE 256.  The incoming command line is also checked
      for size, so you don't need any patches. If you need a greater size,
      you can simply change COMMAND_LINE_SIZE in init/main.c.



                         --------- +++  --------



5.    If you have problems
      ====================

      I received some feedback re version 1.2 which lead to version 1.3
      and more extensive error checking.  Some bugs were also found and
      fixed.  However, with the thousands of possible hardware/software
      configurations of a PC, a program can never be totally bug-free.
      So please, I need your feedback regarding problems you encounter.

      If you recognize a bug, please don't work around it, mail it to me !

      But, if you report a problem, I need information!  Something like
      "My screen always displays in blue, what is wrong?"  is not enough.

      LOADLIN can produce information for me (and for you) if you use
      the -d or -t switch.



5.1.  Example problem 1
      -----------------

        C:\LOADLIN>loadlin zimage /dev/sda1 ro

      The kernel loads (LOADING.......), but Linux "panics" with the message
      "unable to read superblock".    You have to hard-reset your machine.

      To check what was wrong you can type:

        C:\LOADLIN>loadlin zimage -t /dev/sda1 ro
                                  --

      LOADLIN now does all the same things, but doesn't actually start Linux.
      It displays:

        Your current LINUX kernel boot configuration is:
          image file:       zimage
          kernel size:     0x4D010
          ram disk size:    0x0000
          root device:      0x0342  read only
          VGA mode:         0xFFFF
          command line size 0x001B
          command line:
            /dev/sda1 BOOT_IMAGE=zimage
          ..
          ..
          ..

      Looking at the field "root device", you can see that it is NOT the
      MAJOR+MINOR of /dev/sda1, but you did use "/dev/sda1" as the root disk
      parameter in the boot command line.  The error is clear, you forgot
      the "root=" in front of "/dev/sda1".  (Alternatively, you could use
      rdev to alter the root device flag in the zimage file.)



5.2.  Example problem 2
      -----------------

        C:\LOADLIN>loadlin zimage root=/dev/sda1 ro mem=0xFF0000

      The kernel loads (LOADING.......), but Linux "panics" with the message
      "<2M Ram   system halted".    You have to hard-reset your machine.

      To check what was wrong you can type:

        C:\LOADLIN>loadlin zimage -d report.dmp root=/dev/sda1 ro mem=0xFF0000
                                  -------------

       and get the output on-screen (and in the file report.dmp):

        Your current LINUX kernel boot configuration is:
          ..
          ..
          command line:
            BOOT_IMAGE=zimage

        Your current DOS/CPU configuration is:
          ..
          ..
          total memory:     0x01E0000
          ..
          ..


      This could be a bug in LOADLIN, because "mem=0xFF0000" should have
      appeared in "command line" in front of "BOOT_IMAGE=zimage".

      You should mail me a description of what has happened, including the
      file "report.dmp" and the contents of your CONFIG.SYS so I can check
      what is wrong.

      NOTE:
      This situation is also possible (the -d report is not), if you omit
      the "DEVICE=BIOSINTV.SYS" from your CONFIG.SYS.

      LOADLIN can load and start Linux if the CPU is in real mode, but INT15
      (which is used to report the memory size) can be intercepted by some
      TSRs or drivers (e.g. HIMEM.SYS).   With the "mem=0xFF0000" option
      however, you can solve the problem.  When Linux has been loaded and
      uncompressed successfully, nothing in DOS (or the BIOS) is used from
      that point forward.



5.3.  Confusion regarding device-file MINOR numbers
      ---------------------------------------------

      The following illustrates the problem with numbering conventions
      for device-file MINOR numbers:

      With version 1.2 of LOADLIN, I got the following bug report:

       "SHELL=c:\loadlin\loadlin.exe c:\loadlin\zimage root=/dev/hda10
        does load, but panics with 'unable to read superblock'"

      The problem is:

      Linus interprets the number following "/dev/hda" as a HEX number,
      the device names in /dev of the Slackware distribution however, are
      numbered /dev/hda1 .. hda9 .. hda10 .. hda16, instead of  /dev/hda1
      .. hda9 .. hdaa .. hdaf, as Linus would have done.

      So, starting with version 1.3 of LOADLIN, I interpret the root device
      myself and pass the device numerically in the boot-sector.  My
      naming convention is a compromise, which I hope will result in less
      confusion:

      If the digit appended to "/dev/hda, hdb, sda ..."  starts with  0, 0x
      or  a..f, it is interpreted as a HEX number.  (Examples:  /dev/hdaa
      /dev/sda0xE, /dev/hdb0c)

      If it starts with 1..9 it is interpreted as a decimal number.

      If none is appropriate the string is passed to the command line
      (some later kernel versions may have other device names).



5.4.  Problems with some DOS memory managers and "Stealth" modes
      ----------------------------------------------------------


      When LOADLIN has loaded the kernel image, and before it jumps to
      Linux, it must restore the interrupt vector (and eventually some
      BIOS data) to simulate a "boot time" state.

      My simple method (using BIOSINTV.SYS) gets an interrupt table that is
      slightly modified by DOS (i.e. it is NOT the *real* original), but it
      works for almost all configurations. It doesn't require changing the
      BIOS data/scratch areas, because they are mostly consistent with the
      interrupt vector.  You should use the BIOSINTV method whenever possible.

      I have had problems reported with the use of DOS memory managers (QEMM,
      for example) which apparently hook some vectors or access data which is
      no longer available when LOADLIN re-enters real mode.

      As an alternative to the BIOSINTV method, I introduced with version 1.4
      the REALBIOS method, which consists of:

         The REALBIOS.EXE utility
         BOOTSECT.BIN
         The file REALBIOS.INT, which REALBIOS creates on your machine.

      Alessandro Rubini (rubini@ipvvis.unipv.it) wrote BOOTSECT.BIN (which
      contains code from bootsect.S by Linus Torvalds).

      His way (used in his package linuxEXE ) of getting the *real* original
      BIOS interrupt vector is the safest way.  All other solutions are too
      tricky.  I added saving of BIOS data/scratch, PIC-IMR and TOP-ROM, but
      it remains essentially Alessandro's technique.

      If, and only if, you don't succeed with the BIOSINTV method, try the
      REALBIOS method instead as a last resort.

      But NOTE:
      --------
      !  The  C:\REALBIOS.INT  file created by the REALBIOS method is unique
      !  to the machine on which it is generated!  It must be in C:\ .
      !
      !  Do NOT DISTRIBUTE it to your friends (distribute only "lodlin14.tgz").
      !  Do NOT COPY it from your friend's machine.
      !  Do NOT SHARE it (e.g. via NFS).
      !  Rebuild the file if you make ANY hardware changes to your machine
      !   (such as adding/removing an adapter card, adding/removing RAM or
      !    changing an IRQ or I/O address).
      !  Use it only on the machine it is generated on!
         ----------------------------------------------



      BTW:
      I guess that on a PS2 you may have problems with the extended BIOS data.

      Sorry, but I have no way of testing it. ( .. does Linux work on PS2 ? )
      If someone with a PS2 machine is willing to cooperate, I am too!



5.4.1 Creating REALBIOS.INT
      ---------------------

      - At the DOS prompt type:

          C:> CD \LOADLIN
          C:\LOADLIN> REALBIOS


      - You then get the following output:

          Generation of the file C:\REALBIOS.INT (for the REALBIOS method)
          consists of TWO steps:

            1. Generating the special boot floppy and booting with it.

            2. Reading the saved interrupt table and BIOS data from the floppy
               and writing it to C:\REALBIOS.INT

          Type 1 or 2, (depending on which step you are in) or any other key
          to cancel:


      - Because you are doing the first step you must type a "1", which gets
        you the following output:

          OK, we first generate the floppy !
          Insert an empty but DOS-formatted disk into drive A:
          (no matter what DOS format it is)

          Type C to continue or any other key to cancel


      - You insert the floppy, type "C" and get the following output:

          OK, The special boot floppy has been generated.
          Leave it inserted in drive A: and reboot your machine
            But NOTE:
            If you have a disk cache program (like SMARTDRV)
            you may need to flush the write-behind cache first!


      - You press the reset button, or do the "3-finger salute", and your
        machine then boots from the floppy.  The boot loader then saves
        all needed BIOS intvectors and data onto the floppy.  Finally the
        machine will display the following:

          Interrupt table and BIOS-data saved on floppy.
          Open the floppy door and reboot from your hard drive,
          then run REALBIOS again (step 2).


      - Now you open the floppy door (to avoid booting from the floppy),
        reboot, and re-enter the LOADLIN directory.  Then you type:

          C:\LOADLIN> REALBIOS

      - You now answer with a "2", (because you are running step 2) and
        get the following output:

          OK, we now read the saved interrupt vector from the floppy
          and save it to the file C:\REALBIOS.INT (no way to change the name!)
          Is the floppy (used in step 1) inserted in drive A: ?

          Type Y to continue or any other key to cancel

      - Re-insert the floppy into drive A.  If you then type Y the file
        C:\REALBIOS.INT  will be created from the data on the floppy.
        If anything goes wrong, REALBIOS will let you know.



5.4.2 Using REALBIOS.INT
      ------------------

      The file  C:\REALBIOS.INT  will be a "HIDDEN+SYSTEM" file to avoid
      distribution to other machines. (you can't see it with DIR)

      LOADLIN first searches for BIOSINTV.SYS and then for REALBIOS.INT.
      You can reverse this order by using the "-rb" switch.

      LOADLIN checks the ROM-BIOS-DATE saved in REALBIOS.INT and, if there
      is a mismatch, it switches to "-t" verbose mode.  Some DOS memory
      managers, however, remap the top page of the ROM-BIOS to intercept
      a warm-boot, and do not supply the correct ROM-BIOS-DATE.  LOADLIN
      then fails because it checks this date before going into real mode.

      In this case you can use the "-rx" switch to skip the check.


      NOTE:
      ----

       - C:\REALBIOS.INT is marked HIDDEN+SYSTEM to avoid distribution.
         It must reside in C:\  even if the C: drive is compressed.

       - The floppy used above is rendered unusable for DOS, so you must
         fully format it again (not just a "quick" format).

       - Whenever you add, remove or reconfigure any hardware you MUST
                      ---  ------    ----------- ---
         rerun REALBIOS !  (This is the reason I prefer the BIOSINTV method.)
         ----- --------



5.5.  Description of debug output (-v,-t,-d)
      --------------------------------------

      The ouput produced by the -v, -t or -d options occurs at the point at
      which the boot sector and setup are loaded and updated by LOADLIN.
      The information is that seen by Linux, but in the case of -t and -d,
      the zimage file is not loaded and linux is not started.

      Description:

      Your current LINUX kernel boot configuration is:
        image file:       zimage              <- filename of kernel image
        kernel size:     0x4D010              <- size of kernel in bytes
        ram disk size:    0x0000              <- 0 = none, else size in Kbytes
        root device:      0x0342  read/write  <- MAJOR+MINOR of root device
        VGA mode:         0xFFFF              <- video mode at startup
        command line size 0x0011              <- size of compacted command line
        command line:                         <- contents of command_line as
          BOOT_IMAGE=zimage                       seen by Linux

      Your current DOS/CPU configuration is:
        load buffer size:   0x80000           <- size of buffer in bytes which
                                                  holds the uncompressed image
                                                  Must be > "kernel size"
        total memory:     0x0FE0000           <- highest RAM address as seen
                                                  by Linux, calculated from the
                                                  INT15 information
        V86 mode:      YES                    <- YES, if in Virtual-86 mode

        BIOSINTV.SYS:  YES                    <- YES, if $BIOSINT was
      or                                          read successfully.
        REALBIOS:      YES
      or
        REALBIOS:      YES, but ROM-BIOS-DATE differs, must rerun REALBIOS.EXE


      One of five possible status messages may appear here:

        stat1: cpu in real 386 mode
        stat2: cpu_V86, but no VCPI available (check aborted)
        stat3: VCPI_present, but physmap != logmap (check aborted)
        stat4: VCPI_present, physmap=logmap, but no BIOSINTV or REALBIOS
        stat5: VCPI_present, physmap=logmap, all OK for switch to realmode


      The following may come from the DOS command line or from the params file:

        input params size 0x000D              <- size of DOS command line
                                                  (or compacted params file)
        input params:                         <- contents of DOS command line
          ..\zimage -t


      Some additional information and/or warnings can follow:

        LOADLIN started from DOS-prompt       <- one of these two Lines
           "       "     "   CONFIG.SYS       <- (LOADLIN assumes the environ.
                                                  has a  COMSPEC=  for DOS)

        You are running under MS-WINDOWS      <- this warning, if in WINDOWS.
                                                 (LOADLIN assumes the environ.
                                                  has a  WINDIR=  for WINDOWS)



                         --------- +++  --------




6.    The LOADLINX pre-processor for booting UMSDOS systems
      =====================================================


      This program is used as a "pre-processor" for the LOADLIN utility.
      It does translation of DOS-ish drive numbering (C:, D:, etc.) to
      the equivalent Linux device names (/dev/....).

      In addition to "root=X:" LOADLINX accepts the same parameters as
      LOADLIN and passes them to it.  NOTE that translation is NOT (yet)
      supported for parameter files (@param).

      LOADLINX can even be executed via a  shell=  in your CONFIG.SYS,
      but it MUST reside in the same directory where LOADLIN is located.

      Jacques Gelinas (jacques@solucorp.qc.ca) is the author of the trans-
      lation algorithm (I just implemented and enhanced it for LOADLIN,
      and adapted it to the exact behavior of DOS).

      It is intended for UMSDOS users only, since others do not use a
      DOS partition for "root".

      It is (at the time of LOADLIN v1.4) restricted to systems with either
      all AT-type (IDE) drives or a maximum of two SCSI drives using the
      SCSI adapter card's own BIOS under DOS (e.g. must be accessable via
      INT13).   Mixed use of IDE and SCSI is not (yet) supported.
      Nevertheless, you can bypass LOADLINX for other configurations and
      determine the  root=/dev/xxxx  yourself.


6.1.  The LOADLINX command line
      -------------------------

      Usage:

        LOADLINX [--dv]  LOADLIN_command_line

           --dv    debug verbose; doesn't exec LOADLIN


      Example:

        LOADLINX zimage.ums root=D: vga=ask

        (NOTE: You must never use the "ro" option because UMSDOS needs
               to mount its root filesystem r/w at boot time.)



      It would be much smarter to use a batch file something like this:

      +-------------------- start of LINUX.BAT
      |
      |  SMARTDRV /C
      |  C:\LOADLIN\LOADLINX C:\LOADLIN\ZIMAGE root=C: vga=3
      |
      +-------------------- end of LINUX.BAT


      So you could simply type:

       C> linux

       .... and be on your way.




                         --------- +++  --------



7.    Where to send comments and bug reports
      ======================================

      Comments and bug reports are welcome and may be sent to:

      E-Mail:    lermen@elserv.ffm.fgan.de

      SnailMail: Hans Lermen
                 Am Muehlenweg 38
                 D53424 REMAGEN-Unkelbach
                 GERMANY




                         --------- +++  --------



8.    Contributions and Credits
      =========================

      This program could not have been written as quickly without the
      information found in the source code of F.Coutant's BOOTLIN.

      This program would be absolutely superfluous without Linus Torvalds.

      Jacques Gelinas encouraged me in realizing the VCPI-support.
      The LOADLINX pre-processor is an implementation of his ideas.

      Alessandro Rubini contributed some code from his linuxEXE package
      (BOOTSECT.BIN) and gave some important hints.

      Chuck Munro gave hints concerning problems with QEMM and ALPHA-
      tested version 1.4.
      He also did much work for better documentation.

      Important problem and bug reports came from:

      Mitchum Dsouza, UK
      Claus Tondering, Denmark
      Johann Friedrich Heinrichmeyer, Germany

      Many thanks also to those people, who did not have any
      problems with LOADLIN, but nevertheless mailed me "it works"
      ( positive feedback is the best one ).


                         --------- END --------

