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 - the rom bootstrap loader's only function is to read a bootstrap program http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
    The ROM bootstrap loader's only function is to read a bootstrap program
    from a disk and transfer control to it. On a bootable DOS disk, the disk
    bootstrap program verifies that DOS is stored on the disk by looking for
    two hidden files named IBMBIO.COM and IBMDOS.COM. If it finds them, it
    loads them into memory along with the DOS command interpreter,
    COMMAND.COM. During this loading process, optional parts of DOS, such as
    installable device drivers, may also be loaded.

    The IBMBIO.COM file contains extensions to the ROM BIOS. These
    extensions can be changes or additions to the basic I/O operations and
    often include corrections to the existing ROM BIOS, new routines for new
    equipment, or customized changes to the standard ROM BIOS routines.
    Because they are part of disk software, the IBMBIO.COM routines provide
    a convenient way to modify the ROM BIOS. All that is necessary, besides
    the new routine, is that the interrupt vectors for the previous ROM BIOS
    routines be changed to point to the location in memory where the new
    disk BIOS routines are placed. Whenever new devices are added to the
    computer, their support programs can be included in the IBMBIO.COM file
    or as installable device drivers, eliminating the need to replace ROM
    chips. See Appendix A for more on device drivers.

    You can think of the ROM BIOS routines as the lowest-level system
    software available, performing the most fundamental and primitive I/O
    operations. The IBMBIO.COM routines, being extensions of the ROM BIOS,
    are essentially on the same low level, also providing basic functions.
    By comparison, the IBMDOS.COM routines are more sophisticated; think of
    them as occupying the next level up, with applications programs on top.

    The IBMDOS.COM file contains the DOS service routines. The DOS services,
    like the BIOS services, can be called by programs through a set of
    interrupts whose vectors are placed in the interrupt-vector table in low
    memory. One of the DOS interrupts, interrupt 21H (decimal 33), is
    particularly important because when invoked, it gives you access to a
    rather large group of DOS functions. The DOS functions provide more
    sophisticated and efficient control over the I/O operations than the
    BIOS routines do, especially with regard to disk file operations. All
    standard disk processes--formatting diskettes; reading and writing data;
    opening, closing, and deleting files; performing directory searches--are
    included in the DOS functions and provide the foundation for many
    higher-level DOS programs, such as FORMAT, COPY, and DIR. Your programs
    can use the DOS services when they need more control of I/O operations
    than programming languages allow, and when you are reluctant to dig all
    the way down to the BIOS level. The DOS services are a very important
    part of this book, and we have devoted five chapters to them. (See
    Chapters 14 through 18.)

    The COMMAND.COM file is the third and most important part of DOS, at
    least from a utilitarian standpoint. This file contains the routines
    that interpret the commands you type in through the keyboard in the DOS
    command mode. By comparing your input to a table of command names, the
    COMMAND.COM program can differentiate between internal commands that are
    part of the COMMAND.COM file, such as RENAME or ERASE, and external
    commands, such as the DOS utility programs (like DEBUG) or one of your
    own programs. The command interpreter acts by executing the required
    routines for internal commands or by searching for the requested
    programs on disk and loading them into memory. The whole subject of the
    COMMAND.COM file and how it works is intriguing and well worth
    investigating--as are the other DOS programs. We recommend you read the
    DOS Technical Reference Manual or Inside the IBM PC for additional
    information.
  --------------------------------------------------------------------------

  Software interrupts incorporated into the PC design are part of the ROM
  BIOS programs. ROM BIOS routines invoked by these interrupts cannot be
  changed, but the vectors that point to them can be changed to point to
  different routines. Reserved interrupt numbers are 10H through 1FH
  (decimal 16 through 31) and 40H through 5FH (decimal 64 through 95).

  DOS interrupts are always available when DOS is in use. Many programs and
  programming languages use the services provided by DOS through the DOS
  interrupts to handle basic operations, especially disk I/O. DOS interrupt
  numbers are 20H through 3FH (decimal 32 through 63).

  BASIC interrupts are assigned by BASIC itself and are always available
  when BASIC is in use. The reserved interrupt numbers are 80H through F0H
  (decimal 128 through 240).

  General-use interrupts are available for temporary use in your programs.
  The reserved interrupt numbers are 60H through 66H (decimal 96 through
  102).

  Most of the interrupt vectors used by the ROM BIOS, DOS, and BASIC contain
  the addresses of interrupt handlers. A few interrupt vectors, however,
  point to tables of useful information. For example, interrupt 1EH contains
  the address of a table of diskette drive initialization parameters; the
  interrupt 1FH vector points to a table of bit patterns used by the ROM
  BIOS to display text characters; and interrupts 41H and 46H point to
  tables of fixed-disk parameters. These interrupt vectors are used for
  convenience, not for interrupts. If you tried to execute interrupt 1EH,
  for instance, you'd probably crash the system because the interrupt 1EH
  vector points to data, not to executable code.

  The interrupt vectors are stored at the lowest memory locations; the very
  first location in memory contains the vector for interrupt number 00H, and
  so on. Because each vector is two words in length, you can find a
  particular interrupt's location in memory by multiplying its interrupt
  number by 4. For example, the vector for interrupt 05H, the print-screen
  service interrupt, would be at byte offset 20 (5 x 4 = 20); that is, at
  address 0000:0014H. You can examine the interrupt vectors by using DEBUG.
  For example, you could examine the interrupt 05H vector with DEBUG in the
  following way:

  DEBUG
  D 0000:0014 L 4

  DEBUG will show 4 bytes, in hex, like this:

  54 FF 00 F0

  Converted to a segment and offset address and allowing for "back-words"
  storage, the interrupt vector for the entry point in ROM of the
  print-screen service routine (interrupt 05H) is F000:FF54H. (Of course,
  this address may be different in different members of the PC and PS/2
  families.) The same DEBUG instruction finds any other interrupt vector
  just as easily.

  Figure 3-1 lists the main interrupts and their vector locations. These
  are the interrupts that programmers will probably find most useful.
  Details are available for most of these interrupts in Chapters 8 through
  18. Interrupts that are not mentioned in this list are, for the most part,
  reserved for future development by IBM.


  Interrupt   Offset in    Use
  Hex   Dec   Segment
              0000
  --------------------------------------------------------------------------
  00H   0     0000         Generated by CPU when division by zero is
                           attempted
  01H   1     0004         Used to single-step through programs (as with
                           DEBUG)
  02H   2     0008         Nonmaskable interrupt (NMI)
  03H   3     000C         Used to set break-points in programs (as with
                           DEBUG)
  04H   4     0010         Generated when arithmetic result overflows
  05H   5     0014         Invokes print-screen service routine in ROM BIOS
  08H   8     0020         Generated by hardware clock tick
  09H   9     0024         Generated by keyboard action
  0EH   14    0038         Signals diskette attention (e.g. to signal
                           completion)
  0FH   15    003C         Used in printer control
  10H   16    0040         Invokes video display services in ROM BIOS
  11H   17    0044         Invokes equipment-list service in ROM BIOS
  12H   18    0048         Invokes memory-size service in ROM BIOS
  13H   19    004C         Invokes disk services in ROM BIOS
  14H   20    0050         Invokes communications services in ROM BIOS
  15H   21    0054         Invokes system services in ROM BIOS
  16H   22    0058         Invokes standard keyboard services in ROM BIOS
  17H   23    005C         Invokes printer services in ROM BIOS
  18H   24    0060         Activates ROM BASIC language
  19H   25    0064         Invokes bootstrap start-up routine in ROM BIOS
  1AH   26    0068         Invokes time and date services in ROM BIOS
  1BH   27    006C         Interrupt by ROM BIOS for Ctrl-Break
  1CH   28    0070         Interrupt generated at each clock tick
  1DH   29    0074         Points to table of video control parameters
  1EH   30    0078         Points to diskette drive parameter table
  1FH   31    007C         Points to CGA video graphics characters
  20H   32    0080         Invokes program-terminate service in DOS
  21H   33    0084         Invokes all function-call services in DOS
  22H   34    0088         Address of DOS program-terminate routine
  23H   35    008C         Address of DOS keyboard-break handler
  24H   36    0090         Address of DOS critical-error handler
  25H   37    0094         Invokes absolute disk-read service in DOS
  26H   38    0098         Invokes absolute disk-write service in DOS
  27H   39    009C         Ends program, but keeps it in memory under DOS
  2FH   47    00BC         DOS Multiplex interrupt
  41H   65    0104         Points to fixed-disk drive parameter table
  43H   67    010C         Points to video graphics characters (EGA, PS/2s)
  67H   103   019CH        Invokes LIM Expanded Memory Manager
  --------------------------------------------------------------------------


  Figure 3-1.  Important interrupts used in the IBM personal computer
  family.

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