From 8ba77bcd6941f94d41922d97e5cc050126964a0f Mon Sep 17 00:00:00 2001 From: Garritt McCune Date: Sat, 12 Dec 2020 21:03:19 -0600 Subject: [PATCH] Added the start of the page structures. --- .gitignore | 4 ++++ build_numbers.c | 2 +- includes/idt.h | 4 ++-- includes/page_structs.h | 19 +++++++++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 includes/page_structs.h diff --git a/.gitignore b/.gitignore index a9e2c49..1df7017 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,7 @@ *.pdf *.aux *.gz +.gitignore.save +GPATH +GRTAGS +GTAGS diff --git a/build_numbers.c b/build_numbers.c index 7cbc7d7..bc0b29e 100644 --- a/build_numbers.c +++ b/build_numbers.c @@ -1,3 +1,3 @@ #ifndef KERNEL_VERSION_NUMBER -#define KERNEL_VERSION_NUMBER "0.0.3-46" +#define KERNEL_VERSION_NUMBER "0.0.3-50" #endif diff --git a/includes/idt.h b/includes/idt.h index 5f6d81e..5e77ad8 100644 --- a/includes/idt.h +++ b/includes/idt.h @@ -9,7 +9,7 @@ struct idt_entry unsigned short base_hi; } __attribute__((packed)); -struct idt_ptr +struct idt { unsigned short size; struct idt_entry* idt_entries_start; @@ -17,5 +17,5 @@ struct idt_ptr void install_idt(void); void idt_set_gate(unsigned char, unsigned long, unsigned short, unsigned char); -void load_idt(struct idt_ptr*); +void load_idt(struct idt*); #endif diff --git a/includes/page_structs.h b/includes/page_structs.h new file mode 100644 index 0000000..84f3fb4 --- /dev/null +++ b/includes/page_structs.h @@ -0,0 +1,19 @@ +#ifndef PAGE_STRUCTS_H +#define PAGE_STRUCTS_H + +enum X86_PTE_FLAGS +{ + X86_PTE_PRESENT = 0x01, + X86_PTE_WRITEABLE = 0x02, + X86_PTE_USER = 0x04, //User mode, 0 for supervisor mode, 1 for user mode. + X86_PTE_WRITETHROUGH = 0x08, // + X86_PTE_NOT_CACHEABLE = 0x10, // + X86_PTE_ACCESSED = 0x20, + X86_PTE_DIRTY = 0x40, + X86_PTE_PAT = 0x80, + X86_PTE_CPU_GLOBAL = 0x100, + X86_PTE_LV4_GLOBAL = 0x200, + X86_PTE_FRAME = 0x7FFFF000 +}; + +#endif