idk we're trying out pmm
This commit is contained in:
@ -7,6 +7,5 @@ void kwarn(const char*);
|
||||
|
||||
void kinfo(const char*);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -3,14 +3,4 @@
|
||||
#ifndef ARCH_PAGING_H
|
||||
#define ARCH_PAGING_H
|
||||
|
||||
#define PAGE_TABLE_ENTRIES 1024
|
||||
#define PAGE_DIRECTORY_ENTRIES 1024
|
||||
|
||||
void load_page_directory(uint32_t*);
|
||||
|
||||
void enable_paging();
|
||||
|
||||
|
||||
void setup_paging(void);
|
||||
|
||||
#endif
|
||||
|
20
kernel/include/kernel/pmm.h
Normal file
20
kernel/include/kernel/pmm.h
Normal file
@ -0,0 +1,20 @@
|
||||
#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
|
Reference in New Issue
Block a user