File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,10 @@ pub struct BootloaderConfig {
20
20
/// The size of the stack that the bootloader should allocate for the kernel (in bytes).
21
21
///
22
22
/// The bootloader starts the kernel with a valid stack pointer. This setting defines
23
- /// the stack size that the bootloader should allocate and map. The stack is created
24
- /// with a guard page, so a stack overflow will lead to a page fault.
23
+ /// the stack size that the bootloader should allocate and map.
24
+ ///
25
+ /// The stack is created with a additional guard page, so a stack overflow will lead to
26
+ /// a page fault.
25
27
pub kernel_stack_size : u64 ,
26
28
27
29
/// Configuration for the frame buffer that can be used by the kernel to display pixels
@@ -413,6 +415,14 @@ impl Default for ApiVersion {
413
415
#[ non_exhaustive]
414
416
pub struct Mappings {
415
417
/// Configures how the kernel stack should be mapped.
418
+ ///
419
+ /// If a fixed address is set, it must be page aligned.
420
+ ///
421
+ /// Note that the first page of the kernel stack is intentionally left unmapped
422
+ /// to act as a guard page. This ensures that a page fault occurs on a stack
423
+ /// overflow. For example, setting the kernel stack address to
424
+ /// `FixedAddress(0xf_0000_0000)` will result in a guard page at address
425
+ /// `0xf_0000_0000` and the kernel stack starting at address `0xf_0000_1000`.
416
426
pub kernel_stack : Mapping ,
417
427
/// Specifies where the [`crate::BootInfo`] struct should be placed in virtual memory.
418
428
pub boot_info : Mapping ,
You can’t perform that action at this time.
0 commit comments