elfboot: initial version

This commit is contained in:
Taku Shimosawa
2011-09-22 18:56:55 +09:00
commit 1b054d6e1e
7 changed files with 225 additions and 0 deletions

23
elfboot/head.S Normal file
View File

@@ -0,0 +1,23 @@
.text
.globl _start
_start:
leaq _stack_end(%rip), %rsp
/* preserve arguments */
pushq %rdi
pushq %rsi
pushq %rdx
pushq %rcx
leaq _stack_end(%rip), %rdi
call elfboot_main
andq %rax, %rax
jz 1f
popq %rcx
popq %rdx
popq %rsi
popq %rdi
jmpq *%rax
1:
cli
hlt
jmp 1b