reimplmenets the previous iteration with a brand new custom build system

This commit is contained in:
2025-05-29 10:00:38 -04:00
commit e4f160e8b6
35 changed files with 1060 additions and 0 deletions

30
kernel/arch/boot.s Normal file
View File

@ -0,0 +1,30 @@
global loader ; entry symbol for ELF
extern kmain
MAGIC_NUMBER equ 0x1BADB002 ; magic number constant
FLAGS equ 0x3
CHECKSUM equ -(MAGIC_NUMBER + FLAGS) ; calculate the checksum
KERNEL_STACK_SIZE equ 4096
section .multiboot
align 4 ; code must be 4 byte aligned
dd MAGIC_NUMBER
dd FLAGS
dd CHECKSUM
section .bss
align 4
kernel_stack:
resb KERNEL_STACK_SIZE
section .text
loader:
mov esp, kernel_stack + KERNEL_STACK_SIZE
;mov eax, 0xCAFEBABE
call kmain
cli
loop: hlt
jmp loop