diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-05-23 19:59:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-23 23:15:34 -0400 |
commit | db2668fdbeb2e3c95ebadf95856c9e31a8a8d569 (patch) | |
tree | c36a55e3c5260740ef30f3c1741e5d8d5e9273cf /Documentation | |
parent | af669c97291c458c97a869bf3c36eb870e7430c1 (diff) |
boot documentation: clarifications
Textual clarifications (and fix an off-by-one error) based on feedback
mostly from Jeremy Fitzhardinge.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/i386/boot.txt | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt index 66fa67fec2a..35985b34d5a 100644 --- a/Documentation/i386/boot.txt +++ b/Documentation/i386/boot.txt | |||
@@ -2,7 +2,7 @@ | |||
2 | ---------------------------- | 2 | ---------------------------- |
3 | 3 | ||
4 | H. Peter Anvin <hpa@zytor.com> | 4 | H. Peter Anvin <hpa@zytor.com> |
5 | Last update 2007-05-16 | 5 | Last update 2007-05-23 |
6 | 6 | ||
7 | On the i386 platform, the Linux kernel uses a rather complicated boot | 7 | On the i386 platform, the Linux kernel uses a rather complicated boot |
8 | convention. This has evolved partially due to historical aspects, as | 8 | convention. This has evolved partially due to historical aspects, as |
@@ -202,6 +202,8 @@ All general purpose boot loaders should write the fields marked | |||
202 | nonstandard address should fill in the fields marked (reloc); other | 202 | nonstandard address should fill in the fields marked (reloc); other |
203 | boot loaders can ignore those fields. | 203 | boot loaders can ignore those fields. |
204 | 204 | ||
205 | The byte order of all fields is littleendian (this is x86, after all.) | ||
206 | |||
205 | Field name: setup_secs | 207 | Field name: setup_secs |
206 | Type: read | 208 | Type: read |
207 | Offset/size: 0x1f1/1 | 209 | Offset/size: 0x1f1/1 |
@@ -280,14 +282,16 @@ Type: read | |||
280 | Offset/size: 0x206/2 | 282 | Offset/size: 0x206/2 |
281 | Protocol: 2.00+ | 283 | Protocol: 2.00+ |
282 | 284 | ||
283 | Contains the boot protocol version, e.g. 0x0204 for version 2.04. | 285 | Contains the boot protocol version, in (major << 8)+minor format, |
286 | e.g. 0x0204 for version 2.04, and 0x0a11 for a hypothetical version | ||
287 | 10.17. | ||
284 | 288 | ||
285 | Field name: readmode_swtch | 289 | Field name: readmode_swtch |
286 | Type: modify (optional) | 290 | Type: modify (optional) |
287 | Offset/size: 0x208/4 | 291 | Offset/size: 0x208/4 |
288 | Protocol: 2.00+ | 292 | Protocol: 2.00+ |
289 | 293 | ||
290 | Boot loader hook (see separate chapter.) | 294 | Boot loader hook (see ADVANCED BOOT LOADER HOOKS below.) |
291 | 295 | ||
292 | Field name: start_sys | 296 | Field name: start_sys |
293 | Type: read | 297 | Type: read |
@@ -304,10 +308,17 @@ Protocol: 2.00+ | |||
304 | If set to a nonzero value, contains a pointer to a NUL-terminated | 308 | If set to a nonzero value, contains a pointer to a NUL-terminated |
305 | human-readable kernel version number string, less 0x200. This can | 309 | human-readable kernel version number string, less 0x200. This can |
306 | be used to display the kernel version to the user. This value | 310 | be used to display the kernel version to the user. This value |
307 | should be less than (0x200*setup_sects). For example, if this value | 311 | should be less than (0x200*setup_sects). |
308 | is set to 0x1c00, the kernel version number string can be found at | 312 | |
309 | offset 0x1e00 in the kernel file. This is a valid value if and only | 313 | For example, if this value is set to 0x1c00, the kernel version |
310 | if the "setup_sects" field contains the value 14 or higher. | 314 | number string can be found at offset 0x1e00 in the kernel file. |
315 | This is a valid value if and only if the "setup_sects" field | ||
316 | contains the value 15 or higher, as: | ||
317 | |||
318 | 0x1c00 < 15*0x200 (= 0x1e00) but | ||
319 | 0x1c00 >= 14*0x200 (= 0x1c00) | ||
320 | |||
321 | 0x1c00 >> 9 = 14, so the minimum value for setup_secs is 15. | ||
311 | 322 | ||
312 | Field name: type_of_loader | 323 | Field name: type_of_loader |
313 | Type: write (obligatory) | 324 | Type: write (obligatory) |
@@ -377,7 +388,7 @@ Protocol: 2.00+ | |||
377 | 388 | ||
378 | This field can be modified for two purposes: | 389 | This field can be modified for two purposes: |
379 | 390 | ||
380 | 1. as a boot loader hook (see separate chapter.) | 391 | 1. as a boot loader hook (see ADVANCED BOOT LOADER HOOKS below.) |
381 | 392 | ||
382 | 2. if a bootloader which does not install a hook loads a | 393 | 2. if a bootloader which does not install a hook loads a |
383 | relocatable kernel at a nonstandard address it will have to modify | 394 | relocatable kernel at a nonstandard address it will have to modify |
@@ -715,7 +726,7 @@ switched off, especially if the loaded kernel has the floppy driver as | |||
715 | a demand-loaded module! | 726 | a demand-loaded module! |
716 | 727 | ||
717 | 728 | ||
718 | **** ADVANCED BOOT TIME HOOKS | 729 | **** ADVANCED BOOT LOADER HOOKS |
719 | 730 | ||
720 | If the boot loader runs in a particularly hostile environment (such as | 731 | If the boot loader runs in a particularly hostile environment (such as |
721 | LOADLIN, which runs under DOS) it may be impossible to follow the | 732 | LOADLIN, which runs under DOS) it may be impossible to follow the |
@@ -740,4 +751,5 @@ IMPORTANT: All the hooks are required to preserve %esp, %ebp, %esi and | |||
740 | set them up to BOOT_DS (0x18) yourself. | 751 | set them up to BOOT_DS (0x18) yourself. |
741 | 752 | ||
742 | After completing your hook, you should jump to the address | 753 | After completing your hook, you should jump to the address |
743 | that was in this field before your boot loader overwrote it. | 754 | that was in this field before your boot loader overwrote it |
755 | (relocated, if appropriate.) | ||