What is a Bootstrap? A bootstrap program is a program which is used to load other programs (usually the Operating System); it needs to be automatically available when a computer is started. A bootstrap program is typically embedded in a computer as codes in ROM.
Requirement for a Bootstrap Without a bootstrap program, every program would need to be manually loaded into memory one bit at a time before it could be run. A bootstrap is a “generic” program loader which allows different Operating Systems or programs to be loaded and run based on installed (usually disk-based) components.
ROM Considerations Unless the bootstrap is embedded in ROM, it would need to be manually loaded, bit-by- bit. However, a ROM bootstrap uses up memory address spaces which can not be used for other programs later (after the ROM bootstrap has no further useful purpose)
How a Bootstrap Loader Might Work input countOfWordsToLoad set ptr to lowestAddressForApplications while (--countOfWordsToLoad) >= 0 input to [ptr] location ptr++ endwhile jump to lowestAddressForApplications
Problems Implementing for LMC Difficult to simulate indirect addressing (the “input to [ptr] location” instruction. any modifiable value must be in RAM (although the bootstrap program must be in ROM)
Implementation in LM-Assembler (assuming ROM starts at 80) ORG 76 // in RAM // subr copied from ROM SRET DAT SSTO DAT SJMP DAT // modifiable variable COUNT DAT // start of ROM ORG 80 // in ROM BOOT IN STO COUNT LDA XSTO STO SSTO LDA XRET STO SRET WHIL LDA COUNT SUB ONE STO COUNT SKPZ JMP 00 // start of app IN CALL SSTO LDA SSTO ADD ONE STO SSTO JMP WHIL ONE DAT 001 XSTO STO 00 XRET JMP SRET
Effects of placing the Bootstrap ROM in high memory addresses When the LMC bootstrap code (from previous slide) is implemented using ROM starting at mailbox address 80, the “Reset” button function needs to be modified to reset the counter to 80 instead of 00. In the general computer model, a “power- on” must set the instruction pointer to the first bootstrap instruction in ROM.
Effects of Alternative Placement of Bootstrap ROM in Low Memory If the bootstrap loader where placed in low memory (at addresses starting at 00 for the LMC), then all other programs would need to be coded with the assumption of starting at some other, higher address. This happened in CP/M microcomputers (which preceded MS-DOS); all applications were assumed to start at address 0100 (hex).