summaryrefslogtreecommitdiff
path: root/src/kernel/core
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-01 14:55:18 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-01 14:55:18 +0200
commite8cf65c07d78e3cfbac953b1b97c51998a5900df (patch)
tree7b75741a1d38b5da1ee79e877709b6b4723c4713 /src/kernel/core
parent5cac9acd3aedc8043d4272d93c56805c46ff6214 (diff)
downloadTCE-e8cf65c07d78e3cfbac953b1b97c51998a5900df.tar.gz
TCE-e8cf65c07d78e3cfbac953b1b97c51998a5900df.zip
Now using Doug Lea's malloc in kernel land. Next: same in userland.
Diffstat (limited to 'src/kernel/core')
-rw-r--r--src/kernel/core/kmain.c14
-rw-r--r--src/kernel/core/sys.c6
2 files changed, 11 insertions, 9 deletions
diff --git a/src/kernel/core/kmain.c b/src/kernel/core/kmain.c
index 86db4ff..17c9425 100644
--- a/src/kernel/core/kmain.c
+++ b/src/kernel/core/kmain.c
@@ -19,8 +19,6 @@
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;
@@ -37,6 +35,8 @@ void kmain(struct multiboot_info_t* mbd, int32_t magic) {
mem_placementAddr = (mods[i].mod_end & 0xFFFFF000) + 0x1000;
}
+ monitor_clear();
+
monitor_write(K_OS_NAME);
monitor_write(" version ");
monitor_write(K_OS_VER);
@@ -44,20 +44,22 @@ void kmain(struct multiboot_info_t* mbd, int32_t magic) {
monitor_write(K_OS_CODENAME);
monitor_write("' starting up :\n");
+
idt_init();
totalRam = ((mbd->mem_upper + mbd->mem_lower) * 1024);
paging_init(totalRam);
+ _no_more_ksbrk = 1;
gdt_init();
paging_cleanup();
- kheap_init();
+ //kheap_init();
timer_init(30);
tasking_init();
- test_run();
+ //test_run();
- monitor_write("\nLoading modules :\n");
+ monitor_write("\n\nLoading modules :\n");
for (i = 0; i < mbd->mods_count; i++) {
monitor_write(" * ");
monitor_write((char*)mods[i].string);
@@ -73,7 +75,7 @@ void kmain(struct multiboot_info_t* mbd, int32_t magic) {
}
}
- monitor_write("Modules now RULE THE WORLD !\n");
+ monitor_write("Modules now RULE THE WORLD !\n\n");
sti();
tasking_switch();
PANIC("Should never happen. Something probably went wrong with multitasking.");
diff --git a/src/kernel/core/sys.c b/src/kernel/core/sys.c
index 4c53d58..4a88838 100644
--- a/src/kernel/core/sys.c
+++ b/src/kernel/core/sys.c
@@ -42,18 +42,18 @@ static void panic_do(char* file, int line) {
monitor_write("\n File:\t\t"); monitor_write(file); monitor_put(':'); monitor_writeDec(line);
monitor_write("\nTrace:\n");
size_t bp; asm volatile("mov %%ebp,%0" : "=r"(bp)); stack_trace(bp);
- monitor_write("\n\t\tSystem halted -_-'\n");
+ monitor_write("\n\t\tSystem halted -_-'");
asm volatile("cli; hlt");
}
/* These functions stop the system, reporting an error message, because something bad happenned. */
void panic(char* message, char* file, int line) {
- monitor_write("\n\nPANIC:\t\t"); monitor_write(message);
+ monitor_write("\nPANIC:\t\t"); monitor_write(message);
panic_do(file, line);
}
void panic_assert(char* assertion, char* file, int line) {
- monitor_write("\n\nASSERT FAILED:\t"); monitor_write(assertion);
+ monitor_write("\nASSERT FAILED:\t"); monitor_write(assertion);
panic_do(file, line);
}