This C program snippet as follows intends to copy some memory, say 1,024 bytes, using the usual memcpy(3) glibc API, from a source location 300 KB into the program to a destination location 400 KB into the program. As Application 1 is the program at the low end of physical memory (see the preceding memory map), it starts at the 0x0 physical offset.
First, let's see the correct usage case.
Refer to the following pseudocode:
phy_offset = 0x0;src = phy_offset + (300*1024); /* = 0x0004 b000 */dest = phy_offset + (400*1024); /* = 0x0006 4000 */n = 1024; ...