.code32

.extern gdtr 
.global load_gdt
load_gdt:
    lgdt gdtr 
    ljmpl $0x08, $reload_segments
reload_segments:
    mov $0x10, %ax
    mov %ax, %ds 
    mov %ax, %es
    mov %ax, %fs 
    mov %ax, %gs 
    mov %ax, %ss 
    ret 

.global tss_flush
tss_flush:
    mov $0x28, %ax
    ltr %ax
    ret