From 6bf215215e1ebaa9613b51500031e6963c12d33b Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Mon, 31 Aug 2009 12:35:14 +0200 Subject: Added a few commands to built-in shell, and made a few scrshots. --- Source/Kernel/Core/.kmain.wtf.cpp.swp | Bin 24576 -> 0 bytes Source/Kernel/Core/kmain.wtf.cpp | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+) delete 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 deleted file mode 100644 index 9a87295..0000000 Binary files a/Source/Kernel/Core/.kmain.wtf.cpp.swp and /dev/null differ diff --git a/Source/Kernel/Core/kmain.wtf.cpp b/Source/Kernel/Core/kmain.wtf.cpp index e2f3707..7d7030b 100644 --- a/Source/Kernel/Core/kmain.wtf.cpp +++ b/Source/Kernel/Core/kmain.wtf.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -115,8 +116,28 @@ 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 << " - 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"; } else if (tmp == "reboot") { Sys::reboot(); + } else if (tmp == "devices") { + Vector dev = Dev::findDevices(); + *kvt << " - Detected devices :\n"; + for (u32int i = 0; i < dev.size(); i++) { + *kvt << " - " << dev[i]->getClass(); + kvt->setCursorCol(25); + *kvt << dev[i]->getName() << "\n"; + } + } else if (tmp == "free") { + u32int frames = PhysMem::total(), freef = PhysMem::free(); + *kvt << " - Free frames : " << (s32int)freef << " (" << (s32int)(freef * 4 / 1024) << "Mo) of " + << (s32int)frames << " (" << (s32int)(frames * 4 / 1024) << "Mo).\n"; + u32int kh = Mem::kheapSize(), freek = Mem::kheapFree; + *kvt << " - Kernel heap free : " << (s32int)(freek / 1024 / 1024) << "Mo (" << (s32int)(freek / 1024) << + "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.empty()) { *kvt << " - Unrecognized command: " << tmp << "\n"; } -- cgit v1.2.3