aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86_64/boot/boot64.S
blob: 848256fbc8622c5ea816c9d56deceb6a4b667a02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.code64

.set KERNEL_VMA, 0xffffffff80000000
.set GDT_KERNEL_CS, 0x10

.section .boot64.text, "a"

.global begin_long_mode
begin_long_mode:
	mov $GDT_KERNEL_CS, %ax
	mov %ax, %ds
	mov %ax, %es
	mov %ax, %ss
	mov %ax, %fs
	mov %ax, %gs

	add $KERNEL_VMA, %rsp
	movabs $jump_main, %rax
	jmp *%rax

.section .text
jump_main:
	popq %rdi
	popq %rsi
	call kernel_main
	hlt