On 08/12/2022 18:42, Ayan Kumar Halder wrote: > On 08/12/2022 16:53, Julien Grall wrote: >> On 08/12/2022 15:24, Michal Orzel wrote: >>> So the first issue with Zephyr is that it does not support zImage >>> protocol for arm32. >>> Volodymyr added support only for Image header for arm64 Zephyr. >>> I guess this is why Ayan, willing to boot it on Xen (arm32), decided >>> to add u-boot header. >> >> If that's the only reason, then I would rather prefer if we go with >> zImage for a few reasons: >> - The zImage protocol has at least some documentation (not perfect) >> of the expected state of the memory/registers when jumping to the image. >> - AFAICT libxl is not (yet) supporting uImage. So this means zephyr >> cannot be loaded on older Xen releases (not great). > > I am exploring for a similar option as Volodymyr ie support zimage > protocol for arm32. > > But for that I need some public documentation that explains the zimage > header format for arm32. > > Refer xen/arch/arm/kernel.c > > #define ZIMAGE32_MAGIC_OFFSET 0x24 > #define ZIMAGE32_START_OFFSET 0x28 > #define ZIMAGE32_END_OFFSET 0x2c > #define ZIMAGE32_HEADER_LEN 0x30 > > #define ZIMAGE32_MAGIC 0x016f2818 > > Is this documented anywhere ?
zImage (32) is entirely undocumented. What exists is from reverse engineering. I found this while doing some XTF work, and went right back to the source - the Linux maintainers. There are things which Xen does wrong with zImage handling. But I haven't had time to transcribe my notes into something more coherent and submit fixes. ~Andrew