From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: [PATCH v2] xen/arm: build as zImage Date: Fri, 23 Nov 2012 18:58:43 +0000 Message-ID: <20121123185843.GD97222@ocelot.phlegethon.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: Anthony Perard , xen-devel@lists.xensource.com, Ian Campbell List-Id: xen-devel@lists.xenproject.org At 18:04 +0000 on 23 Nov (1353693893), Stefano Stabellini wrote: > The zImage format is extremely simple: it only consists of a magic > number and 2 addresses in a specific position (see > http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309). > > Some bootloaders expect a zImage; considering that it doesn't cost us > much to build Xen compatible with the format, make it so. > > Changes in v2: > - code style; > - pass 0 a start address. > > Signed-off-by: Stefano Stabellini > > diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S > index 25c4cfe..347ddcf 100644 > --- a/xen/arch/arm/head.S > +++ b/xen/arch/arm/head.S > @@ -22,6 +22,8 @@ > #include > #include > > +#define ZIMAGE_MAGIC_NUMBER 0x016f2818 > + > #define PT_PT 0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */ > #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */ > #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */ > @@ -52,6 +54,18 @@ > * or the initial pagetable code below will need adjustment. */ > .global start > start: > + > + /* zImage magic header, see: > + * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309 > + */ > + .skip 0x20 > + b past_zImage Surely branch _before_ the padding? > + .word ZIMAGE_MAGIC_NUMBER /* Magic numbers to help the loader */ > + .word 0x00000000 /* absolute load/run zImage address or > + * 0 for PiC */ > + .word _end /* zImage end address */ Not (_end - _start)? Tim.