diff options
author | Alexis211 <alexis211@gmail.com> | 2009-08-31 12:35:14 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-08-31 12:35:14 +0200 |
commit | 6bf215215e1ebaa9613b51500031e6963c12d33b (patch) | |
tree | 42c2aea12b4976e06146da5ea9a9d83d28a4d176 /Source/Kernel/Core | |
parent | 68a8fb4e3b3e9087904b17ce6d81983950b9dca9 (diff) | |
download | Melon-6bf215215e1ebaa9613b51500031e6963c12d33b.tar.gz Melon-6bf215215e1ebaa9613b51500031e6963c12d33b.zip |
Added a few commands to built-in shell, and made a few scrshots.
Diffstat (limited to 'Source/Kernel/Core')
-rw-r--r-- | Source/Kernel/Core/.kmain.wtf.cpp.swp | bin | 24576 -> 0 bytes | |||
-rw-r--r-- | Source/Kernel/Core/kmain.wtf.cpp | 21 |
2 files changed, 21 insertions, 0 deletions
diff --git a/Source/Kernel/Core/.kmain.wtf.cpp.swp b/Source/Kernel/Core/.kmain.wtf.cpp.swp Binary files differdeleted file mode 100644 index 9a87295..0000000 --- a/Source/Kernel/Core/.kmain.wtf.cpp.swp +++ /dev/null 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 <DeviceManager/Disp.ns.h> #include <DeviceManager/Dev.ns.h> #include <DeviceManager/Kbd.ns.h> +#include <DeviceManager/Time.ns.h> #include <VTManager/VirtualTerminal.class.h> #include <MemoryManager/PhysMem.ns.h> #include <MemoryManager/PageAlloc.ns.h> @@ -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<Device*> 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"; } |