# Long mode code
.code64
boot64:
# Set up segment registers
movw $0x10, %ax
movw %ax, %ds
movw %ax, %es
movw %ax, %fs
movw %ax, %gs
movw %ax, %ss
# Add 1MB to total memory
addq $0x100000, (0x7000)
# Map memory
call memory_init
# Load kernel
movq $kernel_path, %rdi
call elf_load
# Set stack
movq $0xFFFFFFC000000000, %rsp
# Jump to kernel!
jmp *%rax
kernel_path: .string "/boot/kernel.elf"