Skip to content

Commit

Permalink
Fix disablePaging() and loadPageTable() functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenperdsmonlat1 committed Dec 30, 2023
1 parent 3642454 commit 621d809
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions include/memory/page_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ struct page_entry_t {
UINT32 address : 20;
} __attribute__((packed));

inline disablePaging() {
inline void disablePaging() {

UINT32 cr0;
__asm__ volatile("mov %%cr0, %0" : "=r"(cr0));

cr0 ~= 0x80000000;
cr0 ^= 0x80000000;
__asm__ volatile("mov %0, %%cr0" :: "r"(cr0));
}

inline enablePaging() {
inline void enablePaging() {

UINT32 cr0;
__asm__ volatile("mov %%cr0, %0" : "=r"(cr0));
Expand Down
2 changes: 1 addition & 1 deletion src/memory/page_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ void loadPageTable() {
fillTable();

page_directory[0] = ((UINT32)page_table) | 3;
__asm__ volatile ("mov %0, %%cr3" :: "r"&page_directory);
__asm__ volatile ("mov %0, %%cr3" :: "r"(&page_directory));
}

0 comments on commit 621d809

Please sign in to comment.