Changeset 7cb567cd in mainline for kernel/arch/ia32/src/mm/page.c


Ignore:
Timestamp:
2007-04-08T20:52:53Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e5dbbe5
Parents:
328f324b
Message:

map kernel pages explicitly as writable (this solves compatibility issues with Intel Core 2)
make VESA framebuffer initialization more robust

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/mm/page.c

    r328f324b r7cb567cd  
    6262                 */
    6363                for (cur = 0; cur < last_frame; cur += FRAME_SIZE) {
    64                         flags = PAGE_CACHEABLE;
     64                        flags = PAGE_CACHEABLE | PAGE_WRITE;
    6565                        if ((PA2KA(cur) >= config.base) && (PA2KA(cur) < config.base + config.kernel_size))
    6666                                flags |= PAGE_GLOBAL;
     
    7070                exc_register(14, "page_fault", (iroutine) page_fault);
    7171                write_cr3((uintptr_t) AS_KERNEL->genarch.page_table);
    72         }
    73         else {
     72        } else
    7473                write_cr3((uintptr_t) AS_KERNEL->genarch.page_table);
    75         }
    7674
    7775        paging_on();
     
    8785        pfn_t i;
    8886        for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++)
    89                 page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE);
     87                page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE | PAGE_WRITE);
    9088       
    9189        last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE);
     
    9694void page_fault(int n, istate_t *istate)
    9795{
    98         uintptr_t page;
     96        uintptr_t page;
    9997        pf_access_t access;
    10098       
    101         page = read_cr2();
     99        page = read_cr2();
    102100               
    103         if (istate->error_word & PFERR_CODE_RSVD)
     101        if (istate->error_word & PFERR_CODE_RSVD)
    104102                panic("Reserved bit set in page directory.\n");
    105103
     
    108106        else
    109107                access = PF_ACCESS_READ;
    110 
    111         if (as_page_fault(page, access, istate) == AS_PF_FAULT) {
     108       
     109        if (as_page_fault(page, access, istate) == AS_PF_FAULT) {
    112110                fault_if_from_uspace(istate, "Page fault: %#x", page);
    113 
    114                 decode_istate(istate);
    115                 printf("page fault address: %#x\n", page);
    116                 panic("page fault\n");
    117         }
     111               
     112                decode_istate(istate);
     113                printf("page fault address: %#x\n", page);
     114                panic("page fault\n");
     115        }
    118116}
    119117
Note: See TracChangeset for help on using the changeset viewer.