Documentation/arch/x86/boot.rst

Source file repositories/reference/linux-study-clean/Documentation/arch/x86/boot.rst

File Facts

System
Linux kernel
Corpus path
Documentation/arch/x86/boot.rst
Extension
.rst
Size
51920 bytes
Lines
1465
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct setup_data {
	__u64 next;
	__u32 type;
	__u32 len;
	__u8 data[];
   }

  Where, the next is a 64-bit physical pointer to the next node of
  linked list, the next field of the last node is 0; the type is used
  to identify the contents of data; the len is the length of data
  field; the data holds the real payload.

  This list may be modified at a number of points during the bootup
  process.  Therefore, when modifying this list one should always make
  sure to consider the case where the linked list already contains
  entries.

  The setup_data is a bit awkward to use for extremely large data objects,
  both because the setup_data header has to be adjacent to the data object
  and because it has a 32-bit length field. However, it is important that
  intermediate stages of the boot process have a way to identify which
  chunks of memory are occupied by kernel data.

  Thus setup_indirect struct and SETUP_INDIRECT type were introduced in
  protocol 2.15::

   struct setup_indirect {
	__u32 type;
	__u32 reserved;		/* Reserved, must be set to zero. */
	__u64 len;
	__u64 addr;
   };

  The type member is a SETUP_INDIRECT | SETUP_* type. However, it cannot be
  SETUP_INDIRECT itself since making the setup_indirect a tree structure
  could require a lot of stack space in something that needs to parse it
  and stack space can be limited in boot contexts.

  Let's give an example how to point to SETUP_E820_EXT data using setup_indirect.
  In this case setup_data and setup_indirect will look like this::

   struct setup_data {
	.next = 0,	/* or <addr_of_next_setup_data_struct> */
	.type = SETUP_INDIRECT,
	.len = sizeof(setup_indirect),
	.data[sizeof(setup_indirect)] = (struct setup_indirect) {
		.type = SETUP_INDIRECT | SETUP_E820_EXT,
		.reserved = 0,
		.len = <len_of_SETUP_E820_EXT_data>,
		.addr = <addr_of_SETUP_E820_EXT_data>,
	},
   }

.. note::
     SETUP_INDIRECT | SETUP_NONE objects cannot be properly distinguished
     from SETUP_INDIRECT itself. So, this kind of objects cannot be provided
     by the bootloaders.

============	============
Field name:	pref_address
Type:		read (reloc)
Offset/size:	0x258/8
Protocol:	2.10+
============	============

  This field, if nonzero, represents a preferred load address for the
  kernel.  A relocating bootloader should attempt to load at this
  address if possible.

  A non-relocatable kernel will unconditionally move itself and to run

Annotation

Implementation Notes