Jump to user mode.
This instantly creates a page fault as we always map pages with ring 0 permissions.
This commit is contained in:
parent
aefb4f082b
commit
7184f527a0
7 changed files with 37 additions and 7 deletions
|
|
@ -56,7 +56,7 @@ void badmemcpy(uint64_t base, uint64_t offset, uint64_t dest) {
|
|||
|
||||
} // namespace
|
||||
|
||||
void LoadElfProgram(uint64_t base, uint64_t offset) {
|
||||
uint64_t LoadElfProgram(uint64_t base, uint64_t offset) {
|
||||
Elf64Header* header = reinterpret_cast<Elf64Header*>(base);
|
||||
dbgln("phoff: %u phnum: %u", header->phoff, header->phnum);
|
||||
Elf64ProgramHeader* programs =
|
||||
|
|
@ -71,4 +71,5 @@ void LoadElfProgram(uint64_t base, uint64_t offset) {
|
|||
EnsureResident(program.vaddr, program.memsz);
|
||||
badmemcpy(base + program.offset, program.filesz, program.vaddr);
|
||||
}
|
||||
return header->entry;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue