This commit is contained in:
2026-01-19 19:38:45 +01:00
parent f70f29cea3
commit 609a8e80ef

View File

@@ -16,7 +16,7 @@ typedef struct {
uint64_t address:39 = 0;
uint16_t rsvd_1:10 = 0;
uint8_t execute_disable:1 = 0;
} pagetable_entry_t;
} __attribute__((__packed__)) pagetable_entry_t;
typedef struct {
pagetable_entry_t entries[512];
@@ -33,13 +33,13 @@ typedef struct {
uint64_t address:39 = 0;
uint16_t rsvd_1:10 = 0;
uint8_t execute_disable:1 = 0;
} pagedirectory_entry_t;
} __attribute__((__packed__)) pagedirectory_entry_t;
typedef struct {
alignas(4096) pagedirectory_entry_t l4;
alignas(4096) pagedirectory_entry_t l3;
alignas(4096) pagedirectory_entry_t l2[1];
alignas(4096) pagetable_t l1[1];
alignas(4096) pagedirectory_entry_t l2[32];
alignas(4096) pagetable_t l1[32];
} four_lvl_paging_t;
void create_basic_page_table(uintptr_t base);