/* * Copyright (c) 2026, Apollo Telephone Laboratories. * Provided under the BSD-3 clause. */ .text .code16 .globl _start _start: cli xor %ax, %ax mov %ax, %ds mov %ax, %es mov %ax, %ss lgdt gdtr mov %cr0, %eax or $1, %eax mov %eax, %cr0 ljmp $0x08,$1f .code32 1: mov $0x10, %ax mov %ax, %es mov %ax, %ss mov %ax, %fs mov %ax, %gs mov %ax, %ds jmp c_thunk gdt: .null: .quad 0 .code: .word 0xFFFF .word 0x0000 .byte 0x00 .byte 0b10011010 .byte 0b11001111 .byte 0x00 .data: .word 0xFFFF .word 0x0000 .byte 0x00 .byte 0b10010010 .byte 0b11001111 .byte 0x00 gdtr: .word . - gdt - 1 .long gdt /* Fall-through : everything above this */ c_thunk: nop