using the bootstrap loader
using the bootstrap loader
using the bootstrap loader
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
", ", """""", " " , " " "", " """"", " ",<br />
Constants and Data<br />
", ", """" "" , " " , " " """ """", ", , " "<br />
data bsmsc segment ;Static Data<br />
wakeup_newdrvl dw lOOH ;MSC wakeup address<br />
device newdrvl db 0<br />
WRITING A CUSTOM FIRST-STAGE DRIVER<br />
drtab newdrvl dw 256 ; number of cylinders<br />
db 2 ; number of fixed heads<br />
db 0 ; number of removable heads<br />
db 9 ; number of sectors<br />
db 1024 ; device granularity<br />
db 5 ; number of alternate cylinders<br />
Figure 5-1. Hard-Coded Configuration Information<br />
5.4.2 Providing a Configuration File<br />
The second way to supply configuration information is to declare all device-specific<br />
parameters as variables that are external to your device driver. A separate small module<br />
can declare <strong>the</strong>se parameters as public variables. You can incorporate this second module<br />
into <strong>the</strong> Bootstrap Loader by placing assembly and link commands in <strong>the</strong> first-stage<br />
SUBMIT file BS1.CSD. To use this approach, follow <strong>the</strong> steps below:<br />
1. In <strong>the</strong> code for <strong>the</strong> device driver, declare <strong>the</strong> device-specific parameters as external<br />
variables. For example, <strong>the</strong> following code could be used instead of <strong>the</strong> hard-coding<br />
shown in Figure 5-1.<br />
name bpmsc<br />
;Configuration information:<br />
extrn<br />
extrn<br />
extrn<br />
Bootstrap Loader<br />
wakeup_newdrvl<br />
device newdrvl<br />
drtab newdrvl<br />
word<br />
byte<br />
byte<br />
;Wakeup port<br />
; address<br />
;Device number<br />
;Device Table<br />
5-7