summaryrefslogtreecommitdiff
path: root/Source/Kernel/Core
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-08-28 15:13:28 +0200
committerAlexis211 <alexis211@gmail.com>2009-08-28 15:13:28 +0200
commita2e5fb565df070825c71fb60e5e70b9a03879073 (patch)
tree3741d2e57a17f92da8d680115d17faf557749010 /Source/Kernel/Core
parent2582a11c37ccc22d64974b20b0793e5ba873fe1f (diff)
downloadMelon-a2e5fb565df070825c71fb60e5e70b9a03879073.tar.gz
Melon-a2e5fb565df070825c71fb60e5e70b9a03879073.zip
Some changes
Diffstat (limited to 'Source/Kernel/Core')
-rw-r--r--Source/Kernel/Core/.kmain.wtf.cpp.swpbin12288 -> 0 bytes
-rw-r--r--Source/Kernel/Core/kmain.wtf.cpp22
2 files changed, 14 insertions, 8 deletions
diff --git a/Source/Kernel/Core/.kmain.wtf.cpp.swp b/Source/Kernel/Core/.kmain.wtf.cpp.swp
deleted file mode 100644
index 27008ec..0000000
--- a/Source/Kernel/Core/.kmain.wtf.cpp.swp
+++ /dev/null
Binary files differ
diff --git a/Source/Kernel/Core/kmain.wtf.cpp b/Source/Kernel/Core/kmain.wtf.cpp
index 9e2004e..2ce331b 100644
--- a/Source/Kernel/Core/kmain.wtf.cpp
+++ b/Source/Kernel/Core/kmain.wtf.cpp
@@ -23,6 +23,14 @@ extern "C" void kmain(multiboot_info_t* mbd, u32int magic);
void kmain(multiboot_info_t* mbd, u32int magic) {
DEBUG("Entering kmain.");
+ if (magic != MULTIBOOT_BOOTLOADER_MAGIC) {
+ Mem::placementAddress = (u32int)&end; //Setup basic stuff so that PANIC will work
+ VGATextOutput *vgaout = new VGATextOutput();
+ Disp::setDisplay(vgaout);
+ PANIC("Error with multiboot header.");
+ }
+
+ //Setup placement address so that we can use new without overwriting modules
Mem::placementAddress = (u32int)&end;
mbd->cmdline += 0xC0000000; mbd->mods_addr += 0xC0000000; //Take stuff into acount
module_t *mods = (module_t*)mbd->mods_addr;
@@ -33,14 +41,11 @@ void kmain(multiboot_info_t* mbd, u32int magic) {
Mem::placementAddress = mods[i].mod_end + 0x1000;
}
+ //Create text output
VGATextOutput *vgaout = new VGATextOutput();
-
Disp::setDisplay(vgaout);
- if (magic != MULTIBOOT_BOOTLOADER_MAGIC) {
- PANIC("Error with multiboot header.");
- }
-
+ //Create a VT for handling the Melon bootup logo
VirtualTerminal *melonLogoVT = new VirtualTerminal(melonLogoLines, melonLogoCols, 7, 0);
for (int i = 0; i < melonLogoLines; i++) {
for (int j = 0; j < melonLogoCols; j++) {
@@ -49,13 +54,13 @@ void kmain(multiboot_info_t* mbd, u32int magic) {
}
melonLogoVT->map(2);
+ //Create a VT for logging what kernel does
VirtualTerminal *kvt = new VirtualTerminal(12, 40, 0, 2);
kvt->map(melonLogoLines + 4);
*kvt << "* Kernel initializing in HIGHER HALF!\n";
-
*kvt << "- Lower ram : " << (s32int)mbd->mem_lower << "k, upper : " << (s32int)mbd->mem_upper << "k.\n";
- *kvt << "- Kernel command line : " << (u32int)mbd->cmdline << "\n";
+ *kvt << "- Kernel command line @ " << (u32int)mbd->cmdline << "\n";
*kvt << "- Modules@" << (u32int)mbd->mods_addr << ", mbd@" << (u32int)mbd << "\n";
*kvt << "- Placement address : " << (u32int)Mem::placementAddress << "\n";
@@ -87,5 +92,6 @@ void kmain(multiboot_info_t* mbd, u32int magic) {
asm volatile("sti");
- //PANIC("END OF KMAIN");
+ while(1) asm volatile("sti; hlt");
+ PANIC("END OF KMAIN");
}