Newer
Older
tree-os / src / multiboot / boot.asm
section .multiboot
header_start:
    dd 0xe85250d6                ; magic number
    dd 0                         ; protected mode code
    dd .end - header_start

    dd 0x100000000 - (0xe85250d6 + 0 + (.end - header_start))

    dw 0
    dw 0
    dd 8
.end:

extern kernelMain

KERNEL_STACK_SIZE equ 4096  ; 4kb of stack
global _start
section .text
_start:
    ; setup stack for kernel main function
    mov esp, stack + KERNEL_STACK_SIZE
    ; call main function
    call kernelMain
.loop:
    jmp .loop

section .bss
align 4
stack:
    resb KERNEL_STACK_SIZE