From: Alex C. Liu (aliu@usc.edu)
Date: 05/14/92


From: aliu@usc.edu (Alex C. Liu)
Subject: Documentation on shoelace
Date: 14 May 1992 06:38:44 GMT

This is posting as a request...

Since the Shoelace program ported for Linux did not come with any
documentation, a lot of peoples are missing out on certain shoelace
features.

Like "run file" command to execute DOS programs that only do BIOS calls.

And also, it is important to know that the shoelace fsck will only
work with old style minix filesystems (cyl<1024, etc)

Here are the docs.

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

ShoeLace(8) Minix Programmers' Guide ShoeLace(8)

NAME
     ShoeLace - a small bootstrap

DESCRIPTION
     ShoeLace is a small bootstrap that replaces the original
     awkward boot procedure. ShoeLace is not executable although
     it does contain code that will be run at boot time.

BOOT PROCEDURE
     When the volume is bootstrapped, ShoeLace will look for a
     Minix image to load into memory. The strategy adopted is as
     follows:

     1 Search for the configuration file /etc/config. If the
       configuration file is found, it is read otherwise the
       default configuration is used.

     2 Wait for a keystroke. If a keystroke is detected, the
       character is discarded and steps 3-4 are skipped. Keys-
       troke detection is abandoned if no keystroke is detected
       after a small time.

     3 Attempt to build a Minix system using separate system com-
       ponents. If this succeeds, the newly built system is
       started.

     4 Search for a system image built using build(8). If such
       an image is found, it is loaded and started.

     5 All possibilities have been exhausted. The command inter-
       preter is started.

     When ShoeLace starts it will print a sign on message. Fol-
     lowing this will be a summary of the hard disk partition
     table if the bootstrap is being performed on a hard disk and
     then a table showing where ShoeLace is loaded in memory.

BOOTING SYSTEM COMPONENTS
     This is the new method of booting Minix systems. ShoeLace
     mimics the functionality of build(8) and constructs and
     loads a Minix system on the fly. Four components are
     required to build the Minix system: the kernel, mm, fs and
     init. Files with names /kernel, /mm, /fs and /init will be
     sought on the boot volume. The names of the files can be
     changed using the configuration file. The bootstrapped sys-
     tem will be passed a pointer to the configuration parame-
     ters. Old kernels will be oblivious to this and will boot as
     usual. New kernels will be able to configure themselves
     according to the boot parameters.

BOOTING PREBUILT SYSTEM IMAGES
     Prebuilt system images are constructed using the program

Printed 12/6/89 Minix 1

ShoeLace(8) Minix Programmers' Guide ShoeLace(8)

     build(8) with the output sent to a file. ShoeLace assumes
     that this file will have the name /minix but this can be
     changed using the configuration file. This is a clumsy way
     of constructing a system and it is recommended that the sys-
     tem files not be passed through build(8) since ShoeLace can
     perform the same process at boot time. Furthermore, starting
     Minix in this way causes the standalone fsck to be executed.
     The `=' key must be pressed to make fsck start Minix.

     The capability to load prebuilt system images provides some
     backwards compatibility. In the future, when boot time
     memory space becomes too valuable, this capability might be
     removed.

CONFIGURATION FILE
     The configuration file is named /etc/config. Text in this
     file is scanned at boot time and is used to alter the
     actions performed during the bootstrap.

     Text within the configuration file is divided into lines.
     Leading and trailing spaces are ignored. Empty lines and
     lines beginning with `#' are ignored. Other lines are broken
     up into a series of space separated words. The first word is
     treated as the name of the command to invoke. All other
     words are treated as arguments for the command.

     The following commands are recognised:

     boot name
          Sets the name of the prebuilt Minix image. The default
          name is minix.

     kernel name
          Sets the name of the file containing the Minix kernel
          code. The default name is kernel.

     mm name
          Sets the name of the file containing the Minix memory
          management code. The default name is mm.

     fs name
          Sets the name of the file containing the Minix file
          system code. The default name is fs.

     init name
          Sets the name of the file containing the Minix init
          process. The default name is init.

     run file ...
          Run the named files before attempting to boot Minix.

Printed 12/6/89 Minix 2

ShoeLace(8) Minix Programmers' Guide ShoeLace(8)

     setenv name value
          Set the named environment string to have the specified
          value.

     setdev name device
          Set the named environment string to have the major and
          minor device numbers of the specified device.

COMMAND LINE PROCESSOR
     A small command line processor is built into ShoeLace. This
     processor is started if all attempts to automatically start
     a Minix system fail or if the key is pressed early at boot
     time. The command line processor reads lines of input from
     the console. Each line is broken into space separated words.
     Empty lines are ignored. The first word names a command to
     be executed. Subsequent words are used as arguments. The
     following section lists the commands that are available.

     help
          Print a small summary of the commands which are avail-
          able.

     configure [-d] [file]
          Alter the current configuration. If a file is speci-
          fied, the alterations are taken from the named confi-
          guration file, otherwise the alterations are performed
          interactively. When the alterations are performed
          interactively, responding with a single space or an
          empty line will cause the current setting to be
          retained. The switches have the following interpreta-
          tions:

          -d Reset the configuration to the default first.

     display
          Display the current configuration.

     load [image]
          Load a prebuilt Minix system and start it. If no name
          is provided, the name is taken from the load setting in
          the current configuration.

     boot
          Boot a Minix system by assembling all the components.
          The components will be assembled according to the
          current configuration setting. The relevant configura-
          tion entries are kernel, mm, fs, and init. The current
          environment is passed to the Minix kernel.

     cat [file ...]
          Print the contents of the named files on the console.

Printed 12/6/89 Minix 3

ShoeLace(8) Minix Programmers' Guide ShoeLace(8)

     ls [directory ...]
          List the contents of the named directories. If no
          directories are specified, the contents of the root
          directory on the boot volume are listed.

     fsck [-acizrlsm]
          Check the file system on the boot volume. The options
          have the following meanings:

          -a Automatically repair the file system and if ques-
             tions are asked, provide the default response.

          -c Ask for a list of inodes to be listed.

          -i Ask for a list of inodes to be checked.

          -z Ask for a list of zones to be checked.

          -r Repair the file system if anything is found to be
             wrong.

          -l List the structure of the file system.

          -s List the contents of the super block.

          -m Make a file system. This option is capable of des-
             troying the boot volume. You have been warned. It is
             present to allow new floppy file systems to be made
             at boot time just as in the original Minix boot pro-
             cess.

     printenv
          Print the current environment strings.

     run [file ...]
          Load and run the named files.

     setdev name device
          Set an environment string to the major and minor
          numbers of the named device.

     setenv name value
          Set the value of an environment string.

     unsetenv name
          Remove the named environment string.

DEVICE NAMES
     The device names used with the setdev commands should be one
     of /dev/hdn, /dev/fdn or /dev/atn, in which n is a small
     number. The major and minor device numbers will be obtained
     from the special files in the directory /dev on the boot

Printed 12/6/89 Minix 4

ShoeLace(8) Minix Programmers' Guide ShoeLace(8)

     volume. If the a suitable special file is not available, a
     guess will be made using the numbers compiled into the code
     from shoelace.h. It is also possible to use the pseudo-
     device name bootdev to specify the guessed major and minor
     numbers for the boot volume.

ENVIRONMENT STRINGS
     The kernel will be passed a set of environment strings.
     ShoeLace knows about some important string names:

     keyboard number
          The keyboard scan code. With the old bootstrap, the
          standalone fsck would prompt the user to start Minix by
          pressing the `=' key. The resulting scan code would be
          passed to the Minix console driver to set up the key-
          board translation table. When ShoeLace boots Minix by
          assembling the system components, fsck is no longer
          run. The scan code is passed to Minix as the code for
          the `=' key. The default value is 13.

     processor number
          Constrains the bootstrapped Minix system to run as if
          it were using the specified processor. This option is
          supported by Bruce Evans' kernel. Useful values are:

          -1 Unconstrained processor.
          386 Limit processor to 80386.
          286 Limit processor to 80286.
          186 Limit processor to 80186.
          86 Limit processor to 8086.

     rootdev device
          Set the name of the root device that Minix will use.
          The default is /dev/ram.

     ramimagedev device
          Set the name of the device on which the ram disk image
          is stored. This name is used by the Minix to initialise
          the ram disk if it is the root file system. The default
          is /dev/fd0.

     ramsize number
          Set the size of the ram disk in blocks. This size will
          only be used to allocate the ram disk if it is not
          being used as the root device. If the ram disk is being
          use as the root device, the size of the ram disk will
          be set by the size of the ram disk image and the ram-
          size command will have no effect. The default value is
          zero.

RUNNING PROGRAMS
     Programs run from either the configuration file or the

Printed 12/6/89 Minix 5

ShoeLace(8) Minix Programmers' Guide ShoeLace(8)

     command line processor are loaded into memory at an arbi-
     trary segment boundary. The files are assumed to be execut-
     ables in the style of DOS TSR programs. Furthermore they
     are assumed to be .com files stored with valid a.out header.
     This option is currently present to support loading of Bruce
     Evans' debugger. Future versions of ShoeLace will probably
     incorporate a small DOS function emulator to make it easier
     to use the same code for both DOS and ShoeLace. Only DOS
     interrupt 0x21 is used. Other interrupts are not initialised
     by ShoeLace. Split I&D programs may also be supported in
     the future.

     Programs exit using the DOS exit function or TSR exit func-
     tion. ShoeLace will reclaim the memory allocated for the
     program if termination is via the DOS exit function. Memory
     will not be reclaimed if the program uses the TSR exit func-
     tion. If the program uses the TSR exit function, ShoeLace
     will examine the word at location 0:0x413. This is inter-
     preted to be the amount of ram available (to the nearest
     kb). If the program has not altered the value, ShoeLace will
     reload the location to point at the base of the loaded pro-
     gram. ShoeLace will then relocate to the top of the avail-
     able memory. Thus programs can use 0:0x413 to determine
     where the current top of memory is and can relocate them-
     selves if necessary. Furthermore, they can reload 0:0x413 to
     indicate how much memory.

LOADING STRATEGY
     ShoeLace expects to be loaded into memory by BootLace and
     will use the return address pushed onto the stack to locate
     the BootLace corpse containing the boot parameter block and
     disk code. This information is used by ShoeLace to access
     the file system on the volume.

     Low memory becomes crowded when Minix is loaded. For this
     reason ShoeLace moves itself safely out of the way to the
     very top of memory. The amount of memory available on the
     system is determined by inspecting the word at location
     0:0x413. ShoeLace relocates itself so that it occupies the
     topmost 64kb of memory (aligned to a 64kb address boundary).
     When running programs (such as the debugger) ShoeLace will
     stack these programs starting at the top of memory. In order
     to do this, ShoeLace will move itself down to make room.

FILES
     /shoelace
     /etc/laceup
     /etc/bootlace
     /etc/config
     /minix
     /kernel
     /fs

Printed 12/6/89 Minix 6

ShoeLace(8) Minix Programmers' Guide ShoeLace(8)

     /mm
     /init

SEE ALSO
     laceup(8), bootlace(8), build(8)

Printed 12/6/89 Minix 7

-- 
_____________________________________________________________________________
Alejandro Liu           |EMail: aliu@usc.edu |All mispellings are intentional
3131 Mc Clintock #373F  |Voice: 213-745-2431 |Anything mentioned here is not
Los Angeles, CA 90007   |                    |necessarily true.