summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlek Du <alek.du@intel.com>2008-05-20 14:07:07 +0800
committerPatrick Tjin <pattjin@google.com>2014-07-21 20:22:36 -0700
commit6135ebb4d1a12902b2a74d6ed7f517bad8a694af (patch)
treef8bb692cfdc401570bff2549c770a68be90af2e7
parent853e56be92357d033e3559a271cc6f96095120d0 (diff)
downloadbootstub-6135ebb4d1a12902b2a74d6ed7f517bad8a694af.tar.gz
* fixing stuff according to Rob: 1. no memsize 2. main ==> bootstub
-rw-r--r--bootstub.c5
-rw-r--r--bootstub.h7
-rw-r--r--head.S10
3 files changed, 9 insertions, 13 deletions
diff --git a/bootstub.c b/bootstub.c
index 37a328e..0fae0b8 100644
--- a/bootstub.c
+++ b/bootstub.c
@@ -70,7 +70,7 @@ static void setup_boot_params(struct boot_params *bp, struct setup_header *sh)
bp->screen_info.orig_video_mode = 1;
bp->screen_info.orig_video_lines = 25;
bp->screen_info.orig_video_cols = 80;
- bp->alt_mem_k = (*(u32 *)MEMORY_SIZE_OFFSET)*1024;
+ bp->alt_mem_k = 128*1024; // hard coded 128M mem here, since SFI will update it
memcpy(&bp->hdr, sh, sizeof (struct setup_header));
bp->hdr.cmd_line_ptr = CMDLINE_OFFSET;
bp->hdr.cmdline_size = strnlen((const char *)CMDLINE_OFFSET,256);
@@ -91,7 +91,7 @@ static int get_32bit_entry(unsigned char *ptr)
return (((unsigned int)ptr+511)/512)*512;
}
-int main(void)
+int bootstub(void)
{
setup_idt();
setup_gdt();
@@ -99,4 +99,3 @@ int main(void)
(struct setup_header *)SETUP_HEADER_OFFSET);
return get_32bit_entry((unsigned char *)BZIMAGE_OFFSET);
}
-
diff --git a/bootstub.h b/bootstub.h
index 8ab0a75..2598a5c 100644
--- a/bootstub.h
+++ b/bootstub.h
@@ -5,11 +5,10 @@
#define _BOOT_STUB_HEAD
#define CMDLINE_OFFSET 0x100000
-#define MEMORY_SIZE_OFFSET 0x100100
-#define BZIMAGE_SIZE_OFFSET 0x100104
-#define INITRD_SIZE_OFFSET 0x100108
-#define BZIMAGE_OFFSET 0x102000
+#define BZIMAGE_SIZE_OFFSET 0x100100
+#define INITRD_SIZE_OFFSET 0x100104
#define STACK_OFFSET 0x101000
+#define BZIMAGE_OFFSET 0x102000
#define SETUP_HEADER_OFFSET (BZIMAGE_OFFSET + 0x1F1)
#define SETUP_HEADER_SIZE (0x0202 + *(unsigned char*)(0x0201+BZIMAGE_OFFSET))
diff --git a/head.S b/head.S
index e242d48..177a94a 100644
--- a/head.S
+++ b/head.S
@@ -18,12 +18,10 @@
* 0x101000 +-----------------------+
* | free space |
* | used as stack |
- * 0x10010c +-----------------------+
- * | initrd size | MIC need to fill it according to bzImage size
* 0x100108 +-----------------------+
- * | bzImage size | MIC need to fill it according to initrd size
+ * | initrd size | MIC need to fill it according to bzImage size
* 0x100104 +-----------------------+
- * | mem size | MIC need to fill it
+ * | bzImage size | MIC need to fill it according to initrd size
* 0x100100 +-----------------------+
* | kernel cmdline | MIC need to fill it
* 0x100000 +-----------------------+
@@ -41,10 +39,10 @@ _start:
cli
/* setup stack, because we are heading off to "C" */
movl $STACK_OFFSET, %esp
- /* after call main, GDT was set (0x10 and 0x18) IDT was clear
+ /* after call bootstub, GDT was set (0x10 and 0x18) IDT was clear
* eax will store 32bit entry of bzImage
*/
- calll main
+ calll bootstub
/* DS=ES=FS=GS=10 */
movl $__BOOT_DS, %ebx
movl %ebx, %ds