Expand description
User-mode entry point for x86_64
Provides enter_usermode() which pushes the iretq frame and transitions
the CPU from Ring 0 to Ring 3. Also provides map_user_page() for
creating user-accessible page table entries through the bootloader’s
physical memory mapping.
enter_usermode_returnable() is a variant that saves the boot context
(callee-saved registers, RSP, CR3) so that sys_exit can restore it
and effectively “return” to the caller, allowing sequential user-mode
program execution during bootstrap.
Structs§
- Fork
Child Regs - All GPRs needed to resume a forked child in user mode.
Functions§
- boot_
return_ ⚠to_ kernel - Restore the boot context saved by
enter_usermode_returnableand return to the bootstrap code. - enter_
forked_ ⚠child_ returnable - Enter user mode for a forked child, restoring ALL GPRs from
regs. - enter_
usermode ⚠ - Enter user mode for the first time via iretq.
- enter_
usermode_ ⚠returnable - Enter user mode with the ability to return when the process exits.
- has_
boot_ return_ context - Check whether a boot return context is available.
- try_
enter_ usermode - Attempt to enter user mode with the embedded init binary.