diff options
author | aqua <aqua@iserlohn-fortress.net> | 2022-10-29 11:26:44 +0300 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2022-10-29 11:26:44 +0300 |
commit | c4fcc92183c55db868d0d6ae53e6009fb2e53ee5 (patch) | |
tree | ad5ef50aa07465e11f779c4482e20e6071182e9c /arch/i686/include/paging.h | |
parent | makefile: add libk target (diff) | |
download | kernel-c4fcc92183c55db868d0d6ae53e6009fb2e53ee5.tar.xz |
makefile: add i686/arch.a target
Diffstat (limited to 'arch/i686/include/paging.h')
-rw-r--r-- | arch/i686/include/paging.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/arch/i686/include/paging.h b/arch/i686/include/paging.h deleted file mode 100644 index cff0506..0000000 --- a/arch/i686/include/paging.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once - -// DirectoryEntry -// |31| | | | | | | | | | | | | | | | | | | |11| | 9| 8| 7| 6| 5| 4| 3| 2| 1| 0| -// | page table 4-kb aligned address | avail | G| S| | A| C| W| U| R| P| -struct __attribute__((packed)) DirectoryEntry { - unsigned present : 1; // 0: if set, the page is actually in physical memory - unsigned writeable : 1; // 1: if set, the page is read/write; otherwise the page is read-only - unsigned user : 1; // 2: if set, then page can be access by all; otherwise only the supervisor can access it - unsigned writethrough : 1; // 3: if set, write-through caching is enabled; otherwise write-back is enabled instead - unsigned cachedisable : 1; // 4: if set, the page will not be cached - unsigned accessed : 1; // 5: set by the CPU when the page is read from or written to - unsigned dirty : 1; // 6: used to determine whether a page has been written to - unsigned pagesize : 1; // 7: page size == 0 - unsigned global : 1; - unsigned int __available__ : 3; // available to the OS - unsigned int address : 20; -}; -_Static_assert(sizeof(struct DirectoryEntry) == 4); - -// DirectoryEntry4MB -// |31| | | | | | | | |22|21|20| | | | | | |13|12|11| | 9| 8| 7| 6| 5| 4| 3| 2| 1| 0| -// | bits 31-22 of address |RS| bits 39-22 of |AT| avail | G|PS| D| A|CD|WT|US|RW| P| -// | |VD| address -struct __attribute__((packed)) DirectoryEntry4MB { - unsigned present : 1; // 0: if set, the page is actually in physical memory - unsigned writeable : 1; // 1: if set, the page is read/write; otherwise the page is read-only - unsigned useraccess : 1; // 2: if set, then page can be access by all; otherwise only the supervisor can access it - unsigned writethrough : 1; // 3: if set, write-through caching is enabled; otherwise write-back is enabled instead - unsigned cachedisable : 1; // 4: if set, the page will not be cached - unsigned accessed : 1; // 5: set by the CPU when the page is read from or written to - unsigned dirty : 1; // 6: used to determine whether a page has been written to - unsigned pagesize : 1; // 7: page size == 1 - unsigned global : 1; // 8: - unsigned __available__ : 3; // 11..9 available to the OS - unsigned pat : 1; // 12: page attribute table - unsigned int address_high : 8; - unsigned rsvd : 1; // 21 - unsigned int address_low : 10; -}; -_Static_assert(sizeof(struct DirectoryEntry4MB) == 4); - -// TableEntry -// |31| | | | | | | | | | | | | | | | | | | |11| | 9| 8| 7| 6| 5| 4| 3| 2| 1| 0| -// | page table 4-kb aligned address | avail | G| | D| A| C| W|US|RW| P| -struct __attribute__((packed)) TableEntry { - unsigned present : 1; // if set, the page is actually in physical memory - unsigned writeable : 1; // if set, the page is read/write; otherwise the page is read-only - unsigned user : 1; // if set, then page can be access by all; otherwise only the supervisor can access it - unsigned writethrough : 1; // if set, write-through caching is enabled; otherwise write-back is enabled instead - unsigned cachedisable : 1; // if set, the page will not be cached - unsigned accessed : 1; // set by the CPU when the page is read from or written to - unsigned dirty : 1; // used to determine whether a page has been written to - unsigned pat : 1; // page attribute table? - unsigned global : 1; - unsigned int __available__ : 3; // available to the OS - unsigned int address : 20; -}; -_Static_assert(sizeof(struct TableEntry) == 4); |