Fixed a bug that caused the kernel image to lose it multiboot signature. Added code to test printing a string to the screen.

This commit is contained in:
2020-05-09 21:55:51 -05:00
parent ff96bef431
commit 695bd77751
6 changed files with 50 additions and 13 deletions
+3 -5
View File
@@ -1,25 +1,23 @@
global loader
align 4
MAGIC_NUMBER equ 0x1BADB002
FLAGS equ 0x0
CHECKSUM equ -MAGIC_NUMBER
KERNEL_STACK_SIZE equ 4096 ; size of stack in bytes
KERNEL_STACK_SIZE equ 4096 ; size of stack in bytes
section .text:
align 4
dd MAGIC_NUMBER
dd FLAGS
dd CHECKSUM
loader:
mov esp, kernel_stack; + KERNEL_STACK_SIZE ; ont ESP to the start of the stack (end of memory area)
extern kmain
call kmain
;mov eax, 0xCAFEBABE
;mov esp, kernel_stack + KERNEL_STACK_SIZE ; piont ESP to the start of the stack (end of memory area)
.loop:
jmp .loop
section .bss
alignb 4
resb KERNEL_STACK_SIZE ; reserve stack for kernel
kernel_stack: