From a9c7529dcca845d98192ece62be70f752972216b Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 13 May 2020 21:28:56 +0200 Subject: Replaced alloc.h with liballoc And many more adaptions to the lib --- src/kernel/fs/elf.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/kernel/fs/elf.c') diff --git a/src/kernel/fs/elf.c b/src/kernel/fs/elf.c index c89fd2e..a67ab6a 100644 --- a/src/kernel/fs/elf.c +++ b/src/kernel/fs/elf.c @@ -46,23 +46,23 @@ struct process *elf_load(char *path) proc->registers.eip = header->entry; paging_switch_directory(proc->cr3); - u32 stk = (u32)kmalloc_a(PAGE_S); - proc->registers.useresp = 0x40000000 - (PAGE_S / 2); + u32 stk = (u32)malloc(PAGE_SIZE); + proc->registers.useresp = 0x40000000 - (PAGE_SIZE / 2); proc->registers.ebp = proc->registers.useresp; proc->registers.esp = proc->registers.useresp; - paging_map_user(proc->cr3, stk, 0x40000000 - PAGE_S); + paging_map(stk, 0x40000000 - PAGE_SIZE, PT_USER); for (int i = 0; i < header->phnum; i++, program_header++) { switch (program_header->type) { case 0: break; case 1: { - u32 loc = (u32)kmalloc_a(PAGE_S); - paging_map_user(proc->cr3, loc, program_header->vaddr); + u32 loc = (u32)malloc(PAGE_SIZE); + paging_map(loc, program_header->vaddr, PT_USER); memcpy((void *)program_header->vaddr, ((void *)((u32)file) + program_header->offset), program_header->filesz); - if (program_header->filesz > PAGE_S) + if (program_header->filesz > PAGE_SIZE) panic("ELF binary section too large"); break; } @@ -71,6 +71,6 @@ struct process *elf_load(char *path) } } - paging_switch_directory(paging_root_directory); + paging_switch_directory(paging_kernel_directory); return proc; } \ No newline at end of file -- cgit v1.2.3