aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/segments.s
blob: 77e6502fed0722375a4a858782c22c07331e5aed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
global asm_reload_segments

section .text
align 4

asm_reload_segments:
    push 0x08
    lea rax, [rel .reload_cs]
    push rax
    retfq

; 0z10 is 16 bytes in decimal, so this should reload the segment correctly
.reload_cs:
    mov ax, 0x10
    mov ds, ax
    mov es, ax
    mov fs, ax
    mov gs, ax
    mov ss, ax
    ret