This commit is contained in:
nub31
2025-09-03 17:20:00 +02:00
parent ad879af3f9
commit 0b8ee325aa
6 changed files with 10 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
#include "../../kernel.h"
#include "../../kernel/kernel.h"
#include "../arch.h"
#include "interrupts/idt.h"
#include "interrupts/irq.h"

View File

@@ -5,5 +5,8 @@
void main()
{
pmm_init();
uint64_t page = pmm_alloc_page();
printf("page: %u\n", page);
printf("Welcome to nub OS :)\n");
}

View File

@@ -1,5 +1,5 @@
#include "pmm.h"
#include "arch/arch.h"
#include "../arch/arch.h"
#include <stddef.h>
#include <stdio.h>
#include <string.h>
@@ -52,6 +52,7 @@ void pmm_init()
}
}
// Returns the address of first free physical page
uint64_t pmm_alloc_page()
{
for (size_t i = 0; i < BITMAP_SIZE; i++)
@@ -73,6 +74,7 @@ uint64_t pmm_alloc_page()
return 0;
}
// Frees the physical page at the specified address
void pmm_free_page(uint64_t addr)
{
uint64_t page = addr / PAGE_SIZE;