|
@@ -28,6 +28,7 @@
|
|
#include <asm/segment.h>
|
|
#include <asm/segment.h>
|
|
#include <asm/pgtable.h>
|
|
#include <asm/pgtable.h>
|
|
#include <asm/page.h>
|
|
#include <asm/page.h>
|
|
|
|
+#include <asm/boot.h>
|
|
#include <asm/msr.h>
|
|
#include <asm/msr.h>
|
|
#include <asm/asm-offsets.h>
|
|
#include <asm/asm-offsets.h>
|
|
|
|
|
|
@@ -62,7 +63,7 @@ startup_32:
|
|
subl $1b, %ebp
|
|
subl $1b, %ebp
|
|
|
|
|
|
/* setup a stack and make sure cpu supports long mode. */
|
|
/* setup a stack and make sure cpu supports long mode. */
|
|
- movl $user_stack_end, %eax
|
|
|
|
|
|
+ movl $boot_stack_end, %eax
|
|
addl %ebp, %eax
|
|
addl %ebp, %eax
|
|
movl %eax, %esp
|
|
movl %eax, %esp
|
|
|
|
|
|
@@ -274,7 +275,7 @@ relocated:
|
|
stosb
|
|
stosb
|
|
|
|
|
|
/* Setup the stack */
|
|
/* Setup the stack */
|
|
- leaq user_stack_end(%rip), %rsp
|
|
|
|
|
|
+ leaq boot_stack_end(%rip), %rsp
|
|
|
|
|
|
/* zero EFLAGS after setting rsp */
|
|
/* zero EFLAGS after setting rsp */
|
|
pushq $0
|
|
pushq $0
|
|
@@ -285,7 +286,7 @@ relocated:
|
|
*/
|
|
*/
|
|
pushq %rsi # Save the real mode argument
|
|
pushq %rsi # Save the real mode argument
|
|
movq %rsi, %rdi # real mode address
|
|
movq %rsi, %rdi # real mode address
|
|
- leaq _heap(%rip), %rsi # _heap
|
|
|
|
|
|
+ leaq boot_heap(%rip), %rsi # malloc area for uncompression
|
|
leaq input_data(%rip), %rdx # input_data
|
|
leaq input_data(%rip), %rdx # input_data
|
|
movl input_len(%rip), %eax
|
|
movl input_len(%rip), %eax
|
|
movq %rax, %rcx # input_len
|
|
movq %rax, %rcx # input_len
|
|
@@ -310,9 +311,12 @@ gdt:
|
|
.quad 0x0080890000000000 /* TS descriptor */
|
|
.quad 0x0080890000000000 /* TS descriptor */
|
|
.quad 0x0000000000000000 /* TS continued */
|
|
.quad 0x0000000000000000 /* TS continued */
|
|
gdt_end:
|
|
gdt_end:
|
|
- .bss
|
|
|
|
-/* Stack for uncompression */
|
|
|
|
- .balign 4
|
|
|
|
-user_stack:
|
|
|
|
- .fill 4096,4,0
|
|
|
|
-user_stack_end:
|
|
|
|
|
|
+
|
|
|
|
+.bss
|
|
|
|
+/* Stack and heap for uncompression */
|
|
|
|
+.balign 4
|
|
|
|
+boot_heap:
|
|
|
|
+ .fill BOOT_HEAP_SIZE, 1, 0
|
|
|
|
+boot_stack:
|
|
|
|
+ .fill BOOT_STACK_SIZE, 1, 0
|
|
|
|
+boot_stack_end:
|