summaryrefslogtreecommitdiff
path: root/kernel/include/arch/i686/paging.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include/arch/i686/paging.h')
-rw-r--r--kernel/include/arch/i686/paging.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/kernel/include/arch/i686/paging.h b/kernel/include/arch/i686/paging.h
new file mode 100644
index 0000000..3c0c335
--- /dev/null
+++ b/kernel/include/arch/i686/paging.h
@@ -0,0 +1,33 @@
+#pragma once
+
+#include <stddef.h>
+
+struct page_directory_t { // 32 bits
+ unsigned int present : 1;
+ unsigned int rw_flag : 1;
+ unsigned int access_lvl : 1; //0 is for only ring0. 1 is for anybody.
+ unsigned int write_through : 1;
+ unsigned int cache_off : 1;
+ unsigned int accessed : 1;
+ unsigned int zero : 1;
+ unsigned int page_size : 1;
+ unsigned int unused : 4;
+ unsigned int tbl_addr : 20;
+};
+
+struct page_table_t { // 32 bits
+ unsigned int present : 1;
+ unsigned int rw_flag : 1;
+ unsigned int access_lvl : 1; //0 is for only ring0. 1 is for anybody.
+ unsigned int write_through : 1;
+ unsigned int cache_off : 1;
+ unsigned int accessed : 1;
+ unsigned int dirty : 1;
+ unsigned int zero : 1;
+ unsigned int global : 1;
+ unsigned int reserved : 3;
+ unsigned int phys_addr : 20;
+};
+
+extern void ident_map_addr(void *addr, size_t len);
+extern void ident_unmap_addr(void *addr, size_t len);