File: x456.html

package info (click to toggle)
etherboot 5.4.3%2Bdfsg-0.2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 9,844 kB
  • ctags: 34,534
  • sloc: ansic: 104,914; asm: 6,606; perl: 2,795; makefile: 1,113; sh: 448; java: 324; xml: 14
file content (441 lines) | stat: -rw-r--r-- 10,128 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
<HTML
><HEAD
><TITLE
>Image Format with Initial Magic Number.</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
HREF="t1.html"><LINK
REL="UP"
TITLE="Draft Net Boot Image Proposal 0.3, June 15, 1997"
HREF="tagged.html"><LINK
REL="PREVIOUS"
TITLE="Net Boot Process Description"
HREF="x433.html"><LINK
REL="NEXT"
TITLE="Boot prom entry points."
HREF="x501.html"></HEAD
><BODY
CLASS="sect1"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
></TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x433.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>A. Draft Net Boot Image Proposal 0.3, June 15, 1997</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x501.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="AEN456"
></A
>Image Format with Initial Magic Number.</H1
><P
>&#13;The first 512 bytes of the image file contain the image header,
and image loading information records. This contains all the
information needed by the net boot process as to where data
is to be loaded.
</P
><P
>&#13;The magic number (in time-honoured tradition (well why not?)) is:

<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="programlisting"
>&#13;        0 = 36h
        1 = 13h
        2 = 03h
        3 = 1Bh
</PRE
></TD
></TR
></TABLE
>

Apart from the two magic numbers, all words and double words are in PC
native endian.
</P
><P
>&#13;Including the initial magic number the header record is:

<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="programlisting"
>&#13;        +---------------------+
        |                     |
        | Initial Magic No.   |  4 bytes
        +---------------------+
        |                     |
        | Flags and length    |  double word
        +---------------------+
        |                     |
        | Location Address    |  double word in ds:bx format
        +---------------------+
        |                     |
        | Execute Address     |  double word in cs:ip format
        +---------------------+
</PRE
></TD
></TR
></TABLE
>

The Location address is where to place the 512 bytes. The net boot
process does this before loading the rest of the image. The location
address cannot be one of the reserved locations mentioned above, but
must be an address lower than 100000h.
</P
><P
>&#13;The rest of the image must not overwrite these initial 512 bytes, placed
at the required location. The writing of data by the net boot process
into these 512 bytes is deprecated. These 512 bytes must be available for
the image to interogate once it is loaded and running.
</P
><P
>&#13;The execute address is the location in cs:ip of the initial instruction
once the full image has been loaded. This must be lower than 100000h,
since the initial instructions will be executed in 8086 mode. When the
jump (actually a far call) is made to the boot image, the stack contains a
far return address, with a far pointer parameter above that, pointing
to the location of this header.
</P
><P
>&#13;<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>(ky)</I
></SPAN
> If bit 31 in the flags is set, then the execute address is
interpreted as a linear 32-bit address, and a call is made to this
address. There is no restriction on the range of the execute address.
The arguments to the routine are: a pointer to an Etherboot specific
header, a pointer to the tagged image header, and a pointer to the bootp
reply.  The called routine may return to the boot loader.<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>(ky)</I
></SPAN
>
</P
><P
>&#13;The flags and length field is broken up in the following way:
</P
><P
>&#13;Bits 0 to 3 (lowest 4 bits) define the length of the non-vendor header in
double words. Currently the value is 4.
</P
><P
>&#13;Bits 4 to 7 define the length required by the vendor extra information
in double words. A value of zero indicates no extra vendor information.
</P
><P
>&#13;<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>(gk)</I
></SPAN
>Bit 8 is set if the boot image can return to the net boot
process after execution. If this bit is not set the boot image does
never return to the net boot process, and the net boot program has to
set the system into a clean state before calling the boot
image.<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>(gk)</I
></SPAN
>
</P
><P
>&#13;<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>(ky)</I
></SPAN
>Bit 31 is set if the execute address of the boot image is a
linear 32-bit address to be called. The boot image may return to the
boot loader.<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>(ky)</I
></SPAN
>
</P
><P
>&#13;<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>(gk+ky)</I
></SPAN
>Bits 9 to 30 are reserved for future use and must be set to
zero.<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>(gk+ky)</I
></SPAN
>
</P
><P
>&#13;After this header, and any vendor header, come the image loading information
records. These specify where data is to be loaded, how long it is, and
communicates to the loaded image what sort of data it is.
</P
><P
>&#13;The format of each image loading information record is :

<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="programlisting"
>&#13;          +---------------------+
          | Flags, tags and     |  double word
          | lengths             |
          +---------------------+
          |                     |
          | Load Address        |  double word
          +---------------------+
          |                     |
          | Image Length        |  double word
          +---------------------+
          |                     |
          | Memory Length       |  double word
          +---------------------+
</PRE
></TD
></TR
></TABLE
>

Each image loading information record follows the previous, or the header.
</P
><P
>&#13;The memory length, image length and load address fields are unsigned 32
numbers. They do not have the segment:offset format used by the 8086.
</P
><P
>&#13;The flags, tags and lengths field is broken up as follows:
</P
><P
>&#13;Bits 0 to 3 (lowest 4 bits) are the length of the non vendor part of this
header in double words. Currently this value is 4.
</P
><P
>&#13;Bits 4 to 7 indicate the length of any vendor information, in double words.
</P
><P
>&#13;Bits 8 to 15 are for vendor's tags. The vendor tag is a private number that
the loaded image can use to determine what sort of image is at this particular
location.
</P
><P
>&#13;Bits 16 to 23 are for future expansion and should be set to zero.
</P
><P
>&#13;Bits 24 to 31 are for flags, which are defined later.
</P
><P
>&#13;Vendors may place further information after this information record, and
before the next. Each information record may have a different vendor
length.
</P
><P
>&#13;There are two restrictions on vendor information.
</P
><P
>&#13;One is that the header and all information records that the net boot process
is to use fall within the first 512 bytes.
</P
><P
>&#13;The second restriction is that the net boot process must ignore all
vendor additions. The net boot process may not overwrite vendor supplied
information, or other undefined data in the initial 512 bytes.
</P
><P
>&#13;The flags are used to modify the load address field, and to indicate
that this is the last information record that the net boot process should
use.
</P
><P
>&#13;Bit 24 works in conjunction with bit 25 to specify the meaning of the
load address.

<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="programlisting"
>&#13;  B24    B25

   0     0    load address is an absolute 32 number

   1     0    add the load address to the location one past the last byte
	      of the memory area required by the last image loaded.
	      If the first image, then add to 512 plus the location
	      where the 512 bytes were placed

   0     1    subtract the load address from the one past the
	      last writeable location in memory. Thus 1 would
	      be the last location one could write in memory.

   1     1    load address is subtracted from the start of
	      the last image loaded. If the first image, then
	      subtract from the start of where the 512 bytes were
	      placed
</PRE
></TD
></TR
></TABLE
>

(For convenience bit 24 is byte 0 of the flag field)
</P
><P
>&#13;Bit 26 is the end marker for the net boot process. It is set when
this is the last information record the net boot process should
look at. More records may be present, but the net boot process will not
look at them. (Vendors can continue information records out past the 512
boundary for private use in this manner).
</P
><P
>&#13;The image length tells the net boot process how many bytes are to be loaded.
Zero is a valid value. This can be used to mark memory areas such as
shared memory for interprocessor communication, flash eproms, data in eproms.
</P
><P
>&#13;The image length can also be different from the memory length. This allows
decompression programs to fluff up the kernel image. It also allows a file
system to be larger then the loaded file system image.
</P
><P
>&#13;Bits 27 through 31 are not defined as yet and must be set to zero until
they are.
</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x433.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="t1.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x501.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Net Boot Process Description</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="tagged.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Boot prom entry points.</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>