Sunday, October 6, 2013

BIOS Boot Specification


Term

  • IPL Device: Initial Program Load Device, basically, this is floppy drive or hard drive
  • BAID: BIOS Aware IPL Device, which can boot OS but requires BIOS to support it. For example: CD-ROM
  • BCV: Boot Connection Vector, which is a pointer to code inside the option ROM that perform device initialization, detect if a peripheral is attached, and hook INT 13h. 
  • BEV: Bootstrap Entry Vector is a pointer that points to code inside an option ROM which load OS. BEV resides in PnP option ROM Expansion Header.

Overview

  • BIOS creates and maintains a list of all IPL devices found in the system and stores this list in NV memory. 
  • Support devices boot order.
  • Defines the BCV priority. 
  • BIOS will try each devices to boot OS. If none succeeds, wait for a key stroke then invoke INT 19 again.

IPL Devices

  • Includes hard drives, CD-ROM devices ,etc,. 
  • Falls into three categories: BAID, Legacy (dead) and PnP (plug and play).
  • BIOS defines INT 18 as recover vector for failed boot attempt.
  • IPL tables includes: identification information, pointers to description strings, and pointers to handler.
  • Product Name String in PnP Expansion Header is very meaningful to indicate manufacturer information. Only first 32 Bytes are used.
  • Each BAID will have an entry in the IPL Table. INT 19h handler will read this table and boot OS from BAID. BAID doesn't have option ROM.
  • IPL Table and BCV Table Entry Data Structure

  • All IPL devices with option ROMs must contain a valid option ROM header which resides between C0000h and EFFFFh and begin with 55AAh. The address of PnP Expansion Header is within option ROM header at offset (C0000h-EFFFFh)  + 1Ah. PnP Expansion Header contains pointers to code in device's option ROM (BCV or BEV). 

  • BEV: is booted by the BIOS making a far call directly
  • BCV: typically SCSI controller is not directly bootable. Rather, it merely adds drives to the system by hooking into the BIOS's INT 13h services and appending drive numbers to existing drives.
  • Identifying IPL Devices:
            BAIDs are automatically identified by BIOS
            PnP Card is defined by having PnP Expansion Header in option ROM. BEV device will be included in the IPL Priority. BCV device will be called.
            PCI devices with option ROM behave like IPL devices.

IPL Priority


  • An IPL Priority ordinal value is the index of a BAID or BEV device entry in the IPL table.
  • When INT 19h handler gains control, the first IPL device in IPL priority is used to boot.
  • BIOS only recognize a change in the number of BEV devices rather than the type of BEV devices. 
  • For example, when you change your network card,  in IPL priority the ordinal value is not changed, but the entry of IPL table is changed.

BCV Priority



  • The first type of entry in the BCV Table is BIOS's own INT 13h services for ATA drives. 
  • PnP Cards with BCV are the second type of entry in BCV Table.
   

No comments:

Post a Comment