35 #define PAGE_SIZE 0x1000 36 #define PAGE_MASK 0xFFF 38 #define PAGE_COUNT 0x100000 48 #define PHYSMEM_FREE 0 49 #define PHYSMEM_RESERVED 1 void physMemFreeMemory(uint32_t addr, uint32_t length)
Marks all pages fully contained within the memory range as free.
uint32_t physMemReleasePage(uint32_t index)
Releases a page of physical memory.
uint32_t physMemMarkUnpageable(uint32_t index)
Marks a physical page as unpageable.
uint32_t physMemPageIn(UNUSED uint32_t hdd_index)
Pages in some data from the hard drive.
void physMemProtectBootEntry(uint32_t addr, uint32_t length)
Marks all pages within a memory range as reserved and adds them to the boot map.
bool physMemIsLastRef(uint32_t index)
Checks if a physical page is only referenced exactly one time.
void physMemReserveMemory(uint32_t addr, uint32_t length)
Marks all pages within a memory range as reserved.
uint32_t physMemAddRefPage(uint32_t index)
Increment the refcounter of a physical page.
void physMemSetMemoryBits(uint32_t startIndex, uint32_t length, bool reserved)
Marks a specific range of pages as reserved or free.
void physMemInit(multiboot_info_t *bootInfo)
Initializes the physical memory management.
uint32_t physMemRAMSize()
Query RAM size.
void physMemDumpMemInfo()
Dumps information about the physical memory usage.
uint32_t physMemAllocPage(bool lowmem)
Allocates a page of physical memory.
void physMemClearMemoryBits(bool reserved)
Marks the full memory range as reserved or free.
void physMemPageOut(UNUSED uint32_t length)
Pages out some memory to the hard drive.
uint32_t physMemUsableMemory()
Query usable RAM size.