aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/boot/entry64.s
blob: c5df5db3a6d2c30f4014d7bbceab5075801e47f6 (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
27
28
29
30
31
.section .boot_text, "ax", @progbits
.code64

.global _entry64
_entry64:
    mov $global_descriptor_table_data, %rax
    mov %rax, %ss
    mov %rax, %ds
    mov %rax, %es
    mov %rax, %fs
    mov %rax, %gs

    call invoke_global_constructors
    
    xor %rax, %rax
    mov %rax, %rbp
    mov %rax, %rdx
    mov %rax, %rsi

    mov $stack_size, %rcx
    shr $3, %rcx
    lea (stack_bottom), %rdi
    rep stosq

    mov %rax, %rdi

    call main

1:
    hlt
    jmp 1b