diff --git a/.gitignore b/.gitignore index ed85fd2..5202d5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ bochsout.txt +opt +.ccls +.ccls-cache +.envrc diff --git a/arch/i686/paging.c b/arch/i686/paging.c index affc06f..fd8c586 100644 --- a/arch/i686/paging.c +++ b/arch/i686/paging.c @@ -6,21 +6,22 @@ #include struct x86_Page_Directory { - uint32_t address : 20; - uint8_t available_1 : 4; - bool page_Size: 1; - bool available_2: 1; - bool accesed: 1; - bool cache_disable: 1; - bool write_through: 1; - bool user_supervisor: 1; - bool read_write: 1; 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)); -struct x86_Page_Directory page_directory[1024] __attribute__((aligned(4096))); +extern uint32_t boot_page_directory[1024] __attribute__((aligned(4096))); void setup_paging() { - size_t size = sizeof(page_directory[0]); + 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]; }