aboutsummaryrefslogtreecommitdiff
path: root/kernel/features
diff options
context:
space:
mode:
authorMarvin Borner2020-09-03 18:47:38 +0200
committerMarvin Borner2020-09-03 18:47:38 +0200
commit15a8cb8fa64b12d6c0b65eafb226971cd66dc3cd (patch)
tree10669f647c05299601497c277b2d4d4e89c4c9af /kernel/features
parentd79b7492910d4a77b8c3a70f28c5ea4c81a0b2e5 (diff)
Moved test to app
Diffstat (limited to 'kernel/features')
-rw-r--r--kernel/features/load.c5
-rw-r--r--kernel/features/syscall.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/kernel/features/load.c b/kernel/features/load.c
index d5dd839..2cbe2e7 100644
--- a/kernel/features/load.c
+++ b/kernel/features/load.c
@@ -12,8 +12,6 @@
int bin_load(char *path, struct proc *proc)
{
char *data = read_file(path);
- if (!data)
- return 1;
u32 stack = (u32)malloc(0x2000) + 0x1000;
@@ -21,7 +19,8 @@ int bin_load(char *path, struct proc *proc)
proc->regs.useresp = (u32)stack;
proc->regs.eip = (u32)data;
strcpy(proc->name, path + 1);
- return 0;
+
+ return data ? 0 : 1;
}
int elf_verify(struct elf_header *h)
diff --git a/kernel/features/syscall.c b/kernel/features/syscall.c
index 5915d9d..25770a4 100644
--- a/kernel/features/syscall.c
+++ b/kernel/features/syscall.c
@@ -18,7 +18,7 @@ void syscall_handler(struct regs *r)
r->eax = 0;
if (num != SYS_RECEIVE && num != SYS_YIELD && num != SYS_TIME)
- printf("[SYSCALL] %d: ", num);
+ printf("[SYSCALL] %d from %s: ", num, proc_current()->name);
switch (num) {
case SYS_LOOP: {