42_KFS/headers/memory.h

30 lines
543 B
C
Raw Normal View History

#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);