summaryrefslogtreecommitdiff
path: root/kernel/src/boot/boot64.S
blob: e95f55b1541be435219ff12d133619dc5e44683b (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

.section .boot64.text, "a"

.global begin_long_mode
begin_long_mode:
//	xchgw %bx, %bx
//	mov $0x10, %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