miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
Loading...
Searching...
No Matches
enter_ring3.h File Reference
#include <miniOS/types.h>
Include dependency graph for enter_ring3.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void enter_ring3 (uint64_t entry_rip, uint64_t user_rsp)
 Builds an IRETQ stack frame (SS, RSP, RFLAGS=0x202, CS=user_cs, RIP) and executes IRETQ, transferring control to @entry_rip at CPL=3. Enables interrupts (RFLAGS.IF=1) as part of the frame. Does not return — execution continues in ring 3 at @entry_rip.
int copy_string_array_to_user (struct thread *t, char *const *arr, uint64_t *user_ptr)
 Copies each string to the user stack, builds a pointer array below the strings, and writes the address of that array to *@user_ptr. Used by SYS_execve to pass argv/envp to the new process image.