reimplmenets the previous iteration with a brand new custom build system
This commit is contained in:
30
kernel/arch/boot.s
Normal file
30
kernel/arch/boot.s
Normal 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
|
Reference in New Issue
Block a user