I want to set a signal handler in my application, so that the kernel sends a signal whenever it handles a page fault trap. Ofcourse I can use the SIGSEGV
signal handler, but what I'm really interested in is to catch the page faults which occur on copy-on-write. For example after a fork (not followed by exec), the original process will get a page fault if it tries to write to some page. I want to get notified on such page faults. How can I achieve this?
page faults are interrupts handled by do_page_fault()
http://www.stillhq.com/pdfdb/000446/data.pdf
Signals also generate an interrupt. The difference is that the page fault interrupt is vectored to the code. There is an explanation of what the code does. IMO, always generating another interrupt in a an interrupt handler is a bad idea.
Tell us: What are you trying to accomplish? Not how you think it should be done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With