-
-
Save ldunn/514659 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void switch_page_directory(page_directory_t *dir) | |
| { | |
| current_directory = dir; | |
| __asm__ __volatile__("mov %0, %%cr3":: "r"(dir->physical_address)); | |
| unsigned int cr0; | |
| __asm__ __volatile__("mov %%cr0, %0": "=r"(cr0)); | |
| cr0 |= 0x80000000; // Enable paging! | |
| panic("ohi"); | |
| __asm__ __volatile__("mov %0, %%cr0":: "r"(cr0)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment