.code32 .extern gdt_ptr .global _gdt_switch _gdt_switch: lgdt gdt_ptr movw $0x10,%ax movw %ax,%ds movw %ax,%es movw %ax,%fs movw %ax,%gs ljmp $0x8, $_gdt_switch_continue _gdt_switch_continue: movw $0x2a, %ax // 0x28 + 0x03 = 0x2a ltr %ax ret