work on page loading

This commit is contained in:
2026-02-10 16:18:19 +01:00
parent 0521c9c1ec
commit 67291f7f19
8 changed files with 96 additions and 30 deletions

View File

@@ -88,8 +88,8 @@ void PageFrameAllocator::stats(){
//if(bitmap[i/8] & (1<<i%8))
pages_available++;
}
for(uint64_t i=0; i < 0x2000000/4096/8; i++){
if(i%64 == 0){
for(uint64_t i=0; i < 0x8000000/4096/8; i+=4){
if(i%(64*4) == 0){
DBG << endl << hex << i * 8 * 4096 << " " << flush;
int x,y;
dout.getPos(x,y);
@@ -104,9 +104,10 @@ void PageFrameAllocator::stats(){
DBG << '.';
}
DBG << "\npages available: " << dec << pages_available << endl;
}
PageFrame* PageFrameAllocator::alloc(bool kernel){
void* PageFrameAllocator::alloc(bool kernel){
uintptr_t search_start;
uintptr_t search_end;
if(kernel){
@@ -131,7 +132,7 @@ PageFrame* PageFrameAllocator::alloc(bool kernel){
return 0;
mark_pageframes(free_pageframe*4096, free_pageframe*4096, false);
return &PageFrames[free_pageframe];
return (void*)(free_pageframe*4096);
}
void PageFrameAllocator::free(PageFrame* frame){