Skip to main content

Module elf

Module elf 

Source
Expand description

ELF64 loader for Strat9-OS.

Parses ELF64 headers and loads PT_LOAD segments into a user address space, then creates a kernel task that trampolines into Ring 3 via IRETQ.

Supports :

  • ET_EXEC
  • ET_DYN (PIE/static-PIE)
  • ELF64 little-endian x86_64 binaries.

Structs§

LoadedElfInfo
Result of loading an ELF image into an address space.

Constants§

USER_ADDR_MAX
Maximum virtual address we accept for user-space mappings.
USER_STACK_BASE
User stack location (below the non-canonical gap).
USER_STACK_PAGES
Number of 4 KiB pages for the user stack (16 pages = 64 KiB).
USER_STACK_TOP
Top of the user stack (stack grows down).

Functions§

load_and_run_elf
Load an ELF64 binary and schedule it as a Ring 3 user task.
load_and_run_elf_with_caps
Performs the load and run elf with caps operation.
load_elf_image
Load an ELF binary into the provided address space. Returns the entry point address.
load_elf_task_with_caps
Performs the load elf task with caps operation.
read_user_mapped_bytes_pub
Reads user mapped bytes pub.
write_user_mapped_bytes_pub
Writes user mapped bytes pub.
write_user_u64_pub
Writes user u64 pub.