diff options
author | Alexis211 <alexis211@gmail.com> | 2009-09-20 14:23:45 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-09-20 14:23:45 +0200 |
commit | 1eb942c8a34166e43f43c843f09bb48ba40b65b2 (patch) | |
tree | 7567ef81880722ae42fa92aec1bd0a7703ac2a15 /Source/Kernel/Core | |
parent | a43236e7017b6500e6563aa8654c8d8f56226615 (diff) | |
download | Melon-1eb942c8a34166e43f43c843f09bb48ba40b65b2.tar.gz Melon-1eb942c8a34166e43f43c843f09bb48ba40b65b2.zip |
We now have scrollable virtual terminals !
Diffstat (limited to 'Source/Kernel/Core')
-rw-r--r-- | Source/Kernel/Core/Sys.ns.cpp | 19 | ||||
-rw-r--r-- | Source/Kernel/Core/Sys.ns.h | 1 | ||||
-rw-r--r-- | Source/Kernel/Core/kmain.wtf.cpp | 15 |
3 files changed, 26 insertions, 9 deletions
diff --git a/Source/Kernel/Core/Sys.ns.cpp b/Source/Kernel/Core/Sys.ns.cpp index ab57589..081e7a5 100644 --- a/Source/Kernel/Core/Sys.ns.cpp +++ b/Source/Kernel/Core/Sys.ns.cpp @@ -1,9 +1,10 @@ //This automatically includes Sys.ns.h #include <Core/common.wtf.h> -#include <VTManager/VirtualTerminal.class.h> +#include <Core/Log.ns.h> +#include <VTManager/SimpleVT.class.h> #include <SyscallManager/IDT.ns.h> -#define DEBUGVT(x) VirtualTerminal *x = new VirtualTerminal(4, 56, 0, 15); x->map(); x->put('\n'); +#define DEBUGVT(x) SimpleVT *x = new SimpleVT(4, 56, 0, 15); x->map(); x->put('\n'); using namespace CMem; @@ -81,7 +82,7 @@ void panic(char *message, char *file, u32int line) { void panic(char *message, registers_t *regs, char *file, u32int line) { asm volatile("cli"); - VirtualTerminal vt(20, 70, 7, 1); + SimpleVT vt(20, 70, 7, 1); vt.map(); vt << "PANIC : " << message << "\n => in " << file << " at " << (s32int)line << "\n\n"; @@ -115,7 +116,19 @@ void panic_assert(char *file, u32int line, char *desc) { } void reboot() { + asm volatile("cli"); + Log::close(); outb(0x64, 0xFE); } +void halt() { + asm volatile("cli"); + Log::close(); + String message("MELON SEZ : KTHXBYE, IOU CAN NAOW TURNZ OFF UR COMPUTER."); + SimpleVT vt(3, message.size() + 16, 6, 0); + vt.map(); + vt << "\n\t" << message; + while (1) asm volatile("cli"); +} + } diff --git a/Source/Kernel/Core/Sys.ns.h b/Source/Kernel/Core/Sys.ns.h index a205892..6779585 100644 --- a/Source/Kernel/Core/Sys.ns.h +++ b/Source/Kernel/Core/Sys.ns.h @@ -31,6 +31,7 @@ namespace Sys { void bochs_output(String message, char *file, u32int line); void bochs_output_hex(u32int i); void reboot(); + void halt(); } #endif diff --git a/Source/Kernel/Core/kmain.wtf.cpp b/Source/Kernel/Core/kmain.wtf.cpp index e3ef2fd..4c576b6 100644 --- a/Source/Kernel/Core/kmain.wtf.cpp +++ b/Source/Kernel/Core/kmain.wtf.cpp @@ -11,7 +11,7 @@ #include <DeviceManager/Dev.ns.h> #include <DeviceManager/Kbd.ns.h> #include <DeviceManager/Time.ns.h> -#include <VTManager/VirtualTerminal.class.h> +#include <VTManager/ScrollableVT.class.h> #include <MemoryManager/PhysMem.ns.h> #include <MemoryManager/PageAlloc.ns.h> #include <MemoryManager/GDT.ns.h> @@ -27,8 +27,8 @@ #include <VFS/TextFile.class.h> #include <Core/Log.ns.h> -#include <Ressources/logo.cxd> -#include <Ressources/keymap-fr.wtf.cxd> +#include <Ressources/Graphics/logo.text.cxd> +#include <Ressources/Keymaps/fr.cxd> extern u32int end; //Placement address @@ -65,7 +65,7 @@ void kmain(multiboot_info_t* mbd, u32int magic) { Disp::setDisplay(vgaout); //Create a VT for handling the Melon bootup logo - VirtualTerminal *melonLogoVT = new VirtualTerminal(melonLogoLines, melonLogoCols, TXTLOGO_FGCOLOR, TXTLOGO_BGCOLOR); + SimpleVT *melonLogoVT = new SimpleVT(melonLogoLines, melonLogoCols, TXTLOGO_FGCOLOR, TXTLOGO_BGCOLOR); for (int i = 0; i < melonLogoLines; i++) { for (int j = 0; j < melonLogoCols; j++) { melonLogoVT->putChar(i, j, melonLogo[i][j]); @@ -74,7 +74,7 @@ void kmain(multiboot_info_t* mbd, u32int magic) { melonLogoVT->map(1); //Create a VT for logging what kernel does - VirtualTerminal *kvt = new VirtualTerminal(15, 76, KVT_FGCOLOR, KVT_BGCOLOR); + SimpleVT *kvt = new ScrollableVT(15, 76, 100, KVT_FGCOLOR, KVT_BGCOLOR); kvt->map(melonLogoLines + 2); INFO(kvt); *kvt << "Lower ram : " << (s32int)mbd->mem_lower << "k, upper : " << (s32int)mbd->mem_upper << "k.\n"; @@ -116,7 +116,7 @@ void kmain(multiboot_info_t* mbd, u32int magic) { Log::log(KL_STATUS, "kmain : Registered textual VGA output"); Dev::registerDevice(new PS2Keyboard()); //Initialize keyboard driver - Kbd::setKeymap(keymapFR_normal, keymapFR_shift, keymapFR_caps, keymapFR_altgr, keymapFR_shiftaltgr); //Load keymap + Kbd::setKeymap(keymap_normal, keymap_shift, keymap_caps, keymap_altgr, keymap_shiftaltgr); //Load keymap Kbd::setFocus(kvt); //Set focus to virtual terminal Log::log(KL_STATUS, "kmain : Keyboard set up"); @@ -135,6 +135,7 @@ void kmain(multiboot_info_t* mbd, u32int magic) { *kvt << " - Command list for integrated kernel shell:\n"; *kvt << " - help shows this help screen\n"; *kvt << " - reboot reboots your computer\n"; + *kvt << " - halt shuts down your computer\n"; *kvt << " - panic causes a kernel panic\n"; *kvt << " - devices shows all detected devices on your computer\n"; *kvt << " - free shows memory usage (physical frames and kernel heap)\n"; @@ -143,6 +144,8 @@ void kmain(multiboot_info_t* mbd, u32int magic) { *kvt << " - Commands you should know how to use : ls, cd, cat, pwd, rm, mkdir, wf\n"; } else if (tokens[0] == "reboot") { Sys::reboot(); + } else if (tokens[0] == "halt") { + Sys::halt(); } else if (tokens[0] == "panic") { PANIC("This is what happens when you say 'panic'."); } else if (tokens[0] == "ls") { |