Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56926
b: refs/heads/master
c: db2668f
h: refs/heads/master
v: v3
  • Loading branch information
H. Peter Anvin authored and Linus Torvalds committed May 24, 2007
1 parent 74ce242 commit ae0500a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: af669c97291c458c97a869bf3c36eb870e7430c1
refs/heads/master: db2668fdbeb2e3c95ebadf95856c9e31a8a8d569
32 changes: 22 additions & 10 deletions trunk/Documentation/i386/boot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
----------------------------

H. Peter Anvin <hpa@zytor.com>
Last update 2007-05-16
Last update 2007-05-23

On the i386 platform, the Linux kernel uses a rather complicated boot
convention. This has evolved partially due to historical aspects, as
Expand Down Expand Up @@ -202,6 +202,8 @@ All general purpose boot loaders should write the fields marked
nonstandard address should fill in the fields marked (reloc); other
boot loaders can ignore those fields.

The byte order of all fields is littleendian (this is x86, after all.)

Field name: setup_secs
Type: read
Offset/size: 0x1f1/1
Expand Down Expand Up @@ -280,14 +282,16 @@ Type: read
Offset/size: 0x206/2
Protocol: 2.00+

Contains the boot protocol version, e.g. 0x0204 for version 2.04.
Contains the boot protocol version, in (major << 8)+minor format,
e.g. 0x0204 for version 2.04, and 0x0a11 for a hypothetical version
10.17.

Field name: readmode_swtch
Type: modify (optional)
Offset/size: 0x208/4
Protocol: 2.00+

Boot loader hook (see separate chapter.)
Boot loader hook (see ADVANCED BOOT LOADER HOOKS below.)

Field name: start_sys
Type: read
Expand All @@ -304,10 +308,17 @@ Protocol: 2.00+
If set to a nonzero value, contains a pointer to a NUL-terminated
human-readable kernel version number string, less 0x200. This can
be used to display the kernel version to the user. This value
should be less than (0x200*setup_sects). For example, if this value
is set to 0x1c00, the kernel version number string can be found at
offset 0x1e00 in the kernel file. This is a valid value if and only
if the "setup_sects" field contains the value 14 or higher.
should be less than (0x200*setup_sects).

For example, if this value is set to 0x1c00, the kernel version
number string can be found at offset 0x1e00 in the kernel file.
This is a valid value if and only if the "setup_sects" field
contains the value 15 or higher, as:

0x1c00 < 15*0x200 (= 0x1e00) but
0x1c00 >= 14*0x200 (= 0x1c00)

0x1c00 >> 9 = 14, so the minimum value for setup_secs is 15.

Field name: type_of_loader
Type: write (obligatory)
Expand Down Expand Up @@ -377,7 +388,7 @@ Protocol: 2.00+

This field can be modified for two purposes:

1. as a boot loader hook (see separate chapter.)
1. as a boot loader hook (see ADVANCED BOOT LOADER HOOKS below.)

2. if a bootloader which does not install a hook loads a
relocatable kernel at a nonstandard address it will have to modify
Expand Down Expand Up @@ -715,7 +726,7 @@ switched off, especially if the loaded kernel has the floppy driver as
a demand-loaded module!


**** ADVANCED BOOT TIME HOOKS
**** ADVANCED BOOT LOADER HOOKS

If the boot loader runs in a particularly hostile environment (such as
LOADLIN, which runs under DOS) it may be impossible to follow the
Expand All @@ -740,4 +751,5 @@ IMPORTANT: All the hooks are required to preserve %esp, %ebp, %esi and
set them up to BOOT_DS (0x18) yourself.

After completing your hook, you should jump to the address
that was in this field before your boot loader overwrote it.
that was in this field before your boot loader overwrote it
(relocated, if appropriate.)

0 comments on commit ae0500a

Please sign in to comment.