I want write something in userspace program, for example: write the value 3
in the physical address 0xF7F4900(260MB)
from the start address 0x0
, while all kernel sits in the range 0-240MB.
How can I do it? any idea please?
Best regards.
I thought to use mmap but I think it gets me the virtual address.
memfd = open("/dev/mem", O_RDWR);
map = mmap(0xF7F4900, sizeof(int), PROT_WRITE, MAP_SHARED, memfd, 0);
*map = 3;