summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlek Du <alek.du@intel.com>2008-05-14 21:53:51 +0800
committerPatrick Tjin <pattjin@google.com>2014-07-21 20:22:36 -0700
commitbb88522177746c4d357ec88686e602752cb7f00e (patch)
tree8466939ed49803d3ea19a355cd58c8811e25a6ac
parent0fdcecac19af4ea10163a2646cb4dc0897f89cde (diff)
downloadbootstub-bb88522177746c4d357ec88686e602752cb7f00e.tar.gz
* add initrd support
-rw-r--r--bootstub.c4
-rw-r--r--head.S2
2 files changed, 4 insertions, 2 deletions
diff --git a/bootstub.c b/bootstub.c
index f028c6d..a24939b 100644
--- a/bootstub.c
+++ b/bootstub.c
@@ -75,7 +75,9 @@ static void setup_boot_params(struct boot_params *bp, struct setup_header *sh)
bp->hdr.cmd_line_ptr = CMDLINE_OFFSET;
bp->hdr.cmdline_size = strnlen((const char *)CMDLINE_OFFSET,256);
bp->hdr.ramdisk_size = *(u32 *)INITRD_SIZE_OFFSET;
- bp->hdr.ramdisk_image = BZIMAGE_OFFSET + *(u32 *)BZIMAGE_SIZE_OFFSET + *(u32 *)INITRD_SIZE_OFFSET;
+ bp->hdr.ramdisk_image = (bp->alt_mem_k*1024 - bp->hdr.ramdisk_size) & ~(0x0f);
+ memcpy((u8*)bp->hdr.ramdisk_image, (u8 *)BZIMAGE_OFFSET + *(u32 *)BZIMAGE_SIZE_OFFSET + *(u32 *)INITRD_SIZE_OFFSET,
+ bp->hdr.ramdisk_size);
}
static int get_32bit_entry(unsigned char *ptr)
diff --git a/head.S b/head.S
index 0dab98d..e242d48 100644
--- a/head.S
+++ b/head.S
@@ -10,7 +10,7 @@
/* When bootstub get control, the memory map in DRAM is like:
* ~ ~
- * 0x102000 | initrd | initrd will move to high memory otherwise
+ * 0x102000 | initrd | initrd will move to highest memory otherwise
*+bzImage size +-----------------------+ bzImage uncompressing will destory it
* | bzImage |
* 0x102000 +-----------------------+