diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2021-04-12 10:13:21 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2021-04-12 10:13:21 +0200 |
| commit | 39713a3736145483dd3310c3605f940ca34f05c3 (patch) | |
| tree | d4dcdf0f3b667a5d706aa4b04501a71facf186bd /src/utils/paging.c | |
| parent | 6edeba8fe208fb019aec00fdc72b97407a8078d3 (diff) | |
Refactoring
Diffstat (limited to 'src/utils/paging.c')
| -rw-r--r-- | src/utils/paging.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/utils/paging.c b/src/utils/paging.c deleted file mode 100644 index b1f462f..0000000 --- a/src/utils/paging.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "paging.h" - -void paging_enable(){ - int *page_dir=(int*)PAGING_DIR_LOCATION; - int *page_table=(int*)PAGING_TABLE_LOCATION; - - // Init page directory - for(int i=0;i<1024;i++) - page_dir[i]=0; - page_dir[0]=(int)page_table; - page_dir[0] |=7; // Permissions - - // Init page table 0 - int addr_offset=0; - for(int i=0;i<1024;i++){ - page_table[i]=addr_offset; - page_table[i]|=7; // Permission - addr_offset+=4096; // 4Ko pages - } - - // Turns on paging - asm( - "movl %0, %%eax \n\t" - "movl %%eax, %%cr3 \n\t" // Configure page table location - "movl %%cr0, %%eax \n\t" - "orl %1, %%eax \n\t" - "movl %%eax, %%cr0 \n\t" // Turn on paging - :: "i" (PAGING_DIR_LOCATION), "i" (PAGING_CR0_BIT) - ); - -}
\ No newline at end of file |
