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:
+3
-5
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user