We set the stack_top to the start address of the stack_end page here:
|
stack_top: mappings.stack_end.start_address(), |
However, it looks like stack_end is an inclusive bound:
|
let stack_end = { |
|
let end_addr = stack_start_addr + config.kernel_stack_size; |
|
Page::containing_address(end_addr - 1u64) |
|
}; |
So I think the stack pointer should be initialized with (stack_end + 1).start_address() instead.
Reported by klim on the Discord of Theseus OS.