Add Linux-resembling header at the begining of image,
so that it can be recognized and loaded by Xen ARM64 image loader,
and probably some other loaders too.

Signed-off-by: Sergiy Kibrik <[email protected]>
---
 arch/aarch64/preboot.S | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/aarch64/preboot.S b/arch/aarch64/preboot.S
index 5e265f6..b3dfcc2 100644
--- a/arch/aarch64/preboot.S
+++ b/arch/aarch64/preboot.S
@@ -11,6 +11,23 @@ target = . + 0x10000
 .text
 .align 16
 
+_head:
+       /* Image header expected by Linux boot-loaders */
+       b prestart              // jump to actual prestart
+       .long 0                 // reserved
+       .long 0x00080000        // image load offset
+       .long 0x00000000
+       .quad 0                 // unused
+       .quad 0                 // unused
+       .quad 0                 // reserved
+       .quad 0                 // reserved
+       .quad 0                 // reserved
+       .byte 0x41              // magic number, "ARM\x64"
+       .byte 0x52
+       .byte 0x4d
+       .byte 0x64
+       .word 0                 // reserved
+
 .globl prestart
 prestart: // x4 = 0x40080000 set by qemu bootloader
         mov     x5, x0     /* save device tree blob addr */
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to