From 1ecb3fb821f49450ba4b08ad7d7a23d3acb75c47 Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Fri, 18 May 2012 13:42:09 +0200 Subject: Improvements. Next: initrd. --- src/kernel/linker/elf.cpp | 2 +- src/kernel/linker/elf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/kernel/linker') diff --git a/src/kernel/linker/elf.cpp b/src/kernel/linker/elf.cpp index c6aebaa..0375e40 100644 --- a/src/kernel/linker/elf.cpp +++ b/src/kernel/linker/elf.cpp @@ -7,7 +7,7 @@ int elf_check(uint8_t *data) { elf_ehdr *h = (elf_ehdr*)data; if (h->e_ident[0] == 0x7F && h->e_ident[1] == 'E' && h->e_ident[2] == 'L' && h->e_ident[3] == 'F') return 0; - return 1; + return -1; } thread_entry elf_load(uint8_t *data, process* process) { diff --git a/src/kernel/linker/elf.h b/src/kernel/linker/elf.h index bb61795..184f410 100644 --- a/src/kernel/linker/elf.h +++ b/src/kernel/linker/elf.h @@ -56,7 +56,7 @@ struct phdr { uint8_t* data; }; -int elf_check(uint8_t *data); //0 if ok, 1 if not a valid ELF +int elf_check(uint8_t *data); //0 if ok, -1 if not a valid ELF thread_entry elf_load(uint8_t *data, process* process); //Load an ELF to a process, return entry point process* elf_exec(uint8_t *data, int privilege); //Creates a new process and a thread for running ELF file -- cgit v1.2.3