blm768 wrote:I've been writing some code to process the ATAGS so I can get a memory map, but I'm having some difficulty actually getting useful values. It appears that the ATAG_CORE is there as expected, but its page size field is set to zero, and it's immediately followed by an ATAG_END.
When I tried this (https://github.com/brianwiddas/pi-barem ... er/atags.c
), I found I was getting ATAG_CORE, ATAG_MEM, ATAG_INITRD2 (if an initial ramdisk was configured), ATAG_CMDLINE and ATAG_NONE.
ATAG_CORE had the three optional values (flags, page size and root device), but they were all zero.
The first handful of byes of the ATAGs data is:
0x00000005 - length of ATAG_CORE
0x54410001 - ATAG_CORE
0x00000000 - flags
0x00000000 - page size
0x00000000 - root device
0x00000004 - length of ATAG_MEM
0x54410002 - ATAG_MEM
0x0c000000 - size of memory area (in this case, 192MB)
0x00000000 - address of memory area (0x00000000 - 0x0bffffff)
Since the value of ATAG_NONE is zero, is it possible you didn't increment far enough into the memory, and misread one of the ATAG_CORE values as ATAG_NONE?
Alternatively, did you go too far and read the start address of ATAG_MEM as ATAG_NONE? If you counted 5 words from the start of the data in ATAG_CORE rather than the start of the header, this would happen.