os/arch/i686/paging.c

28 lines
714 B
C

#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <kernel/paging.h>
#include <kernel/tty.h>
struct x86_Page_Directory {
bool present: 1;
bool read_write: 1;
bool user_supervisor: 1;
bool write_through: 1;
bool cache_disable: 1;
bool accesed: 1;
bool available_2: 1;
bool page_size: 1;
uint8_t available_1 : 4;
uint32_t address : 20;
} __attribute__((packed));
extern uint32_t boot_page_directory[1024] __attribute__((aligned(4096)));
void setup_paging() {
size_t size = sizeof(boot_page_directory[0]);
struct x86_Page_Directory *directory = (struct x86_Page_Directory*) boot_page_directory;
uint32_t table_1 = boot_page_directory[768];
}