summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/kernel/main.c b/kernel/main.c
index 72a6668..52f832b 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -28,19 +28,26 @@ void load_init(void)
struct file *file;
const char *init_vector[] = { NULL };
- if (pcb_alloc(&init_pcb))
+ if (pcb_alloc(&init_pcb)) {
+ WARN("failed to alloc init pcb");
return;
+ }
// get root fs
fs = fs_get_root_file_system();
- if (fs == NULL)
+ if (fs == NULL) {
+ WARN("failed to get root fs");
return;
+ }
// get init bin
- if (fs->open(fs, "bin/init", O_RDONLY, &file))
+ if (fs->open(fs, "bin/init", O_RDONLY, &file)) {
+ WARN("cannot find init elf");
return;
+ }
if (user_load(init_pcb, file, init_vector, kernel_mem_ctx)) {
+ WARN("init elf failed to load! bad bad BAD!!");
file->close(file);
return;
}