summaryrefslogtreecommitdiff
path: root/Source/Kernel/Core/kmain.wtf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Kernel/Core/kmain.wtf.cpp')
-rw-r--r--Source/Kernel/Core/kmain.wtf.cpp60
1 files changed, 11 insertions, 49 deletions
diff --git a/Source/Kernel/Core/kmain.wtf.cpp b/Source/Kernel/Core/kmain.wtf.cpp
index 83fca7b..aa87d49 100644
--- a/Source/Kernel/Core/kmain.wtf.cpp
+++ b/Source/Kernel/Core/kmain.wtf.cpp
@@ -86,38 +86,6 @@ u32int logoAnimation(void* p) {
return 0;
}
-void selectVideoMode(SimpleVT& v) {
- Disp::getModes();
- v << "\nPlease select a graphic mode in the list below:\n";
-
- for (u32int i = 0; i < Disp::modes.size(); i++) {
- Disp::mode_t& m = Disp::modes[i];
- v << (s32int)i << ":\t" << "Text " << m.textRows << "x" << m.textCols << "\t";
- if (m.graphWidth != 0 and m.graphHeight != 0) {
- v << "Graphics " << m.graphWidth << "x" << m.graphHeight << "x" << m.graphDepth << "\t";
- } else {
- v << "No graphics";
- }
- v.setCursorCol(50);
- v << m.device->getName() << "\n";
- }
-
- while (1) {
- v << "\nYour selection: ";
- String answer = v.readLine();
- u32int n = answer.toInt();
- v.unmap();
- if (n >= 0 and n < Disp::modes.size() and Disp::setMode(Disp::modes[n])) {
- SB::reinit();
- return;
- } else {
- Disp::setMode(Disp::modes[1]);
- v.map();
- v << "Error while switching video mode, please select another one.";
- }
- }
-}
-
void kmain(multiboot_info_t* mbd, u32int magic) {
DEBUG("Entering kmain.");
@@ -151,7 +119,12 @@ void kmain(multiboot_info_t* mbd, u32int magic) {
SB::progress("Create kernel VT");
kvt = new ScrollableVT(24, 80, 20, KVT_FGCOLOR, KVT_BGCOLOR);
kvt->map(1, 0);
- kvt->moveCursor(0, 0);
+ kvt->setColor(TXTLOGO_FGCOLOR, TXTLOGO_BGCOLOR);
+ for (int i = 0; i < melonLogoLines; i++) {
+ kvt->setCursorCol(40 - (melonLogoCols / 2));
+ *kvt << melonLogo[i] << "\n";
+ }
+ kvt->setColor(KVT_FGCOLOR, KVT_BGCOLOR);
SB::progress("IDT");
IDT::init(); //Setup interrupts
@@ -225,7 +198,6 @@ void kmain(multiboot_info_t* mbd, u32int magic) {
if (!m.empty() && m[0] != WChar("#")) VFS::mount(m, kvt, mbd);
}
}
-
//*************************************** LOAD SYSTEM STUFF
@@ -242,36 +214,26 @@ void kmain(multiboot_info_t* mbd, u32int magic) {
Usr::load(); //Setup user managment
Log::log(KL_STATUS, "kmain : User list loaded");
+ SB::progress("Video mode selection");
+ Disp::selectMode();
if (init.empty()) {
SB::progress("Start kernel shell");
*kvt << "\n";
new KernelShell(cwd, kvt);
- SB::message("Melon is running \\o/");
+ SB::message("Melon is running");
while (KernelShell::getInstances() > 0) {
Task::currThread()->sleep(100);
}
Sys::halt();
} else {
- SB::progress("Video mode selection");
- selectVideoMode(*kvt);
- SB::progress("Logo setup");
- //Create a VT for handling the Melon bootup logo
- SimpleVT *melonLogoVT = new SimpleVT(melonLogoLines, melonLogoCols, TXTLOGO_FGCOLOR, TXTLOGO_BGCOLOR);
- melonLogoVT->map(1);
- new Thread(logoAnimation, (void*)melonLogoVT, true);
-
SB::progress("Launch INIT");
Process* p = Process::run(init, 0);
if (p == 0) {
PANIC((char*)(u8int*)ByteArray(String("Could not launch init : ") += init));
} else {
Log::log(KL_STATUS, String("kmain : Starting init : ") += init);
- VirtualTerminal* vt = new ScrollableVT(Disp::textRows() - 10, Disp::textCols() - 4,
- 200, SHELL_FGCOLOR, SHELL_BGCOLOR);
- Kbd::setFocus(vt);
- ((ScrollableVT*)vt)->map(9);
- p->setInVT(vt);
- p->setOutVT(vt);
+ p->setInVT(kvt);
+ p->setOutVT(kvt);
p->start();
SB::message("Init started");
while (p->getState() != P_FINISHED) Task::currThread()->sleep(100);