Rev 1888 | Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1888 | Rev 1958 | ||
|---|---|---|---|
| Line 108... | Line 108... | ||
| 108 | for (i = 0; i < init.cnt; i++) { |
108 | for (i = 0; i < init.cnt; i++) { |
| 109 | for (cur = init.tasks[i].addr; cur < init.tasks[i].addr + init.tasks[i].size; cur += FRAME_SIZE) |
109 | for (cur = init.tasks[i].addr; cur < init.tasks[i].addr + init.tasks[i].size; cur += FRAME_SIZE) |
| 110 | page_mapping_insert(AS_KERNEL, PA2KA_CODE(KA2PA(cur)), KA2PA(cur), identity_flags); |
110 | page_mapping_insert(AS_KERNEL, PA2KA_CODE(KA2PA(cur)), KA2PA(cur), identity_flags); |
| 111 | } |
111 | } |
| 112 | 112 | ||
| 113 | exc_register(14, "page_fault", (iroutine)page_fault); |
113 | exc_register(14, "page_fault", (iroutine) page_fault); |
| 114 | write_cr3((uintptr_t) AS_KERNEL->page_table); |
114 | write_cr3((uintptr_t) AS_KERNEL->page_table); |
| 115 | } |
115 | } |
| 116 | else { |
116 | else { |
| 117 | write_cr3((uintptr_t) AS_KERNEL->page_table); |
117 | write_cr3((uintptr_t) AS_KERNEL->page_table); |
| 118 | } |
118 | } |
| Line 191... | Line 191... | ||
| 191 | access = PF_ACCESS_READ; |
191 | access = PF_ACCESS_READ; |
| 192 | 192 | ||
| 193 | if (as_page_fault(page, access, istate) == AS_PF_FAULT) { |
193 | if (as_page_fault(page, access, istate) == AS_PF_FAULT) { |
| 194 | fault_if_from_uspace(istate, "Page fault: %#x", page); |
194 | fault_if_from_uspace(istate, "Page fault: %#x", page); |
| 195 | 195 | ||
| 196 | print_info_errcode(n, istate); |
196 | decode_istate(n, istate); |
| 197 | printf("Page fault address: %llx\n", page); |
197 | printf("Page fault address: %llx\n", page); |
| 198 | panic("page fault\n"); |
198 | panic("page fault\n"); |
| 199 | } |
199 | } |
| 200 | } |
200 | } |
| 201 | 201 | ||