diff options
author | Alexis211 <alexis211@gmail.com> | 2010-08-10 20:39:57 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2010-08-10 20:39:57 +0200 |
commit | f81bf65484fa8c81a1886f456c71f1e6eebe84e9 (patch) | |
tree | 146f304d8de8828003edd548df22cca581044017 /src/kernel/core/kmain.c | |
parent | 0ec0ca40a4fedfe97c49903a329b2a9ad2e22d03 (diff) | |
download | TCE-f81bf65484fa8c81a1886f456c71f1e6eebe84e9.tar.gz TCE-f81bf65484fa8c81a1886f456c71f1e6eebe84e9.zip |
Added a lot of comments in kernel code. A bit of cleaning too.
Diffstat (limited to 'src/kernel/core/kmain.c')
-rw-r--r-- | src/kernel/core/kmain.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/kernel/core/kmain.c b/src/kernel/core/kmain.c index d8f059a..cfb9935 100644 --- a/src/kernel/core/kmain.c +++ b/src/kernel/core/kmain.c @@ -10,7 +10,16 @@ #include <mem/mem.h> #include <linker/elf.h> +/* The kernel's main procedure. This function is called in loader_.asm. + This function calls the initializer functions for all system parts. + It then loads the modules the kernel was given by the bootloader. + This function never returns : once multitasking is started for good, + the execution flow of this function is never returned to. */ void kmain(struct multiboot_info_t* mbd, int32_t magic) { + monitor_clear(); + + ASSERT(magic == MULTIBOOT_BOOTLOADER_MAGIC); + size_t totalRam = 0; uint32_t i; @@ -25,8 +34,6 @@ void kmain(struct multiboot_info_t* mbd, int32_t magic) { mem_placementAddr = (mods[i].mod_end & 0xFFFFF000) + 0x1000; } - monitor_clear(); - if (magic != MULTIBOOT_BOOTLOADER_MAGIC) { PANIC("wrong multiboot magic number."); } @@ -62,4 +69,5 @@ void kmain(struct multiboot_info_t* mbd, int32_t magic) { monitor_write("Modules now RULE THE WORLD !\n"); sti(); tasking_switch(); + PANIC("Should never happen. Something probably went wrong with multitasking."); } |