kaslr: Update documentation

This commit is contained in:
mintsuki 2020-12-27 23:51:27 +01:00
parent 8bb0db92d0
commit 4bebeba64b
3 changed files with 15 additions and 11 deletions

View File

@ -84,6 +84,7 @@ Some keys take *URIs* as values; these are described in the next section.
modules.
The entries will be matched in order. E.g.: the 1st module path entry will be matched
to the 1st module string entry that appear, and so on.
* `KASLR` - If set to `yes`, it enables Kernel Address Layout Randomisation for 64-bit relocatable kernels.
* `RESOLUTION` - The resolution to be used should the kernel request a graphical framebuffer. This setting takes the form of `<width>x<height>x<bpp>` and *overrides* any resolution requested by the kernel, or automatic resolution requests. If the resolution is not available, Limine will pick another one automatically.
* Chainload protocol:
* `DRIVE` - The 1-based BIOS drive to chainload.

View File

@ -43,9 +43,8 @@ At entry, the bootloader will have setup paging mappings as such:
0x0000000000000000 - 0x80000000 -> 0xffffffff80000000
```
If the kernel is dynamic and not statically linked, the bootloader will relocate it.
Furthermore if bit 2 of the flags field in the stivale header is set, the bootloader
will perform kernel address space layout randomisation (KASLR).
If the kernel is dynamic and not statically linked, the bootloader will relocate it,
potentially performing KASLR (as specified by the config).
The kernel should NOT modify the bootloader page tables, and it should only use them
to bootstrap its own virtual memory manager and its own page tables.
@ -145,10 +144,12 @@ struct stivale_header {
uint16_t flags; // Flags
// bit 0 0 = text mode, 1 = graphics framebuffer mode
// bit 1 0 = 4-level paging, 1 = use 5-level paging (if
available)
Ignored if booting a 32-bit kernel.
// bit 2 0 = Disable KASLR, 1 = enable KASLR (up to 1GB slide)
Ignored if booting a 32-bit or non-relocatable kernel
// available)
// Ignored if booting a 32-bit kernel.
// bit 2 Formerly used to indicate whether to enable KASLR,
// this flag is now reserved as KASLR is enabled in the
// bootloader configuration instead. Presently
// reserved and unused.
// All other bits undefined.
uint16_t framebuffer_width; // These 3 values are parsed if a graphics mode

View File

@ -43,9 +43,8 @@ At entry, the bootloader will have setup paging mappings as such:
0x0000000000000000 - 0x80000000 -> 0xffffffff80000000
```
If the kernel is dynamic and not statically linked, the bootloader will relocate it.
Furthermore if bit 0 of the flags field in the stivale2 header is set, the bootloader
will perform kernel address space layout randomisation (KASLR).
If the kernel is dynamic and not statically linked, the bootloader will relocate it,
potentially performing KASLR (as specified by the config).
The kernel should NOT modify the bootloader page tables, and it should only use them
to bootstrap its own virtual memory manager and its own page tables.
@ -147,7 +146,10 @@ struct stivale2_header {
// 64-bit and 32-bit valid stacks must be at least 256 bytes
// in usable space and must be 16 byte aligned addresses.
uint64_t flags; // Bit 0: if 1, enable KASLR
uint64_t flags; // Bit 0: Formerly used to indicate whether to enable
// KASLR, this flag is now reserved as KASLR
// is enabled in the bootloader configuration
// instead. Presently reserved and unused.
// All other bits undefined
uint64_t tags; // Pointer to the first of the linked list of tags.