FENIX_kernel/arch/i386/gdt_load.S

33 lines
409 B
ArmAsm
Raw Normal View History

2020-12-02 02:59:57 +00:00
.globl set_gdt
.type set_gdt,%function
gdtr:
.word 0
.int 0
set_gdt:
2020-12-18 18:38:32 +00:00
.func set_gdt
2021-01-10 20:42:29 +00:00
cli
xor %eax, %eax
2020-12-02 02:59:57 +00:00
mov 4(%esp), %eax
2020-12-18 18:38:32 +00:00
mov %eax, gdtr+2
2020-12-02 02:59:57 +00:00
mov 8(%esp), %ax
2020-12-18 18:38:32 +00:00
mov %ax, gdtr
2021-01-10 20:42:29 +00:00
lgdt (gdtr)
2020-12-02 02:59:57 +00:00
ret
2020-12-18 18:38:32 +00:00
.endfunc
2020-12-02 02:59:57 +00:00
.globl reload_segments
.type reload_segments,%function
reload_segments:
2020-12-18 18:38:32 +00:00
.func reload_segments
2020-12-02 02:59:57 +00:00
mov 0x10, %ax
mov %ax, %ds
mov %ax, %es
mov %ax, %fs
mov %ax, %gs
mov %ax, %ss
ret
2020-12-18 18:38:32 +00:00
.endfunc