pub fn init_memory_management(
    boot_info: impl BootInformation,
    kernel_stack_start: VirtualAddress
) -> Result<(MmiRef, NoDrop<MappedPages>, NoDrop<MappedPages>, NoDrop<MappedPages>, NoDrop<Stack>, Vec<BootloaderModule>, NoDrop<EarlyIdentityMappedPages>), &'static str>
Expand description

Initializes the virtual memory management system and returns a MemoryManagementInfo instance, which represents the initial (kernel) address space.

This consumes the given BootInformation, because after the memory system is initialized, the original BootInformation will be unmapped and inaccessible.

Returns the following tuple, if successful:

  1. The kernel’s new MemoryManagementInfo,
  2. the MappedPages of the kernel’s text section,
  3. the MappedPages of the kernel’s rodata section,
  4. the MappedPages of the kernel’s data section,
  5. the initial stack for this CPU (e.g., the BSP stack) that is currently in use,
  6. the list of bootloader modules obtained from the given boot_info,
  7. the kernel’s list of identity-mapped [MappedPages], which must not be dropped until all AP (additional CPUs) are fully booted, but should be dropped before starting the first application.