问题
I have read that the ATAGS (used on arm processors to provide the Linux kernel with information such as the memory layout) are loaded to [SystemRAM base]+0x100. On the Nexus 4 the SystemRAM base is at 0x8020000. I also know that the kernel is loaded to 0x80208000. I have verified that is is the case by dumping the portion of memory using the command:
dd if=/dev/mem bs=1 skip=$((0x80208000)) count=$((0x200)) of=kimage_hdr
The header output file matches the expected header of an uncompressed kernel image. However when I try to view the atags with the following command, the resulting file does not contain the a valid ATAG list.
dd if=/dev/mem bs=1 skip=$((0x80200100)) count=$((0x200)) of=atags
I am running Android and have used the kexec_load syscall to reload and reboot the kernel explicitly placing the ATAG information at 0x80201000 (0x80200100 does not align to a page boundary). The kernel reloads, but even when I look explicitly at this section the ATAGS are gone.
Does anybody know if the kernel reallocates, or otherwise modifies, this area of memory, or am I doing something wrong?
BTW: I know I can get the ATAGS through /proc/atags but I want know where they are now stored in physical ram.
来源:https://stackoverflow.com/questions/17865430/do-atags-get-overwritten-by-the-kernel