Skip to main content

create_user_test_task

Function create_user_test_task 

Source
pub fn create_user_test_task()
Expand description

Create and schedule a minimal Ring 3 test task.

This function:

  1. Creates a user address space (PML4 with kernel half cloned)
  2. Maps a code page at USER_CODE_ADDR (RX, user-accessible)
  3. Maps a stack page at USER_STACK_ADDR (RW, user-accessible)
  4. Writes a small machine code blob into the code page
  5. Creates a kernel task whose entry point does IRETQ to Ring 3