swissChili | d813792 | 2021-02-17 15:34:07 -0800 | [diff] [blame] | 1 | [bits 32] |
2 | [global gdt_flush] | ||||
3 | |||||
4 | gdt_flush: | ||||
5 | mov eax, [esp + 4] | ||||
6 | lgdt [eax] ; Load GDT | ||||
7 | |||||
8 | mov ax, 0x10 ; Offset of data segment | ||||
9 | mov ds, ax, | ||||
10 | mov es, ax | ||||
11 | mov fs, ax | ||||
12 | mov gs, ax | ||||
13 | mov ss, ax | ||||
14 | |||||
15 | jmp 0x08:.flush ; Implicitly reloads the code segment | ||||
16 | .flush: | ||||
17 | ret |