in reply to Re: Accessing Memory-mapped I/O
in thread Accessing Memory-mapped I/O
Here is a snippet of perl code:
open(FH, "<", "/dev/mem"); binmode(FH); seek(FH,0xff230180,0); #Fails with bad address
Here is a snippet of C code:
devmem_fd = open("/dev/mem", O_RDWR | O_SYNC); bridge_map = (uint32_t*)mmap(NULL, 0x100, PROT_READ|PROT_WRITE, MAP_SHARED, devmem_fd, 0xff230180); reg = (uint32_t*) bridge_map; printf("Register contents: 0x08x\n", *reg); munmap (bridge_map, 0x100); close(devmem_fd);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Accessing Memory-mapped I/O
by Corion (Patriarch) on Oct 31, 2019 at 17:32 UTC | |
by Anonymous Monk on Oct 31, 2019 at 17:38 UTC | |
by stevieb (Canon) on Oct 31, 2019 at 20:11 UTC | |
by Anonymous Monk on Nov 01, 2019 at 12:16 UTC | |
by jcb (Parson) on Nov 01, 2019 at 22:42 UTC | |
| |
by Anonymous Monk on Nov 01, 2019 at 12:18 UTC | |
|