summaryrefslogtreecommitdiff
path: root/src/kernel/linker
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-18 13:42:09 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-18 13:42:09 +0200
commit1ecb3fb821f49450ba4b08ad7d7a23d3acb75c47 (patch)
treecd7f14d2659809286e59c929e91fe5c02c138002 /src/kernel/linker
parentf56aa2f7e4b8e6430e123f714507032a33955a09 (diff)
downloadTCE-1ecb3fb821f49450ba4b08ad7d7a23d3acb75c47.tar.gz
TCE-1ecb3fb821f49450ba4b08ad7d7a23d3acb75c47.zip
Improvements. Next: initrd.
Diffstat (limited to 'src/kernel/linker')
-rw-r--r--src/kernel/linker/elf.cpp2
-rw-r--r--src/kernel/linker/elf.h2
2 files changed, 2 insertions, 2 deletions
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