diff options
author | Marvin Borner | 2020-08-23 12:19:20 +0200 |
---|---|---|
committer | Marvin Borner | 2020-08-23 12:19:20 +0200 |
commit | b1faf9042c5104d7dafc7d880817def934086ddb (patch) | |
tree | 4abe87a6d83aaad17eebd291f2fe046e6a1324a6 /kernel/features | |
parent | b667ea0fbd26af222f828199e7b9a7e62ad98081 (diff) |
How did this work before?!
I used r->eax instead of r->ebx in malloc :O
Diffstat (limited to 'kernel/features')
-rw-r--r-- | kernel/features/fs.c | 4 | ||||
-rw-r--r-- | kernel/features/load.c | 2 | ||||
-rw-r--r-- | kernel/features/proc.c | 2 | ||||
-rw-r--r-- | kernel/features/syscall.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/kernel/features/fs.c b/kernel/features/fs.c index c328f04..f23ccc0 100644 --- a/kernel/features/fs.c +++ b/kernel/features/fs.c @@ -70,7 +70,7 @@ void *read_inode(struct inode *in) int indirect; - int blocknum = 0; + int blocknum; char *data; for (int i = 0; i < num_blocks; i++) { if (i < 12) { @@ -168,7 +168,7 @@ void ls_root() struct dirent *d = (struct dirent *)buf; int sum = 0; - int calc = 0; + int calc; printf("\nRoot directory:\n"); do { calc = (sizeof(struct dirent) + d->name_len + 4) & ~0x3; diff --git a/kernel/features/load.c b/kernel/features/load.c index 8aa28b8..d5dd839 100644 --- a/kernel/features/load.c +++ b/kernel/features/load.c @@ -52,7 +52,7 @@ void elf_load(char *path, struct proc *proc) if (phdr->type != PT_LOAD) continue; memcpy((void *)phdr->vaddr, h + phdr->offset, phdr->filesz); - memset((void *)(phdr->vaddr + phdr->filesz), phdr->memsz - phdr->filesz, 0); + memset((void *)(phdr->vaddr + phdr->filesz), 0, phdr->memsz - phdr->filesz); } u32 stack = (u32)malloc(0x1000) + 0x1000; diff --git a/kernel/features/proc.c b/kernel/features/proc.c index 1c0b443..ac62195 100644 --- a/kernel/features/proc.c +++ b/kernel/features/proc.c @@ -43,7 +43,7 @@ void scheduler(struct regs *regs) current = proc_list->head; while (!current) { - if (!current || !current->next || !current->next->data) { + if (!current->next || !current->next->data) { assert(proc_list->head); current = proc_list->head; } else { diff --git a/kernel/features/syscall.c b/kernel/features/syscall.c index 2a310ef..4197985 100644 --- a/kernel/features/syscall.c +++ b/kernel/features/syscall.c @@ -28,7 +28,7 @@ void syscall_handler(struct regs *r) } case SYS_MALLOC: { printf("malloc\n"); - r->eax = (u32)malloc(r->eax); + r->eax = (u32)malloc(r->ebx); break; } case SYS_FREE: { |