Spawn Processes using memory primitives rather than and elf loader.

This allows us to remove the temporary syscall for that style of process
spawn.
This commit is contained in:
Drew Galbraith 2023-06-07 00:04:53 -07:00
parent b06c76e477
commit 23895b5c6c
26 changed files with 403 additions and 94 deletions

View file

@ -62,7 +62,7 @@ uint64_t LoadElfProgram(Process& dest_proc, uint64_t base, uint64_t offset) {
program.paddr, program.filesz, program.memsz, program.align);
auto mem_obj = MakeRefCounted<MemoryObject>(program.filesz);
mem_obj->CopyBytesToObject(base + program.offset, program.filesz);
dest_proc.vmm().MapInMemoryObject(program.vaddr, mem_obj);
dest_proc.vmas()->MapInMemoryObject(program.vaddr, mem_obj);
}
return header->entry;
}

View file

@ -58,7 +58,7 @@ void LoadInitProgram() {
CopyIntoNonResidentProcess(reinterpret_cast<uint64_t>(prog2.address),
prog2.size, *proc,
proc->vmm().GetNextMemMapAddr(prog2.size));
proc->vmas()->GetNextMemMapAddr(prog2.size));
proc->CreateThread()->Start(entry, 0, 0);
}