diff options
author | Alek Du <alek.du@intel.com> | 2008-05-14 21:53:51 +0800 |
---|---|---|
committer | Patrick Tjin <pattjin@google.com> | 2014-07-21 20:22:36 -0700 |
commit | bb88522177746c4d357ec88686e602752cb7f00e (patch) | |
tree | 8466939ed49803d3ea19a355cd58c8811e25a6ac | |
parent | 0fdcecac19af4ea10163a2646cb4dc0897f89cde (diff) | |
download | bootstub-bb88522177746c4d357ec88686e602752cb7f00e.tar.gz |
* add initrd support
-rw-r--r-- | bootstub.c | 4 | ||||
-rw-r--r-- | head.S | 2 |
2 files changed, 4 insertions, 2 deletions
@@ -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) @@ -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 +-----------------------+ |