feature: enable paging and load page directory
This commit is contained in:
29
headers/memory.h
Normal file
29
headers/memory.h
Normal file
@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define NOT_PRESENT (1 << 0)
|
||||
#define RW (1 << 1)
|
||||
#define SUPERVISOR (0 << 2)
|
||||
#define INIT_FLAGS (NOT_PRESENT | RW | SUPERVISOR)
|
||||
|
||||
struct page_directory_entry {
|
||||
uint32_t present : 1;
|
||||
uint32_t rw : 1;
|
||||
uint32_t user : 1;
|
||||
uint32_t page_size : 1;
|
||||
uint32_t unused : 8;
|
||||
uint32_t frame : 20;
|
||||
};
|
||||
|
||||
struct page_table_entry {
|
||||
uint32_t present : 1;
|
||||
uint32_t rw : 1;
|
||||
uint32_t user : 1;
|
||||
uint32_t accessed : 1;
|
||||
uint32_t dirty : 1;
|
||||
uint32_t unused : 7;
|
||||
uint32_t frame : 20;
|
||||
};
|
||||
|
||||
void init_memory(void);
|
Reference in New Issue
Block a user