???Linux????????????
???????????? ???????[ 2013/5/13 10:24:57 ] ????????
???????????д??????????my_page_fault??
asmlinkage void my_page_fault(void);
asm(" .text");
asm(" .type my_page_fault??@function");
asm("my_page_fault:");
//the first 3 bytes of the routine basically do nothing??
//but I decide to keep them because kernel may rely on them for some special purpose
asm(" .byte 0x66");
asm(" xchg %ax?? %ax");
asm(" callq *addr_adjust_exception_frame");
asm(" sub $0x78?? %rsp");
asm(" callq *addr_error_entry");
asm(" mov %rsp?? %rdi");
asm(" mov 0x78(%rsp)?? %rsi");
asm(" movq $0xffffffffffffffff?? 0x78(%rsp)");
asm(" callq my_do_page_fault");
asm(" jmpq *addr_error_exit");
asm(" nopl (%rax)");
???????е?9??addr_adjust_exception_frame??(pv_irq_ops+0x30)??????洢???????11??addr_error_entry??error_entry????????16??addr_error_exit??error_exit????????????????System.map????в?????????????????????????????my_do_page_fault????????????????page fault?????????
?????????????X86_32??page fault??????ο????C????????????????????°??????????????????????????????????????Щ??????
??????????????ISR???????????ISR??IDT?У??????μ?IDT???????????page fault???????????????????????????????????????????裺
??????store_idt(&default_idtr)???????е?IDT??????
??????default_idtr?ж???IDT???????????С
??????????????
???????????idt???????????????????
????????pack_gate??my_page_fault???????my_do_page_fault???????????IDT????
??????idtr????д?μ?IDT???????С????load_idt(&idtr)?????μ?IDT??????CPU
????????smp_call_function?????μ?IDT??????????CPU???
????????????????IDT???????load(&default_idtr)??smp_call_function?????????IDT?????????????檔
???????????????????ο????github?е????https://github.com/RichardUSTC/intercept-page-fault-handler
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11