Newer
Older
tree-os / src / multiboot / boot.asm
@lukas lukas on 2 Apr 2021 465 bytes add basic tasking
global loader
MAGIC_NUMBER equ 0x1BADB002 ; 1 bad boot
FLAGS        equ 0x0
CHECKSUM     equ -MAGIC_NUMBER
section .text
align 4
    dd MAGIC_NUMBER
    dd FLAGS
    dd CHECKSUM
extern kernelMain

KERNEL_STACK_SIZE equ 4096  ; 4kb of stack
global _start
_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