Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

H. Peter Anvin and committed by
Linus Torvalds
db2668fd af669c97

+22 -10
+22 -10
Documentation/i386/boot.txt
··· 2 2 ---------------------------- 3 3 4 4 H. Peter Anvin <hpa@zytor.com> 5 - Last update 2007-05-16 5 + Last update 2007-05-23 6 6 7 7 On the i386 platform, the Linux kernel uses a rather complicated boot 8 8 convention. This has evolved partially due to historical aspects, as ··· 202 202 nonstandard address should fill in the fields marked (reloc); other 203 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 207 Field name: setup_secs 206 208 Type: read 207 209 Offset/size: 0x1f1/1 ··· 282 280 Offset/size: 0x206/2 283 281 Protocol: 2.00+ 284 282 285 - Contains the boot protocol version, e.g. 0x0204 for version 2.04. 283 + Contains the boot protocol version, in (major << 8)+minor format, 284 + e.g. 0x0204 for version 2.04, and 0x0a11 for a hypothetical version 285 + 10.17. 286 286 287 287 Field name: readmode_swtch 288 288 Type: modify (optional) 289 289 Offset/size: 0x208/4 290 290 Protocol: 2.00+ 291 291 292 - Boot loader hook (see separate chapter.) 292 + Boot loader hook (see ADVANCED BOOT LOADER HOOKS below.) 293 293 294 294 Field name: start_sys 295 295 Type: read ··· 308 304 If set to a nonzero value, contains a pointer to a NUL-terminated 309 305 human-readable kernel version number string, less 0x200. This can 310 306 be used to display the kernel version to the user. This value 311 - should be less than (0x200*setup_sects). For example, if this value 312 - is set to 0x1c00, the kernel version number string can be found at 313 - offset 0x1e00 in the kernel file. This is a valid value if and only 314 - if the "setup_sects" field contains the value 14 or higher. 307 + should be less than (0x200*setup_sects). 308 + 309 + For example, if this value is set to 0x1c00, the kernel version 310 + number string can be found at offset 0x1e00 in the kernel file. 311 + This is a valid value if and only if the "setup_sects" field 312 + contains the value 15 or higher, as: 313 + 314 + 0x1c00 < 15*0x200 (= 0x1e00) but 315 + 0x1c00 >= 14*0x200 (= 0x1c00) 316 + 317 + 0x1c00 >> 9 = 14, so the minimum value for setup_secs is 15. 315 318 316 319 Field name: type_of_loader 317 320 Type: write (obligatory) ··· 388 377 389 378 This field can be modified for two purposes: 390 379 391 - 1. as a boot loader hook (see separate chapter.) 380 + 1. as a boot loader hook (see ADVANCED BOOT LOADER HOOKS below.) 392 381 393 382 2. if a bootloader which does not install a hook loads a 394 383 relocatable kernel at a nonstandard address it will have to modify ··· 726 715 a demand-loaded module! 727 716 728 717 729 - **** ADVANCED BOOT TIME HOOKS 718 + **** ADVANCED BOOT LOADER HOOKS 730 719 731 720 If the boot loader runs in a particularly hostile environment (such as 732 721 LOADLIN, which runs under DOS) it may be impossible to follow the ··· 751 740 set them up to BOOT_DS (0x18) yourself. 752 741 753 742 After completing your hook, you should jump to the address 754 - that was in this field before your boot loader overwrote it. 743 + that was in this field before your boot loader overwrote it 744 + (relocated, if appropriate.)