28 lines
519 B
C
Raw Normal View History

2022-09-05 16:13:51 +02:00
#pragma once
#include <stdint.h>
#ifndef PAGE_SIZE
#define PAGE_SIZE 4096
#endif
struct PageDirectoryEntry
2022-09-05 16:13:51 +02:00
{
bool Present : 1;
bool ReadWrite : 1;
bool UserSuper : 1;
bool WriteThrough : 1;
bool CacheDisabled : 1;
bool Accessed : 1;
bool ignore0 : 1;
bool LargerPages : 1;
bool ignore1 : 1;
uint8_t Available : 3;
uint64_t Address : 52;
2022-10-06 17:13:34 +02:00
void set_address(uint64_t addr);
};
2022-09-05 16:13:51 +02:00
struct PageTable
{
PageDirectoryEntry entries[512];
} __attribute__((aligned(PAGE_SIZE)));