test memory info

This commit is contained in:
2026-01-10 17:21:14 +01:00
parent 262fb26ea9
commit 0e3195ec3d
4 changed files with 21 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
#include "./debug/output.h" #include "./debug/output.h"
#include "./types.h" // This is actually used #include "./types.h" // This is actually used
#include "arch/core_interrupt.h" #include "arch/core_interrupt.h"
#include "memory/pageframealloc.h"
#include "syscall/handler.h" #include "syscall/handler.h"
#include "./device/textstream.h" #include "./device/textstream.h"
@@ -22,6 +23,7 @@ OutputStream* copyout = &copystream;
#include "./arch/ioapic.h" #include "./arch/ioapic.h"
#include "./device/ps2controller.h" #include "./device/ps2controller.h"
#include "./interrupt/guard.h" #include "./interrupt/guard.h"
#include "./boot/multiboot/data.h"
#include "./sync/semaphore.h" #include "./sync/semaphore.h"
#include "./thread/thread.h" #include "./thread/thread.h"
//Semaphore koutsem(1); //Semaphore koutsem(1);
@@ -38,6 +40,8 @@ static KeyboardApplication kapp;
// Main function // Main function
extern "C" int main() { extern "C" int main() {
PageFrameAllocator::init();
tout.reset(); tout.reset();
tout.setPos(33, 0); tout.setPos(33, 0);
tout << OS_NAME << " (2.x)" << flush; tout << OS_NAME << " (2.x)" << flush;

View File

@@ -1,7 +1,20 @@
#include "../memory/pageframealloc.h" #include "../memory/pageframealloc.h"
#include "../boot/multiboot/data.h"
#include "pageframe.h" #include "pageframe.h"
#include "../debug/output.h"
#include "../memory/config.h"
void PageFrameAllocator::init(){ 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(){ void PageFrameAllocator::stats(){

View File

@@ -21,7 +21,7 @@ void IdleThread::action() {
} }
Core::idle(); Core::idle();
// We woke up. Start ticking again // We woke up. Start ticking again
dout << "idle "; //dout << "idle ";
LAPIC::Timer::setMasked(false); LAPIC::Timer::setMasked(false);
} else { } else {

View File

@@ -14,9 +14,9 @@ void Application::action() { // NOLINT
for (unsigned i = 1;; ++i) { for (unsigned i = 1;; ++i) {
write(1, text, sizeof(text)); write(1, text, sizeof(text));
if(i==id){ if(i==id){
write(2, "kill", 4); //write(2, "kill", 4);
write(2, &text[4], 1); //write(2, &text[4], 1);
write(2, " ", 1); //write(2, " ", 1);
sys_exit(); sys_exit();
} }
sleep(1000); sleep(1000);