Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  The boot sector on a DOS diskette or in a DOS partition on a fixed disk
  consists primarily of a short machine-language program that starts the
  process of loading DOS into memory. As we mentioned, to perform this task
  the ROM BIOS checks to see whether the disk is bootable and then proceeds
  accordingly.

  --------------------------------------------------------------------------
  NOTE:
    A bootable disk contains the start-up programs for an operating system
    or for a stand-alone application that runs without operating-system
    support. In the case of DOS, a bootable disk contains two hidden files
    that represent the DOS start-up routines and essential low-level DOS
    functions. See Chapter 3, page 45 for details about these files.
  --------------------------------------------------------------------------

  You can inspect the boot program by using the DOS DEBUG utility, which
  combines the ability to read data from any sector on a disk with the
  ability to disassemble--or unassemble--machine language into
  assembly-language code. If you want to learn more about the boot program
  and you aren't intimidated by DEBUG's terse command format, place a
  bootable diskette in drive A and enter the following commands to display
  the diskette's boot program:

  DEBUG
  L 0 0 0 1           ; load first logical sector
  U 0 L 3             ; unassemble and list first and second bytes

  At this point, DEBUG will display the first instruction in the boot
  program, a JMP to the address that contains the rest of the program. Use
  DEBUG's U command with the address specified in the JMP to inspect the
  rest of the boot program. For example, if the first instruction is JMP
  0036, enter

  U 0036          ; unassemble and list next portion of boot program

  For all disk formats (except diskettes formatted with eight sectors per
  track) you will find some key parameters in the boot sector, beginning
  with the 11th byte. (See Figure 5-9.) These parameters are part of the
  BIOS parameter block used by DOS to control any disk-type device. If
  you're using DEBUG to inspect the boot sector of a diskette in drive A,
  you can see a hexadecimal dump of the BIOS parameter block by entering the
  following command:

  D 0B L 1B

  Offset         Length         Description
  --------------------------------------------------------------------------
  03H            8 bytes        System ID
  0BH            1 word         Number of bytes per sector
  0DH            1 byte         Number of sectors per cluster
  0EH            1 word         Number of sectors in reserved area
  10H            1 byte         Number of copies of FAT
  11H            1 word         Number of root directory entries
  13H            1 word         Total number of sectors
  15H            1 byte         DOS media descriptor
  16H            1 word         Number of sectors per FAT
  18H            1 word         Number of sectors per track
  1AH            1 word         Number of heads (sides)
  1CH            1 word         Number of hidden sectors
  --------------------------------------------------------------------------

  Figure 5-9.  The BIOS parameter block in the boot sector.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson