Initialization

Recall that device drivers are called once when loaded through the strategy section to pass a DOS pointer, then again through the interrupt section using the Initialization function code. These sections are called just once. The Initialization section can do whatever it needs to set up the device driver, then dispose of much of itself, and one-time code, by returning to DOS a pointer that indicates that the first byte of free space (reused by DOS) is at the address of the once-only code.

The initialization code for BBL has to process any command-line options, set up the pointer to the 8x8 ROM font, build the token-class table, and announce that it has been loaded.

The command-line processing, located in the initialization section, is straightforward recursive-descent code ... not pretty, but it works. I tried to leave a road map for future extension.

The address of the 8x8 ROM font is assumed to be accessible via BIOS calls (true for EGA and VGA, for Phoenix BIOS at least). The command-line options may specify some other choice, and the appropriate address is selected if the option was invoked.

The token-class table is set up so that all characters default to class 0, displayable. The token-class table must reside in the device driver during execution. The exceptions to the default settings are listed in a separate list in the initialization section. The initialization code processes the exceptions from that list into the memory-resident ``TC'' table, and the exceptions list is then discarded by the init code since it is in the ``once-only'' section of the program.

The banner announcing that BBL has been loaded is part of the once-only code and uses the standard DOS INT for string display.