MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / logPageFault

Method logPageFault

source/kernel/kmemory.cpp:586–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

584}
585
586void KMemory::logPageFault(KThread* thread, U32 address) {
587 U32 start = 0;
588 CPU* cpu = thread->cpu;
589
590 BString name = process->getModuleName(cpu->seg[CS].address + cpu->eip.u32);
591 klog_fmt("%.8X EAX=%.8X ECX=%.8X EDX=%.8X EBX=%.8X ESP=%.8X EBP=%.8X ESI=%.8X EDI=%.8X %s at %.8X", cpu->seg[CS].address + cpu->eip.u32, cpu->reg[0].u32, cpu->reg[1].u32, cpu->reg[2].u32, cpu->reg[3].u32, cpu->reg[4].u32, cpu->reg[5].u32, cpu->reg[6].u32, cpu->reg[7].u32, name.c_str(), process->getModuleEip(cpu->seg[CS].address + cpu->eip.u32));
592
593 klog_fmt("Page Fault at %.8X", address);
594 klog("Valid address ranges:");
595 for (U32 i = 0; i < K_NUMBER_OF_PAGES; i++) {
596 if (!start) {
597 if (data->isPageValid(i)) {
598 start = i;
599 }
600 } else {
601 if (!data->isPageValid(i)) {
602 klog_fmt(" %.8X - %.8X", start * K_PAGE_SIZE, i * K_PAGE_SIZE);
603 start = 0;
604 }
605 }
606 }
607 klog("Mapped Files:");
608 process->printMappedFiles();
609 cpu->walkStack(cpu->eip.u32, EBP, 2);
610 kpanic("pf");
611}
612
613void KMemory::performOnMemory(U32 address, U32 len, bool readOnly, std::function<bool(U8* ram, U32 len)> callback) {
614 if (!len) {

Callers 2

seg_mapperMethod · 0.80
seg_accessMethod · 0.80

Calls 9

klog_fmtFunction · 0.85
klogFunction · 0.85
kpanicFunction · 0.85
getModuleNameMethod · 0.80
getModuleEipMethod · 0.80
isPageValidMethod · 0.80
printMappedFilesMethod · 0.80
walkStackMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected