implements first free mem block

This commit is contained in:
2025-06-11 17:41:35 -04:00
parent f216c32f22
commit 98f8a0dc88
3 changed files with 13 additions and 27 deletions

View File

@ -1,20 +1,4 @@
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#ifndef ARCH_PMM_H
#define ARCH_PMM_H
#define PMM_BLOCKS_PER_BYTE 8 // This is for the Bitmap
#define PMM_BLOCK_SIZE 4096 // 4KiB
#define PMM_BLOCK_ALIGN (PMM_BLOCK_SIZE) // must be aligned at 4KiB
void set_grub_mem_map(uint32_t addr, uint32_t len);
uint32_t pmm_get_block_count(void);
int pmm_first_free(void);
int pmm_first_free_s(size_t pages);
void pmm_init(size_t mem_size, uint32_t* bitmap);
#endif