2 * i386 boot code, based on qemu-bmibug.
4 * Copyright 2019 Doug Gale
5 * Copyright 2019 Linaro
7 * This work is licensed under the terms of the GNU GPL, version 3 or later.
8 * See the COPYING file in the top-level directory.
10 * SPDX-License-Identifier: GPL-3.0-or-later
15 /* Multi-boot header */
19 .int -(0x10000+0x1BADB002)
38 /* Kernel Entry Point */
55 // Fixup the IDT to the ridiculous i386 layout
58 mov idt_00(,%ebx,8),%eax
60 movw $0x8,idt_00+2(,%ebx,8)
61 movw $0x8E00,idt_00+4(,%ebx,8)
62 movw %ax,idt_00+6(,%ebx,8)
69 push $((32 * 8 - 1) << 16)
74 * Don't worry about stack frame, assume everthing
75 * is garbage when we return, we won't need it.
79 _exit: /* output any non-zero result in eax to isa-debug-exit device */
84 1: /* QEMU ACPI poweroff */
95 /* Output a single character to serial port */
106 /* Interrupt Descriptor Table */
117 idt_06: .int 0, 0 /* intr_6_opcode, Invalid Opcode */
147 .short gdt_en - gdt - 1