Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void init_paging() {
- unsigned int temp_cr0;
- __asm("mov %%cr0, %0" : "=b"(temp_cr0));
- temp_cr0 |= 0x80000000;
- __asm("mov %0, %%cr0" :: "b"(temp_cr0));
- __asm("mov %0, %%cr3" :: "b"(new_pd(ACCS_BIT | WRITE_BIT)));
- }
- void* new_pd(uint16_t flags) {
- uint32_t page_directory[1024];
- uint32_t *page_dr = page_directory;
- for(uint32_t i = 0; i < 1024; i++)
- {
- page_directory[i] = new_pt() | flags;
- adress += 4096;
- }
- return page_dr;
- }
- void* new_pt() {
- void* pt_adres = pmm_alloc();
- return pt_adress;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement