[bzImage] Support loading zImage kernels
authorStefan Hajnoczi <stefanha@gmail.com>
Mon, 30 Jun 2008 18:51:41 +0000 (19:51 +0100)
committerMichael Brown <mcb30@etherboot.org>
Mon, 30 Jun 2008 18:51:41 +0000 (19:51 +0100)
zImage kernels require the real-mode portion to be loaded at 9000:0000
rather than 1000:0000.

src/arch/i386/image/bzimage.c

index 38443f5..9372f55 100644 (file)
@@ -414,7 +414,9 @@ static int bzimage_load_header ( struct image *image,
        }
 
        /* Calculate load address and size of real-mode portion */
-       load_ctx->rm_kernel_seg = 0x1000; /* place RM kernel at 1000:0000 */
+       load_ctx->rm_kernel_seg = ( ( bzhdr->loadflags & BZI_LOAD_HIGH ) ?
+                                   0x1000 :  /* 1000:0000 (bzImage) */
+                                   0x9000 ); /* 9000:0000 (zImage) */
        load_ctx->rm_kernel = real_to_user ( load_ctx->rm_kernel_seg, 0 );
        load_ctx->rm_filesz =
                ( ( bzhdr->setup_sects ? bzhdr->setup_sects : 4 ) + 1 ) << 9;