test memory info
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "./debug/output.h"
|
||||
#include "./types.h" // This is actually used
|
||||
#include "arch/core_interrupt.h"
|
||||
#include "memory/pageframealloc.h"
|
||||
#include "syscall/handler.h"
|
||||
|
||||
#include "./device/textstream.h"
|
||||
@@ -22,6 +23,7 @@ OutputStream* copyout = ©stream;
|
||||
#include "./arch/ioapic.h"
|
||||
#include "./device/ps2controller.h"
|
||||
#include "./interrupt/guard.h"
|
||||
#include "./boot/multiboot/data.h"
|
||||
#include "./sync/semaphore.h"
|
||||
#include "./thread/thread.h"
|
||||
//Semaphore koutsem(1);
|
||||
@@ -38,6 +40,8 @@ static KeyboardApplication kapp;
|
||||
|
||||
// Main function
|
||||
extern "C" int main() {
|
||||
PageFrameAllocator::init();
|
||||
|
||||
tout.reset();
|
||||
tout.setPos(33, 0);
|
||||
tout << OS_NAME << " (2.x)" << flush;
|
||||
|
||||
@@ -1,7 +1,20 @@
|
||||
#include "../memory/pageframealloc.h"
|
||||
#include "../boot/multiboot/data.h"
|
||||
#include "pageframe.h"
|
||||
#include "../debug/output.h"
|
||||
|
||||
#include "../memory/config.h"
|
||||
|
||||
|
||||
void PageFrameAllocator::init(){
|
||||
Multiboot::Memory* memory_map_start = Multiboot::getMemoryMap();
|
||||
|
||||
dout << "kernel start: " << ___KERNEL_START___;
|
||||
dout << " kernel end: " << ___KERNEL_END___ << endl;
|
||||
while(memory_map_start != 0){
|
||||
dout << "Memory: " << hex << memory_map_start->getStartAddress() << " to " << memory_map_start->getEndAddress() << " is available: " << memory_map_start->isAvailable() << ".\n";
|
||||
memory_map_start = memory_map_start->getNext();
|
||||
}
|
||||
}
|
||||
|
||||
void PageFrameAllocator::stats(){
|
||||
|
||||
@@ -21,7 +21,7 @@ void IdleThread::action() {
|
||||
}
|
||||
Core::idle();
|
||||
// We woke up. Start ticking again
|
||||
dout << "idle ";
|
||||
//dout << "idle ";
|
||||
|
||||
LAPIC::Timer::setMasked(false);
|
||||
} else {
|
||||
|
||||
@@ -14,9 +14,9 @@ void Application::action() { // NOLINT
|
||||
for (unsigned i = 1;; ++i) {
|
||||
write(1, text, sizeof(text));
|
||||
if(i==id){
|
||||
write(2, "kill", 4);
|
||||
write(2, &text[4], 1);
|
||||
write(2, " ", 1);
|
||||
//write(2, "kill", 4);
|
||||
//write(2, &text[4], 1);
|
||||
//write(2, " ", 1);
|
||||
sys_exit();
|
||||
}
|
||||
sleep(1000);
|
||||
|
||||
Reference in New Issue
Block a user