Do ATAGS get overwritten by the kernel?

隐身守侯 提交于 2019-12-11 12:19:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!