42_KFS/headers/memory.h
2024-10-18 14:45:37 +02:00

18 lines
430 B
C

#pragma once
#include <stddef.h>
#define PRESENT (1 << 0)
#define RW (1 << 1)
#define SUPERVISOR (0 << 2)
#define ACCESSED (1 << 4)
#define INIT_FLAGS (PRESENT | RW | SUPERVISOR)
#define PAGE_SIZE 4096
#define HEAP_END 0xC0000000
void init_memory(void);
void *alloc_frames(size_t size);
int free_frames(void *frame_ptr, size_t size);
void *alloc_pages(size_t size);
int free_pages(void *page_ptr, size_t size);