The source code on finding the DRAM mapping is in "memtest". The modification on Redis' memory allocation is in "redis-2.6.16/src".