Set interrupt on / dev / mem access

Is there a way to set an interrupt at a specific physical address in / dev / mem on ARM Linux. So if the application tried to write to the selected address rather than write an operation, does it call my function?

Clarifications The
technique Sam introduced here (write_mem () and read_mem ()) does not work. I'll add more details in case someone can provide an answer.

I want to manage I / O communication between an application and a physical address. Unfortunately, the application manages I / O directly without using the driver (by mapping the physical memory of the assigned value to the mapped memory, for example * value-in-mappedaddress = 0x1F). I want to monitor and even change the values ​​that the application writes to physical memory.

There are three ways for me:

  • Setting a hardware breakpoint in physical memory (I cannot debug the application)

  • Changing the page table, so every time the application requests mapped memory, I send my write request to a different location.

  • Directly modify the values ​​in the mapped address by setting a software breakpoint at the mapped address (the application uses mmap2 () to map the application)

So now I have to use one of these ways, which so far has had no success on any of them.


source to share

All Articles