summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlek Du <alek.du@intel.com>2008-05-13 17:27:32 +0800
committerPatrick Tjin <pattjin@google.com>2014-07-21 20:22:36 -0700
commitfe0e8edbee4406cfd0c348bb98ee452ecc7ac4d3 (patch)
treead041b1c1cb26b5dabd198ede03df18928e43b61
parent2c4ebecb2259bd402293baa6751c0dde292a55fd (diff)
downloadbootstub-fe0e8edbee4406cfd0c348bb98ee452ecc7ac4d3.tar.gz
* Fill more setup_header items
-rw-r--r--bootstub.c3
-rw-r--r--bootstub.h9
-rw-r--r--head.S10
3 files changed, 17 insertions, 5 deletions
diff --git a/bootstub.c b/bootstub.c
index ad7bd7b..6f894d3 100644
--- a/bootstub.c
+++ b/bootstub.c
@@ -57,6 +57,9 @@ static void setup_boot_params(struct boot_params *bp, struct setup_header *sh)
memset(bp, 0, sizeof (struct boot_params));
memcpy(&bp->hdr, sh, sizeof (struct setup_header));
bp->hdr.cmd_line_ptr = CMDLINE_OFFSET;
+ bp->hdr.cmdline_size = *(u32*)CMDLINE_SIZE;
+ bp->hdr.ramdisk_size = *(u32*)INITRD_SIZE;
+ bp->hdr.ramdisk_image = *(u32*)INITRD_OFFSET + CMDLINE_OFFSET;
}
static int get_32bit_entry(unsigned char *ptr)
diff --git a/bootstub.h b/bootstub.h
index 5978379..0354b4f 100644
--- a/bootstub.h
+++ b/bootstub.h
@@ -4,9 +4,12 @@
#ifndef _BOOT_STUB_HEAD
#define _BOOT_STUB_HEAD
-#define CMDLINE_OFFSET 0x100000
-#define BZIMAGE_OFFSET 0x102000
-#define STACK_OFFSET 0x101000
+#define CMDLINE_OFFSET 0x100000
+#define CMDLINE_SIZE 0x100100
+#define INITRD_SIZE 0x100104
+#define INITRD_OFFSET 0x100108
+#define BZIMAGE_OFFSET 0x102000
+#define STACK_OFFSET 0x101000
#define SETUP_HEADER_OFFSET (BZIMAGE_OFFSET + 0x1F1)
#define SETUP_HEADER_SIZE (0x0202 + *(unsigned char*)(0x0201+BZIMAGE_OFFSET))
#define BOOT_PARAMS_OFFSET 0x8000
diff --git a/head.S b/head.S
index 7431584..1f6d730 100644
--- a/head.S
+++ b/head.S
@@ -17,9 +17,15 @@
* | boot stub |
* 0x101000 +-----------------------+
* | free space |
- * | used as stack |
+ * | used as stack | MIC need to pad this to 0
+ * 0x10010c +-----------------------+
+ * | initramfs offset| MIC need to fill it
+ * 0x100108 +-----------------------+
+ * | initramfs size | MIC need to fill it
+ * 0x100104 +-----------------------+
+ * | cmdline size | MIC need to fill it
* 0x100100 +-----------------------+
- * | kernel cmdline |
+ * | kernel cmdline | MIC need to fill it
* 0x100000 +-----------------------+
*/