home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / minix / 5139 < prev    next >
Encoding:
Text File  |  1993-01-12  |  9.9 KB  |  223 lines

  1. Newsgroups: comp.os.minix
  2. Path: sparky!uunet!mcsun!sun4nl!star.cs.vu.nl!kjb
  3. From: kjb@cs.vu.nl (Kees J. Bot)
  4. Subject: [PC,Source] Minix Boot Monitor 1.5 part 0/4
  5. Message-ID: <C0qxD3.LD2@cs.vu.nl>
  6. Sender: news@cs.vu.nl
  7. Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
  8. Date: Tue, 12 Jan 1993 14:53:27 GMT
  9. Lines: 212
  10.  
  11. The next four articles contain the sources of the Minix Boot Monitor
  12. version 1.5.  Short explanation: "It boots Minix from floppy or hard
  13. disk.".  Long explanation:  The README attached below.
  14.  
  15. Version history:
  16.  
  17.   1.0 - 1.2.    Writing and debugging.
  18.  
  19.   1.3.        Released to the net in March of '92.
  20.  
  21.   1.4.        Presented to Andy in October.  It was accepted after
  22.         some changes and simplifications and put into tools to
  23.         replace the old build/menu complex.
  24.  
  25.   1.5.        This version is basically the same as 1.4, but it is the
  26.         full distribution, you could say 1.4 good enough for 90%
  27.         of the users, and 1.5 is for the 10% that need some of
  28.         the extra features.
  29.  
  30. Naming differences between 1.4 and 1.5.
  31.   Andy did not like the names on the utilities in the package, and I do
  32.   not like the naming he has chosen.  Look at it as an advantage,
  33.   because now one can keep the two packages apart.  These files/calls
  34.   are the same:
  35.  
  36.     1.4        1.5
  37.     bootblk        bootblock    Bootstrap code in sector 0
  38.     monitor        boot        Monitor + Minix boot code.
  39.     construct    installboot    Install boot code + Make image
  40.     monhead.s    boothead.s    Low level, BIOS support
  41.     mon1.c        boot.c        Command mode, booting other O.S.'s
  42.     mon2.c        bootimage.c    To pull a Minix image in core
  43.     rawfs.c        rawfs.c        Raw file system library
  44.   /usr/include/tools.h    *.h
  45.     construct -i    installboot -i        Make an image
  46.     construct -b    installboot -b        Make a separate boot disk
  47.     construct -d    installboot -demo   Make a demo disk
  48.     construct -h    installboot -d        Make a root device bootable
  49.     (construct -m)    installboot -m        Install a master bootstrap
  50.  
  51. Reasons for wanting this package over the 1.6.24b tools:
  52.   - It runs under 1.5 and 1.6 (Tested to work with the K&R compiler.)
  53.   - 14 pages of documentation.
  54.   - Support for booting stupid bootstrap loaders as found in SysVr4 and
  55.     (I think) Xenix.
  56.   - The command mode assumes that you are an unfriendly user.
  57.  
  58. Both version 1.4 and 1.5 can boot a kernel in 386 mode, but the bcc
  59. assembly for mpx386.x has not been written yet.  (The ACK assembly must
  60. be translated).  I'm working on it.
  61.  
  62. This package can also be obtained from ftp.cs.vu.nl:kjb/monitor-1.5 if
  63. you miss one of the postings.  There are also 16-bit binaries of the
  64. monitor there for if you have trouble compiling them for Minix-386.
  65. --
  66.                             Kees J. Bot  (kjb@cs.vu.nl)
  67.                   Systems Programmer, Vrije Universiteit Amsterdam
  68. _._. .._ _   ._ ._.. ___ _. __.   _ .... .   _.. ___ _ _ . _..   ._.. .. _. .
  69.  
  70.  
  71. README(8)                 Minix Programmer's Manual                  README(8)
  72.  
  73.  
  74. Minix Boot Monitor 1.5
  75.      This package contains a flexible Minix bootstrap loader that may be  used
  76.      to  boot  Minix from either floppy or hard disk.  Use it to replace build
  77.      to make a simple boot diskette, or to dress up  a  hard  disk  root  file
  78.      system  for  an automatic boot at power on.  The monitor mode gives you a
  79.      powerful Bourne shell like interface to configure and boot Minix,  or  to
  80.      boot other operating systems.
  81.  
  82. Installation
  83.      First of all: Be Careful.  The installboot program should  normally  only
  84.      be used on floppy devices, or on your hard disk root file system with the
  85.      -device option.  Better make a copy of the device you are going to use it
  86.      on.   Don't  be  alarmed  however,  unless I made a terrible mistake, the
  87.      -device option should only write the boot block,  and  the  -boot  option
  88.      halts  for  ten  seconds when it is about to scribble over a file system.
  89.      Nevertheless, you should test this on a floppy first.
  90.  
  91. Where to place this package
  92.      I suggest you make a directory '/usr/src/util' and  extract  the  package
  93.      there.   (Next to its idiot brother in tools.)  The Makefile assumes that
  94.      it can find the kernel and fs directories by following '..'.
  95.  
  96. Compiling
  97.      The Makefile and the assembly files  are  written  for  the  ACK  ANSI  C
  98.      compiler,  but  you can type 'config kr' to transform these files for the
  99.      old ACK K&R C compiler.  Running 'config ansi'  will  retrieve  the  ANSI
  100.      files from the directory 'ansi', removing the K&R set.  Now run 'make'.
  101.  
  102. Differences with 1.3
  103.      Version 1.3 had a kluge that made it say 'PS0' to Minix when booting from
  104.      a  1.44Mb  diskette.  This version needs -DMINIX15 added to CFLAGS in the
  105.      Makefile to enable this trick, because Minix 1.6  can  now  autodetect  a
  106.      1.44Mb floppy.
  107.  
  108.      The main difference with 1.3 is the changed menu  interface,  instead  of
  109.      fixed  built  in  functions  for  menu items, one can now define the menu
  110.      items dynamically.  You will have to  change  things  like  'dos()  {boot
  111.      hd1}'  into  'dos(d,Boot  MS-DOS) {boot hd1}'.  I changed the name of the
  112.      default function action into main, to keep 1.5 from executing 1.3 junk.
  113.  
  114. How Does it Work?
  115.      The driving force behind the development of this package was  the  simple
  116.      way the SunOS systems I normally work with are booted:  The ROM bootstrap
  117.      reads and executes the boot block, the boot block reads and executes  the
  118.      program  /boot,  and /boot reads and executes /vmunix, which contains the
  119.      kernel.  So I decided to make something just like that with the exception
  120.      that  /vmunix  should  of  course be named /minix.  Furthermore, I wanted
  121.      /boot to have the functionality  that  is  normally  found  in  ROM  boot
  122.      monitors:  Set  parameters,  select  the root device, and be able to boot
  123.      other devices.
  124.  
  125. Replacing build
  126.      The monitor in its most primitive mode may be used to make a simple  boot
  127.      floppy.  This is what 'make floppy' does:
  128.  
  129.           installboot -image image kernel mm fs init
  130.  
  131.           installboot -boot /dev/fd0 bootblock boot image
  132.  
  133.      After booting, you will see a menu interface with just one choice: "Start
  134.      Minix".   The kernel has not been loaded yet, that happens after you type
  135.      '='.  When it asks you to insert your root floppy you can either  do  so,
  136.      or just hit RETURN to use /dev/hd3 as root.
  137.  
  138. Make a device bootable
  139.      Now is the right time to read the installboot(8) manual page in  the  cat
  140.      directory.   I  will just repeat the example given there to complete this
  141.      story.
  142.  
  143.      To make a Minix file system /dev/fd0 mounted on /mnt bootable, enter  the
  144.      following:
  145.  
  146.           cp boot /mnt/boot
  147.  
  148.           installboot -image /mnt/minix kernel mm fs init
  149.  
  150.           installboot -device /dev/fd0 bootblock boot
  151.  
  152. I don't have those kernel binaries.
  153.      The command demolish(8) can take an image made by build to  pieces.   Use
  154.      'make  demolish' to make it, and read the manual page to understand why I
  155.      can't guarantee success.
  156.  
  157. My root FS is too small
  158.      The /boot and /minix files are dead weight on a  RAM  disk,  so  you  can
  159.      remove them by placing this code in /etc/rc:
  160.  
  161.           case `printroot` in
  162.           /dev/ram*) rm -rf /boot /minix
  163.           esac
  164.  
  165.      If your root FS is too small to even contain /boot and /minix,  then  you
  166.      can try the -boot option on installboot to make a separate boot diskette,
  167.      or you can use the -demo option to place the  kernel  image  outside  the
  168.      file system.
  169.  
  170. After the floppy test
  171.      Try if you can boot a hard disk partition with the boot command from  the
  172.      monitor  after  booting  the  floppy,  an  MS-DOS partition for instance.
  173.      After you've seen that work, make a Minix partition bootable, and try  to
  174.      boot  it  from  the  floppy.  You can now make the Minix partition active
  175.      with fdisk(8).  (I've had one report on an XT whose  master  boot  record
  176.      could  not  boot non-DOS partitions.  Installing my master boot code with
  177.      installboot -master cured the problem.)
  178.  
  179. The Manual Pages
  180.      I urge you to read  the  manual  pages,  this  README  describes  only  a
  181.      fraction  of  what  the monitor can do.  Feel free to ask me questions if
  182.      the details elude you, they may help me to improve things.
  183.  
  184. The Competition
  185.      The advantages of the monitor over competitive boot loaders:
  186.  
  187.           The bootstrap and monitor are  wholly  contained  within  the  Minix
  188.           partition,  the  master  bootstrap  is  not  touched.  (This package
  189.           contains a normal master bootstrap if you lost the  original,  fdisk
  190.           /mbr under MS-DOS 5.0 will also reinstall the master bootstrap.)
  191.  
  192.           The bootstrap is independent from the media it's on.  Bootable  file
  193.           systems  may  be copied between floppies of a different type or hard
  194.           disk partitions using dd(1) and they will still be bootable.
  195.  
  196.           The bootstrap is only one sector, so it can never span tracks.
  197.  
  198.           Both V1 and V2 file systems are supported under Minix 1.6.
  199.  
  200.           Kernel binaries are combined in one image for fast loading and  easy
  201.           manipulation of different kernel versions.
  202.  
  203.           The interface is configurable at the  boot  prompt  or  by  using  a
  204.           program  that  simulates  the  boot monitor interface.  You can have
  205.           Minix booted in 5 seconds if no key is typed to a menu interface for
  206.           instance.   (The menu interface looks much better than a hex dump of
  207.           your partition table.)
  208.  
  209.           Only two files are enough on a boot device: /boot and /minix.
  210.  
  211.           The monitor can call a kernel in 386 mode.  This allows for a kernel
  212.           that is completely compiled in 386 mode.
  213.  
  214. Copyright
  215.      Copyright 1992 Kees J. Bot, All rights reserved.
  216.      This package may only be used in combination with Minix.  Changes that do
  217.      not increase the functionality or that are incompatible with the original
  218.      may not be released to the public without  permission  from  the  author.
  219.      Use of so called "C beautifiers" is explicitly prohibited.
  220.  
  221. Author
  222.      Kees J. Bot (kjb@cs.vu.nl)
  223.