diff options
-rw-r--r-- | Grub-menu.cfg | 8 | ||||
-rw-r--r-- | README | 11 | ||||
-rw-r--r-- | Source/Applications/Demos/GOL.cpp | 2 | ||||
-rw-r--r-- | Source/Kernel/Config.h | 17 | ||||
-rw-r--r-- | Source/Kernel/Core/Sys.ns.cpp | 24 | ||||
-rw-r--r-- | Source/Kernel/Core/Sys.ns.h | 1 | ||||
-rw-r--r-- | Source/Kernel/TaskManager/Thread.class.cpp | 2 |
7 files changed, 47 insertions, 18 deletions
diff --git a/Grub-menu.cfg b/Grub-menu.cfg index 450212a..870179a 100644 --- a/Grub-menu.cfg +++ b/Grub-menu.cfg @@ -3,19 +3,19 @@ default 2 title The Melon Operating System root (fd0) kernel /Melon.ke -module /Init.rfs initrd / 128K +module /Init.rfs title Melon without VESA root (fd0) kernel /Melon.ke vesa:disabled -module /Init.rfs initrd / 128K +module /Init.rfs title Melon without init root (fd0) kernel /Melon.ke init: -module /Init.rfs initrd / 128K +module /Init.rfs title Game of life simulator root (fd0) kernel /Melon.ke init:/Applications/Demos/GOL.app -module /Init.rfs initrd / 128K +module /Init.rfs @@ -21,3 +21,14 @@ You will probably be prompted for your password. We need it to mount the floppy And run it with Qemu : $ make qemu + +** HOW TO CONFIGURE THE GRUB ENTRIES : ** +If you want to change the entries that appear when you `make qemu`, then edit the Grub-menu.cfg and `make floppy` again. + +The options for the kernel command line are the following : +- vesa:[disabled|enabled] enables or disables the VESA driver (hangs on Bochs when enabled) +- keymap:[builtin|...] selects a keymap. keymaps are in Source/Kernel/Ressources/Keymaps + built-in keymap is defined in Source/Kernel/DeviceManager/Kbd.ns.cpp +- init:<init_app> select the init application to run. empty string = go to kernel shell. + default is /System/Applications/PaperWork.app + diff --git a/Source/Applications/Demos/GOL.cpp b/Source/Applications/Demos/GOL.cpp index 804c9ae..5848c2c 100644 --- a/Source/Applications/Demos/GOL.cpp +++ b/Source/Applications/Demos/GOL.cpp @@ -96,4 +96,6 @@ int main(Vector<String> args) { delete cells; delete newcells; + + outvt << "\n\n"; } diff --git a/Source/Kernel/Config.h b/Source/Kernel/Config.h index 009b133..77573aa 100644 --- a/Source/Kernel/Config.h +++ b/Source/Kernel/Config.h @@ -4,14 +4,23 @@ #define OPT_DEBUG //Color scheme -#define TXTLOGO_FGCOLOR 9 +#define TXTLOGO_FGCOLOR 9 //Colors for the melon logo #define TXTLOGO_BGCOLOR 0 -#define KVT_FGCOLOR 7 + +#define KVT_FGCOLOR 7 //Colors for the vt for selecting a screen mode #define KVT_BGCOLOR 0 -#define KVT_LIGHTCOLOR 6 -#define KVT_ENTRYCOLOR 15 +#define KVT_LIGHTCOLOR 9 +#define KVT_ENTRYCOLOR 6 +//These colors are used for the shell running the init program #define SHELL_FGCOLOR 0 #define SHELL_BGCOLOR 7 +#define PANIC_BGCOLOR 4 //Colors for the panic screen +#define PANIC_FGCOLOR 15 +#define BSOD_BGCOLOR 1 //Colors for the panic_dump screen +#define BSOD_FGCOLOR 7 +#define HALT_BGCOLOR 6 //Colors for the halt screen +#define HALT_FGCOLOR 7 + #endif diff --git a/Source/Kernel/Core/Sys.ns.cpp b/Source/Kernel/Core/Sys.ns.cpp index 1b59f7f..eeb92ee 100644 --- a/Source/Kernel/Core/Sys.ns.cpp +++ b/Source/Kernel/Core/Sys.ns.cpp @@ -8,7 +8,7 @@ #include <MemoryManager/PhysMem.ns.h> #include <DeviceManager/Time.ns.h> -#define DEBUGVT(x) SimpleVT *x = new SimpleVT(4, 56, 0, 15); x->map(); x->put('\n'); +#define DEBUGVT(x) SimpleVT *x = new SimpleVT(4, 56, PANIC_FGCOLOR, PANIC_BGCOLOR); x->map(); x->put('\n'); using namespace CMem; @@ -81,6 +81,14 @@ void dumpRegs(registers_t *regs, VirtualTerminal& vt) { vt << "eflags=" << (u32int)regs->eflags << ", useresp=" << (u32int)regs->useresp << ", ss=" << (u32int)regs->ss << "\n"; } +void stackTrace(u32int ebp, VirtualTerminal& vt, u32int maxframes) { + u32int *stack = (u32int*)ebp; + for (u32int i = 0; i < maxframes and (u32int)stack > 0xC0000000; i++) { + vt << "Frame: " << (u32int)stack << " n:" << stack[0] << " r:" << stack[1] << "\n"; + stack = (u32int*)stack[0]; + } +} + //Used by PANIC() macro (see common.wtf.h) void panic(char *message, char *file, u32int line) { asm volatile("cli"); @@ -96,7 +104,7 @@ void panic(char *message, char *file, u32int line) { void panic(char *message, registers_t *regs, char *file, u32int line) { asm volatile("cli"); - SimpleVT vt(12, 70, 7, 1); + SimpleVT vt(15, 70, BSOD_FGCOLOR, BSOD_BGCOLOR); vt.map(); vt.write("\n"); @@ -108,15 +116,11 @@ void panic(char *message, registers_t *regs, char *file, u32int line) { asm volatile("mov %%cr2, %0" : "=r"(cr2)); vt << "cr2=" << (u32int)cr2 << "\n"; } - vt << "\n\n"; + vt << "\n"; - while (1) asm volatile("cli; hlt"); + stackTrace(regs->ebp, vt, 5); - u32int *v = (u32int*)regs->ebp; - for (int i = 0; i < 10; i++) { - vt << "ebp=" << (u32int)v << ", value=" << (u32int)(v[1]) << "\n"; - v = (u32int*)(*v); - } + while (1) asm volatile("cli; hlt"); } //Used by ASSERT() macro (see common.wtf.h) @@ -144,7 +148,7 @@ void reboot() { void halt() { shutdown_cleanup(); String message("MELON SEZ : KTHXBYE, U CAN NAOW TURNZ OFF UR COMPUTER."); - SimpleVT vt(3, message.size() + 16, 7, 6); + SimpleVT vt(3, message.size() + 16, HALT_FGCOLOR, HALT_BGCOLOR); vt.map(); vt << "\n\t" << message; while (1) asm volatile("cli; hlt"); diff --git a/Source/Kernel/Core/Sys.ns.h b/Source/Kernel/Core/Sys.ns.h index c5e4400..4d15676 100644 --- a/Source/Kernel/Core/Sys.ns.h +++ b/Source/Kernel/Core/Sys.ns.h @@ -26,6 +26,7 @@ namespace Sys { u8int inb(u16int port); u16int inw(u16int port); void dumpRegs(registers_t *regs, VirtualTerminal& vt); + void stackTrace(u32int ebp, VirtualTerminal& vt, u32int maxframes); void panic(char* message, char *file, u32int line); void panic(char* message, registers_t *regs, char *file, u32int line); void panic_assert(char* file, u32int line, char *desc); diff --git a/Source/Kernel/TaskManager/Thread.class.cpp b/Source/Kernel/TaskManager/Thread.class.cpp index f1c3df1..af501fe 100644 --- a/Source/Kernel/TaskManager/Thread.class.cpp +++ b/Source/Kernel/TaskManager/Thread.class.cpp @@ -161,6 +161,8 @@ void Thread::handleException(registers_t *regs, int no) { if (no == 3) { vt << "\n\nBreakpoint data :\n"; Sys::dumpRegs(regs, vt); + Sys::stackTrace(regs->ebp, vt, 10); + vt << "Press any key to continue execution of program..."; m_process->m_inVT->getKeypress(false); vt << "\n"; |