From df76b24fed5ac3b5af406aad3df277d7f4c347e5 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Mon, 31 Aug 2009 21:44:26 +0200 Subject: Now we can read frop floppy drives !!! Next : FAT driver. --- Source/Kernel/Core/.kmain.wtf.cpp.swp | Bin 0 -> 20480 bytes Source/Kernel/Core/Sys.ns.cpp | 2 +- Source/Kernel/Core/kmain.wtf.cpp | 26 ++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 Source/Kernel/Core/.kmain.wtf.cpp.swp (limited to 'Source/Kernel/Core') diff --git a/Source/Kernel/Core/.kmain.wtf.cpp.swp b/Source/Kernel/Core/.kmain.wtf.cpp.swp new file mode 100644 index 0000000..6389e15 Binary files /dev/null and b/Source/Kernel/Core/.kmain.wtf.cpp.swp differ diff --git a/Source/Kernel/Core/Sys.ns.cpp b/Source/Kernel/Core/Sys.ns.cpp index 9f98c91..faec43a 100644 --- a/Source/Kernel/Core/Sys.ns.cpp +++ b/Source/Kernel/Core/Sys.ns.cpp @@ -2,7 +2,7 @@ #include #include -#define DEBUGVT(x) VirtualTerminal *x = new VirtualTerminal(4, 46, 0, 15); x->map(); x->put('\n'); +#define DEBUGVT(x) VirtualTerminal *x = new VirtualTerminal(4, 56, 0, 15); x->map(); x->put('\n'); using namespace CMem; diff --git a/Source/Kernel/Core/kmain.wtf.cpp b/Source/Kernel/Core/kmain.wtf.cpp index 7d7030b..a657cac 100644 --- a/Source/Kernel/Core/kmain.wtf.cpp +++ b/Source/Kernel/Core/kmain.wtf.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -18,6 +19,7 @@ #include #include #include +#include #include #include @@ -104,6 +106,9 @@ void kmain(multiboot_info_t* mbd, u32int magic) { Kbd::setFocus(kvt); //Set focus to virtual terminal OK(kvt); + PROCESSING(kvt, "Detecting floppy drives..."); + FloppyController::detect(); OK(kvt); + asm volatile("sti"); while(1) { @@ -119,6 +124,7 @@ void kmain(multiboot_info_t* mbd, u32int magic) { *kvt << " - devices shows all detected devices on your computer\n"; *kvt << " - free shows memory usage (physical frames and kernel heap)\n"; *kvt << " - uptime shows seconds since boot\n"; + *kvt << " - part shows all detected block devices and partitions\n"; } else if (tmp == "reboot") { Sys::reboot(); } else if (tmp == "devices") { @@ -138,6 +144,26 @@ void kmain(multiboot_info_t* mbd, u32int magic) { "Ko) of " << (s32int)(kh / 1024 / 1024) << "Mo (" << (s32int)(kh / 1024) << "Ko).\n"; } else if (tmp == "uptime") { *kvt << " - Uptime : " << (s32int)(Time::uptime()) << "s.\n"; + } else if (tmp == "part") { + *kvt << " * Dev ID\tClass Name\n"; + for (u32int i = 0; i < Part::devices.size(); i++) { + *kvt << " - " << (s32int)i << "\t\t"; + if (Part::devices[i] == 0) { + *kvt << "[none]\n"; + } else { + *kvt << Part::devices[i]->getClass(); + kvt->setCursorCol(41); + *kvt << Part::devices[i]->getName() << "\n"; + for (u32int j = 0; j < Part::partitions.size(); j++) { + if (Part::partitions[j]->getDevice() == Part::devices[i]) { + *kvt << "\t - Partition " << (s32int)Part::partitions[j]->getPartNumber() << + ", start at " << (s32int)Part::partitions[j]->getStartBlock() << + ", size " << (s32int)Part::partitions[j]->getBlockCount() << "\n"; + } + } + } + *kvt << "\n"; + } } else if (!tmp.empty()) { *kvt << " - Unrecognized command: " << tmp << "\n"; } -- cgit v1.2.3