diff options
author | Marvin Borner | 2021-03-13 13:33:26 +0100 |
---|---|---|
committer | Marvin Borner | 2021-03-13 13:33:50 +0100 |
commit | 8176351e1a3d1598bedbc007897d530475942275 (patch) | |
tree | d7745b95abf8e7af9cee1fcfc387137f607c735f /kernel/features/load.c | |
parent | 606774e6b0e0a2d36139983b85c8675b2228a9ff (diff) |
Nicü
Diffstat (limited to 'kernel/features/load.c')
-rw-r--r-- | kernel/features/load.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/features/load.c b/kernel/features/load.c index 4ad2cbf..9e6db79 100644 --- a/kernel/features/load.c +++ b/kernel/features/load.c @@ -13,6 +13,8 @@ int bin_load(const char *path, struct proc *proc) struct stat s = { 0 }; vfs_stat(path, &s); + strcpy(proc->name, path); + struct page_dir *prev; memory_backup_dir(&prev); memory_switch_dir(proc->page_dir); @@ -20,13 +22,11 @@ int bin_load(const char *path, struct proc *proc) u32 size = PAGE_ALIGN_UP(s.size); u32 data = (u32)memory_alloc(proc->page_dir, size, MEMORY_USER | MEMORY_CLEAR); - if (!vfs_read(path, (void *)data, 0, s.size)) { + if (!vfs_read(proc->name, (void *)data, 0, s.size)) { memory_switch_dir(prev); return 1; } - strcpy(proc->name, path); - u32 stack = (u32)memory_alloc(proc->page_dir, PROC_STACK_SIZE, MEMORY_USER | MEMORY_CLEAR); proc->regs.ebp = stack; proc->regs.useresp = stack; |