base: store initial ax and di registers in crt0.s

The values are used by a follow up commit by nova to get the boot CPU number.

Issue #814
This commit is contained in:
Alexander Boettcher 2013-07-10 14:34:20 +02:00 committed by Norman Feske
parent fdaeda47bb
commit 0079179f05
2 changed files with 18 additions and 2 deletions

View File

@ -17,6 +17,8 @@
_start:
mov %esp, __initial_sp
mov %eax, __initial_ax
mov %edi, __initial_di
/* XXX Switch to our own stack. */
leal _stack_high, %esp
@ -52,6 +54,10 @@ _stack_low:
.global _stack_high
_stack_high:
/* initial value of the ESP register */
/* initial value of the ESP, EAX and EDI register */
.globl __initial_sp
.globl __initial_ax
.globl __initial_di
__initial_sp: .space 4
__initial_ax: .space 4
__initial_di: .space 4

View File

@ -17,6 +17,12 @@
_start:
movq __initial_ax@GOTPCREL(%rip), %rbx
movq %rax, (%rbx)
movq __initial_di@GOTPCREL(%rip), %rbx
movq %rdi, (%rbx)
movq __initial_sp@GOTPCREL(%rip), %rax
movq %rsp, (%rax)
@ -55,6 +61,10 @@ _stack_low:
.global _stack_high
_stack_high:
/* initial value of the RSP register */
/* initial value of the RSP, RAX and RDI register */
.globl __initial_sp
.globl __initial_ax
.globl __initial_di
__initial_sp: .space 8
__initial_ax: .space 8
__initial_di: .space 8