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.
WRITING A CUSTOM FIRST-STAGE DRIVER<br />
5.3 DEVICE READ PROCEDURE<br />
5-4<br />
The device read procedure must present <strong>the</strong> following PL/M -86 interface to <strong>the</strong> Bootstrap<br />
Loader:<br />
device$read: PROCEDURE (unit, blk$num, buf$ptr) PUBLIC;<br />
DECLARE unit WORD,<br />
blk$num DWORD,<br />
buf$ptr POINTER;<br />
END device$read;<br />
where:<br />
(code as described below)<br />
device$read The name of <strong>the</strong> device read procedure. You can choose any name you<br />
wish for this procedure, as long as it does not conflict with <strong>the</strong> names of<br />
any o<strong>the</strong>r first-stage procedure.<br />
unit The device unit number, as defined during Bootstrap Loader<br />
configuration.<br />
blk$num<br />
buf$ptr<br />
A 32-bit number specifying <strong>the</strong> block number <strong>the</strong> Bootstrap Loader<br />
wants <strong>the</strong> procedure to read. The size of each block equals <strong>the</strong> device<br />
granularity, with <strong>the</strong> first block on <strong>the</strong> device being block number o.<br />
A 32-bit POINTER to <strong>the</strong> buffer in which <strong>the</strong> device read procedure<br />
must copy <strong>the</strong> information it reads from <strong>the</strong> secondary storage device.<br />
The device read procedure does not return a value to <strong>the</strong> caller.<br />
To be compatible with <strong>the</strong> Bootstrap Loader, <strong>the</strong> device read procedure must do <strong>the</strong><br />
following steps:<br />
1. Read <strong>the</strong> block specified by blk$num from <strong>the</strong> <strong>bootstrap</strong> device specified by unit into<br />
<strong>the</strong> memory location specified by buf$ptr.<br />
2. Check for I/O errors. If none occur, return to <strong>the</strong> caller. O<strong>the</strong>rwise, combine <strong>the</strong><br />
device code, if any, for <strong>the</strong> device with 01 (in <strong>the</strong> form 01), push <strong>the</strong><br />
resulting word value onto <strong>the</strong> stack, and call <strong>the</strong> BSERROR procedure. For example,<br />
if <strong>the</strong> device code is OB3H, push B301H onto <strong>the</strong> stack, and call BSERROR. If no<br />
device code exists, use 00.<br />
Bootstrap Loader<br />
I<br />
I<br />
\,<br />
(