tasking: fix virtual mapping count in exec_from_file
This commit is contained in:
@@ -98,7 +98,7 @@ void exec_from_file(const char* filename)
|
||||
int pages_needed = (elf_phdr->p_memsz / 0x1000) + 1;
|
||||
printf("pages needed: %X\n", pages_needed);
|
||||
|
||||
for(int j = 0; j <= pages_needed; j++)
|
||||
for(int j = 0; j < pages_needed; j++)
|
||||
{
|
||||
uint32_t vaddr = (elf_phdr->p_vaddr & ~0xFFF) + j * 0x1000;
|
||||
void* phys_addr = alloc_page();
|
||||
@@ -114,8 +114,8 @@ void exec_from_file(const char* filename)
|
||||
|
||||
|
||||
|
||||
uint32_t file_start = elf_phdr->p_vaddr + elf_phdr->p_filesz;
|
||||
uint32_t file_end = elf_phdr->p_vaddr + pages_needed * 0x1000;
|
||||
uint32_t file_start = (elf_phdr->p_vaddr & ~0xFFF) + elf_phdr->p_filesz;
|
||||
uint32_t file_end = (elf_phdr->p_vaddr & ~0xFFF) + pages_needed * 0x1000;
|
||||
memset((void*)file_start, 0, file_end - file_start);
|
||||
|
||||
printf("p_filesz: 0x%X (%X)\n", elf_phdr->p_filesz, elf_phdr->p_filesz);
|
||||
@@ -124,7 +124,9 @@ void exec_from_file(const char* filename)
|
||||
|
||||
printf("================================\n\n\n\n");
|
||||
}
|
||||
Process* p_task1 = task_create(elf_ehdr->e_entry, NULL, 0, 3, proc_pd);
|
||||
|
||||
set_page_dir(curr_pd_phys);
|
||||
Process* p_task1 = task_create(elf_ehdr->e_entry, NULL, 0, 3, proc_pd);
|
||||
|
||||
asm volatile("sti");
|
||||
}
|
||||
Reference in New Issue
Block a user