summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlek Du <alek.du@intel.com>2008-05-14 13:29:27 +0800
committerPatrick Tjin <pattjin@google.com>2014-07-21 20:22:36 -0700
commitfff91f519f4a88db5f8fa22b262644c58a9240bb (patch)
tree93add72f396280fcc19ba5da2421c076d6500be2
parentfe0e8edbee4406cfd0c348bb98ee452ecc7ac4d3 (diff)
downloadbootstub-fff91f519f4a88db5f8fa22b262644c58a9240bb.tar.gz
* fix some bugs
-rw-r--r--bootstub.c4
-rw-r--r--head.S14
2 files changed, 11 insertions, 7 deletions
diff --git a/bootstub.c b/bootstub.c
index 6f894d3..27fe646 100644
--- a/bootstub.c
+++ b/bootstub.c
@@ -75,10 +75,14 @@ static int get_32bit_entry(unsigned char *ptr)
int main(void)
{
+ *(char*)0xb8000='A';
setup_idt();
+ *(char*)0xb8000='B';
setup_gdt();
+ *(char*)0xb8000='C';
setup_boot_params((struct boot_params *)BOOT_PARAMS_OFFSET,
(struct setup_header*)SETUP_HEADER_OFFSET);
+ *(char*)0xb8000='D';
return get_32bit_entry((unsigned char *)BZIMAGE_OFFSET);
}
diff --git a/head.S b/head.S
index 1f6d730..a66768c 100644
--- a/head.S
+++ b/head.S
@@ -39,19 +39,19 @@
_start:
cld
cli
- /* DS=ES=FS=GS=10 */
- movl 0x2, %eax
- movl %eax, %ds
- movl %eax, %es
- movl %eax, %fs
- movl %eax, %gs
- movl %eax, %ss
/* 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
* eax will store 32bit entry of bzImage
*/
calll main
+ /* DS=ES=FS=GS=10 */
+ movl $__BOOT_DS, %ebx
+ movl %ebx, %ds
+ movl %ebx, %es
+ movl %ebx, %fs
+ movl %ebx, %gs
+ movl %ebx, %ss
ljmp $__BOOT_CS,$1f
1:
/* tell kernel where is boot_param */