; Multiboot header
ALIGNED_4K equ 1<<0
MEM_INFO   equ 1<<1
FLAGS      equ ALIGNED_4K | MEM_INFO
MAGIC      equ 0x1BADB002
CHECKSUM   equ -(MAGIC + FLAGS)

section .multiboot
align 4
    dd MAGIC
    dd FLAGS
    dd CHECKSUM

section .bss
align 16
stack_bottom:
    resb 16384 ; 16 KiB for stack
stack_top:

section .text
global _start:function (_start.end - _start)
_start:
    mov esp, stack_top
    extern kernel_main
    call kernel_main
    cli
.hang:  hlt
    jmp .hang
_start.end: