Changeset 7cb567cd in mainline
- Timestamp:
- 2007-04-08T20:52:53Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e5dbbe5
- Parents:
- 328f324b
- Location:
- kernel
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/boot/boot.S
r328f324b r7cb567cd 441 441 movw %cx, %fs 442 442 movw %cx, %gs 443 444 movl $START_STACK, %esp # initialize stack pointer 443 445 444 446 jmpl $gdtselector(KTEXT32_DES), $vesa_meeting_point -
kernel/arch/amd64/src/mm/page.c
r328f324b r7cb567cd 84 84 uintptr_t cur; 85 85 int i; 86 int identity_flags = PAGE_CACHEABLE | PAGE_EXEC | PAGE_GLOBAL ;86 int identity_flags = PAGE_CACHEABLE | PAGE_EXEC | PAGE_GLOBAL | PAGE_WRITE; 87 87 88 88 if (config.cpu_active == 1) { … … 113 113 exc_register(14, "page_fault", (iroutine) page_fault); 114 114 write_cr3((uintptr_t) AS_KERNEL->genarch.page_table); 115 } 116 else { 115 } else 117 116 write_cr3((uintptr_t) AS_KERNEL->genarch.page_table); 118 }119 117 } 120 118 … … 209 207 pfn_t i; 210 208 for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) 211 page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE );209 page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE | PAGE_WRITE); 212 210 213 211 last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE); -
kernel/arch/ia32/src/boot/boot.S
r328f324b r7cb567cd 64 64 multiboot_meeting_point: 65 65 66 pushl %ebx# save parameters from GRUB67 pushl %eax66 movl %eax, grub_eax # save parameters from GRUB 67 movl %ebx, grub_ebx 68 68 69 69 xorl %eax, %eax … … 105 105 call map_kernel # map kernel and turn paging on 106 106 107 popl%eax108 popl%ebx107 movl grub_eax, %eax 108 movl grub_ebx, %ebx 109 109 cmpl $MULTIBOOT_LOADER_MAGIC, %eax # compare GRUB signature 110 110 je valid_boot … … 482 482 .code32 483 483 vesa_init_protect: 484 popl %esp485 486 484 movw $selector(KDATA_DES), %cx 487 485 movw %cx, %es … … 491 489 movw %cx, %ss 492 490 491 movl $START_STACK, %esp # initialize stack pointer 492 493 493 jmpl $selector(KTEXT_DES), $vesa_meeting_point 494 494 … … 503 503 .space 4096, 0 504 504 505 grub_eax: 506 .long 0 507 508 grub_ebx: 509 .long 0 510 505 511 pse_msg: 506 512 .ascii "Page Size Extension not supported. System halted.\0" -
kernel/arch/ia32/src/mm/page.c
r328f324b r7cb567cd 62 62 */ 63 63 for (cur = 0; cur < last_frame; cur += FRAME_SIZE) { 64 flags = PAGE_CACHEABLE ;64 flags = PAGE_CACHEABLE | PAGE_WRITE; 65 65 if ((PA2KA(cur) >= config.base) && (PA2KA(cur) < config.base + config.kernel_size)) 66 66 flags |= PAGE_GLOBAL; … … 70 70 exc_register(14, "page_fault", (iroutine) page_fault); 71 71 write_cr3((uintptr_t) AS_KERNEL->genarch.page_table); 72 } 73 else { 72 } else 74 73 write_cr3((uintptr_t) AS_KERNEL->genarch.page_table); 75 }76 74 77 75 paging_on(); … … 87 85 pfn_t i; 88 86 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); 90 88 91 89 last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE); … … 96 94 void page_fault(int n, istate_t *istate) 97 95 { 98 96 uintptr_t page; 99 97 pf_access_t access; 100 98 101 99 page = read_cr2(); 102 100 103 101 if (istate->error_word & PFERR_CODE_RSVD) 104 102 panic("Reserved bit set in page directory.\n"); 105 103 … … 108 106 else 109 107 access = PF_ACCESS_READ; 110 111 108 109 if (as_page_fault(page, access, istate) == AS_PF_FAULT) { 112 110 fault_if_from_uspace(istate, "Page fault: %#x", page); 113 114 115 116 117 111 112 decode_istate(istate); 113 printf("page fault address: %#x\n", page); 114 panic("page fault\n"); 115 } 118 116 } 119 117 -
kernel/arch/ia32/src/smp/smp.c
r328f324b r7cb567cd 83 83 if (config.cpu_count > 1) { 84 84 page_mapping_insert(AS_KERNEL, l_apic_address, (uintptr_t) l_apic, 85 PAGE_NOT_CACHEABLE );85 PAGE_NOT_CACHEABLE | PAGE_WRITE); 86 86 page_mapping_insert(AS_KERNEL, io_apic_address, (uintptr_t) io_apic, 87 PAGE_NOT_CACHEABLE );87 PAGE_NOT_CACHEABLE | PAGE_WRITE); 88 88 89 89 l_apic = (uint32_t *) l_apic_address; 90 90 io_apic = (uint32_t *) io_apic_address; 91 91 } 92 92 } 93 93 -
kernel/arch/ia32xen/src/smp/smp.c
r328f324b r7cb567cd 81 81 if (config.cpu_count > 1) { 82 82 page_mapping_insert(AS_KERNEL, l_apic_address, (uintptr_t) l_apic, 83 PAGE_NOT_CACHEABLE );83 PAGE_NOT_CACHEABLE | PAGE_WRITE); 84 84 page_mapping_insert(AS_KERNEL, io_apic_address, (uintptr_t) io_apic, 85 PAGE_NOT_CACHEABLE );85 PAGE_NOT_CACHEABLE | PAGE_WRITE); 86 86 87 87 l_apic = (uint32_t *) l_apic_address; 88 88 io_apic = (uint32_t *) io_apic_address; 89 89 } 90 90 } 91 91 -
kernel/arch/ppc32/src/mm/page.c
r328f324b r7cb567cd 54 54 pfn_t i; 55 55 for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) 56 page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE );56 page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE | PAGE_WRITE); 57 57 58 58 last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE); -
kernel/arch/ppc64/src/mm/page.c
r328f324b r7cb567cd 265 265 int flags; 266 266 267 /* Frames below 128 MB are mapped using BAT,268 map rest of the physical memory */269 267 for (cur = 128 << 20; cur < last_frame; cur += FRAME_SIZE) { 270 flags = PAGE_CACHEABLE ;268 flags = PAGE_CACHEABLE | PAGE_WRITE; 271 269 if ((PA2KA(cur) >= config.base) && (PA2KA(cur) < config.base + config.kernel_size)) 272 270 flags |= PAGE_GLOBAL; … … 297 295 pfn_t i; 298 296 for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) 299 page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE );297 page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE | PAGE_WRITE); 300 298 301 299 last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE); -
kernel/genarch/src/acpi/acpi.c
r328f324b r7cb567cd 89 89 static void map_sdt(struct acpi_sdt_header *sdt) 90 90 { 91 page_mapping_insert(AS_KERNEL, (uintptr_t) sdt, (uintptr_t) sdt, PAGE_NOT_CACHEABLE );91 page_mapping_insert(AS_KERNEL, (uintptr_t) sdt, (uintptr_t) sdt, PAGE_NOT_CACHEABLE | PAGE_WRITE); 92 92 map_structure((uintptr_t) sdt, sdt->length); 93 93 } -
kernel/generic/src/mm/page.c
r328f324b r7cb567cd 77 77 78 78 for (i = 0; i < cnt; i++) 79 page_mapping_insert(AS_KERNEL, s + i * PAGE_SIZE, s + i * PAGE_SIZE, PAGE_NOT_CACHEABLE );79 page_mapping_insert(AS_KERNEL, s + i * PAGE_SIZE, s + i * PAGE_SIZE, PAGE_NOT_CACHEABLE | PAGE_WRITE); 80 80 81 81 }
Note:
See TracChangeset
for help on using the changeset viewer.