
TECHNICAL NOTES ON THE MBM

                                                             March 10, 2002


  MBM has being supported graphical extend menu from R0.28. The extend menu
  is separated from boot manager core in order to expand flexibility.
  Therefore, end user can create their own original menu with a menu builder
  or programming its code.

  Boot manager loads and executes extend menu code at start of boot manager.
  However, whichever the conditions as follows satisfied, standard text menu
  will be executed insted of the extend menu.

  - Ctrl key has been pressed.
  - Extend menu is not installed.
  - An error occured when loading extend menu (disk error).
  - Extend menu is broken (check sum error).



Boot sequence


   Load MBR on the first drive
   and execute. MBM gets CPU.
           |
           V
   Load partition names, boot
   manager and jump to it.
           |
           V
     [Ctrl] is presed  -->Yes +
           |No                |
           V                  |
    Is there an extend        |
          menu?        -->No -+
           |Yes               |
           V                  |
     Load extend menu -->Fail-+
           |Pass              |
           V                  |
    Execute extend menu       |
           |        -->Cancel-+
           |Selected          V
           |             Standard menu
           |                  |
            ------------------+
                              V
                            START




Extend Menu Interface


  Extend menu code will be loaded to memory area 0800:0000, and then boot
  manager will call its top address in following format. The extend menu
  must follow this spec. Maximum size of the extend menu is up to 614400bytes.


 CALL EXTEND MENU:

  CALL 0800:0000 (see *1)
   AX = Default item number (0..).
   CX = Number of menu items (1..20).
   DX = Auto start timer in unit of second. Zero means timer is disabled.
   ES:BX -> Item name table (see *2)


 RETURN MENU RESULT:

  FAR RETURN
   AX = Menu Result
     AX < CX : AX is selected item number.
     AX = -1 : Canceled. Enter standard text menu.

  All registers except AX can be broken. Stack is reserved several KB at
  call extend menu, so that it will not require local stack. Video mode
  will be restored by boot manager. However, when use other resouce, extend
  menu must restore them.


  (*1) I recommend the extend menu works based on its loaded address for
       debugging i.e. it's relocatable. And if the extend menu is not built
       so, menu viewer will not able to load it.

  (*2) Item name table that pointed by ES:BX is placed in fixed length fields
       of 32 bytes. Number of the fields are shown by CX. Each item names are
       stored into each field in 30 bytes of ASCIZ string, so that maximum
       number of charactors each name is 29.




STOREING EXTEND MENU


  Extend menu cannot be stored with boot manager because it is too large.
  Therefore, it is stored into a free cylinder. It can also be installed
  into any partition, but it is very dangerous.




STOREING THE BOOT MANAGER INTO THE HARDDISK


  The boot manager cannot be stored into only the MBR. Normaly, the first
  track contains MBR is used only its first sector and following are not
  used, so that MBM uses following 23 sectors to store boot manager and
  menu name table. Therefore, when install boot manager, number of sectors
  of drive to be installed must be 24 or more.
  Thus, boot manager doesn't require any partition for it. Sector usage is
  as follows:

    C:0 H:0 S:1      MBR (Boot manager start up code and partition table)
    C:0 H:0 S:2..6   Partition name teble (for menu items)
    C:0 H:0 S:7..24  Boot manager (*1)
    C:0 H:0 S:25..   <not used>
    C:0 H:1...       <allocated by any partition>

  (*1) The boot manager will be stored to end of the track when install with
  INSTALL_H command. It may able to avoid to collapse sector which has RAID
  information.



ON THE PARTITIONING


  The partition management format on the IBM PC can create up to four
  partitions on a physical drive. When use extend DOS partition (virtural
  drive), it can extend number of partitions like directory tree.

  Each partitions are allocated on the disk in unit of cylinder. It can also
  be allocated in unit of sector depend on format of the partition table. 
  MBM manages partition table in unit of cylinder because most of partitioning
  tools are managing the partition table in unit of cylinder. Cylinder number
  zero is used from track number one.

  A partition may allocated off cylinder boundary when created with a
  partitioning tool except except MBM or FDISK. If edit such drive with MBM,
  all partitions on the drive can be destroyed. This bad partition state
  will be perceived due to MBM occure a partitioning error at start to edit.
  In this case, don't write any changes, provided you would not like to
  destroy any partition.

  This problem is on using partition table editor. Boot manager is not
  affected by allocations even if the partition is allocated off the cylinder
  boundary. 

