What are memory mapped page and anonymous page?

The correct terms are memory mapped files and anonymous mappings. When referring to memory mapping, one is usually referring to mmap(2). There are 2 categories for using mmap. One category is SHARED vs PRIVATE mappings. The other category is FILE vs ANONYMOUS mappings. Mixed together you get the 4 following combinations: PRIVATE FILE MAPPING SHARED … Read more

How to access physical addresses from user space in Linux?

busybox devmem busybox devmem is a tiny CLI utility that mmaps /dev/mem. You can get it in Ubuntu with: sudo apt-get install busybox Usage: read 4 bytes from the physical address 0x12345678: sudo busybox devmem 0x12345678 Write 0x9abcdef0 to that address: sudo busybox devmem 0x12345678 w 0x9abcdef0 Source: https://github.com/mirror/busybox/blob/1_27_2/miscutils/devmem.c#L85 mmap MAP_SHARED When mmapping /dev/mem, you … Read more