glenda.party
term% ls -F
term% pwd
$home/manuals/plan9_2nd/8/b
term% cat index.txt
B.COM(8)                    System Manager's Manual                   B.COM(8)



NAME
       b.com - PC bootstrap program

SYNOPSIS
       (Under MS-DOS)
       [ drive :][ path ]b [ bootfile ]

DESCRIPTION
       B.com  is  an  MS-DOS program that loads and starts a program in Plan 9
       boot format (-H3 option to 8l (see 2l(1))).  B.com loads  the  bootfile
       at  the entry address specified by the header, usually 0x80100020.  Af‐
       ter loading, control is passed to the entry location.

       B.com can be loaded two ways: either by booting MS-DOS and typing b  in
       the  appropriate  directory, or by preparing a Plan 9 boot floppy using
       format (see prep(8)); such floppies include  and  run  b.com  automati‐
       cally.   With  a  boot floppy, the bootfile must be named explicitly to
       b.com; from DOS it may be named as an argument to the command.

       The bootfile can be specified in one of 3 ways, in order of precedence:
            command-line argument
            configuration file option
            default, based on available devices
       The format of the bootfile name is device!unit!file.  If !file is omit‐
       ted,  the default for the particular device is used.  Supported devices
       are

       fd     An MS-DOS floppy disk.  The bootfile is the contents of the  MS-
              DOS file.  The default file is 9dos.

       e      Ethernet.   File is [host:]pathname.  The default file is deter‐
              mined by the /lib/ndb (see ndb(6)) entry for this PC.

       h      Hard (IDE) disk partition.  The bootfile is the contents of  the
              partition given by file.  The default partition is boot.

       hd     Hard (IDE) disk MS-DOS partition.  As for fd.

       s      SCSI disk boot partition.  As for h.

       sd     SCSI disk MS-DOS partition.  As for fd.

       Unit specifies which disk or Ethernet interface to use.  The default is
       to use the lowest unit number found.

       When b.com starts, it relocates itself to address 0x80000 in the  stan‐
       dard  PC  memory  and switches to 32-bit mode.  It then double maps the
       first 16Mb of physical memory to virtual addresses  0  and  0x80000000.
       Physical  memory  between 0x80000 and 0xA0000 and from 0x200000 upwards
       is used as program and data space.  Next, in order to  find  configura‐
       tion  information,  b.com searches all units on devices fd, hd, and sd,
       in that order, for an MS-DOS  file  system  containing  a  file  called
       plan9\plan9.ini  or  plan9.ini  (see  plan9.ini(8)).   If one is found,
       searching stops and the file is read into memory  at  physical  address
       0x400 where it can be found later by any loaded bootfile.  Some options
       in plan9.ini are used by b.com:

       console

       baud   Specifies the console device and baud rate if not a display.

       etherX (where X is a number) Ethernet interfaces. These can be used  to
              load  the  bootfile over a network.  Probing for Ethernet inter‐
              faces is too prone to error.

       bootfile=device!unit!file
              Specifies the bootfile.  This option is overridden by a command-
              line argument.

       bootfile=auto
              Default.

       bootfile=local
              Like auto, but do not attempt to load over the network.

       bootfile=manual
              After  determining which devices are available for loading from,
              enter prompt mode.

       When the search for plan9.ini is  done,  b.com  proceeds  to  determine
       which bootfile to load.  If there was no command-line argument or boot‐
       file option, b.com chooses a default from the following prioritized de‐
       vice list:
            fd e h hd s sd
       B.com then attempts to load the bootfile unless the bootfile=manual op‐
       tion was given, in which case prompt mode is entered  immediately.   If
       the  default  device is fd, b.com will prompt the user for input before
       proceeding with the default bootfile load after 5 seconds; this  prompt
       is omitted if a command-line argument or bootfile option was given.

       B.com  prints the list of available device!unit pairs and enters prompt
       mode on encountering any error or if directed  to  do  so  by  a  boot‐
       file=manual option.  In prompt mode, the user is required to type a de‐
       vice!unit!file in response to the prompt.

       A control-P character typed at any time on the console causes b.com  to
       perform a hardware reset.

FILES
       [drive:] [ path ]b.com
       MS-DOS filesystem:\plan9.ini

SOURCE
       /sys/src/boot/pc

SEE ALSO
       plan9.ini(8)

BUGS
       When looking for a plan9.ini file, SCSI disk controllers are assumed to
       be at I/O port 0x330.  Only one SCSI controller is recognized.

       Much of the work done by b.com is duplicated by the loaded kernel.

       The BIOS data area at physical address 0x400 should not be overwritten,
       and more use made of the information therein.

       If  b.com  detects  an installed MS-DOS Extended Memory Manager, it at‐
       tempts to de-install it, but the technique used may  not  always  work.
       It  is  safer not to install the Extended Memory Manager before running
       b.com.



                                                                      B.COM(8)