#include #include #include #include #include #include #include #include // gcc -static -Wl,-Ttext=0x10000000 -o paefun paefun.c && ./paefun char buf[1000]; int main(int argc, char *argv[]) { int *addr; int i; sprintf(buf, "cat /proc/%d/maps; echo", getpid()); system(buf); addr = mmap(0x40000000, 0x10000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); *addr = 10; system(buf); munmap(addr, 0x10000); printf("addr: %p\n", addr); system(buf); } /* throw some junk like this in task_mmu.c's m_start: pgd_t *pgd; pgd = pgd_offset(priv->task->mm, 0); for (i = 0; i < PTRS_PER_PGD; i++) { printk("pgd[%d]: %016Lx\n", i, *(u64 *)&pgd[i]); } */