2024-09-18 11:14:06 -04:00
|
|
|
#pragma once
|
|
|
|
|
2024-09-26 10:18:06 -04:00
|
|
|
#include <stddef.h>
|
2024-09-18 11:14:06 -04:00
|
|
|
|
2024-09-19 11:04:35 -04:00
|
|
|
#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
|
2024-10-17 10:11:40 -04:00
|
|
|
#define KERN_START 0xC0000000
|
2024-09-18 11:14:06 -04:00
|
|
|
|
|
|
|
void init_memory(void);
|
2024-09-26 10:18:06 -04:00
|
|
|
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);
|