Fix init ressource mapping

This commit is contained in:
Mathieu Maret 2024-02-11 23:41:34 +01:00 committed by Mathieu Maret
parent a78aa420fd
commit cb5e408525
1 changed files with 5 additions and 5 deletions

View File

@ -138,17 +138,17 @@ uaddr_t loadElfProg(const char *prog, struct process *proc)
unrefPhyPage(ppage);
}
// Hack: Even if already allocated mark the adresse space as managed by a ressource
// So this address space is not used by another ressource.
uaddr = elf_phdrs[i].p_vaddr;
zeroMmap(as, &uaddr, elf_phdrs[i].p_memsz, PAGING_MEM_USER | PAGING_MEM_WRITE | PAGING_MEM_READ, 0);
/* Copy segment into memory */
memcpy((void *)elf_phdrs[i].p_vaddr, (void *)(prog + elf_phdrs[i].p_offset),
elf_phdrs[i].p_filesz);
if (lastUserAddr < uaddr) {
lastUserAddr = uaddr;
}
// Hack: Even if already allocated mark the adresse space as managed by a ressource
// So this address space is not used by another ressource.
uaddr = elf_phdrs[i].p_vaddr;
zeroMmap(as, &uaddr, elf_phdrs[i].p_memsz, PAGING_MEM_USER | PAGING_MEM_WRITE | PAGING_MEM_READ, 0);
}
processInitHeap(proc, lastUserAddr);