summaryrefslogtreecommitdiff
path: root/kernel.asm
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2017-12-03 11:48:41 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2017-12-03 11:48:41 -0500
commit81f223e619ed3837253f2fad45367a33876c86e5 (patch)
tree68337b5dd706ec75814d0ceb64a106cfd8c6d348 /kernel.asm
parent0b726e795762abe2a909eca2300957329718ec2c (diff)
downloadminos-81f223e619ed3837253f2fad45367a33876c86e5.tar.gz
Fix stack underrun; Add disk info
Diffstat (limited to 'kernel.asm')
-rw-r--r--kernel.asm27
1 files changed, 19 insertions, 8 deletions
diff --git a/kernel.asm b/kernel.asm
index 3d6608b..a46a2e5 100644
--- a/kernel.asm
+++ b/kernel.asm
@@ -39,6 +39,7 @@ kmain:
call puts
add sp, 2
+ push word [drive0]
push sp
push ss
push sp
@@ -47,9 +48,19 @@ kmain:
push cs
push kmain
push cs
- push msg_test
+ push msg_entry_point
call printf
- add sp, 12
+ add sp, 20
+
+ mov cx, 0ffh - 80h
+ mov dx, 80h
+ .extloop:
+ push dx
+ call disk_info
+ add sp, 2
+ inc dx
+ dec cx
+ jne .extloop
.mainloop:
call terminal
@@ -79,18 +90,18 @@ panic:
; data
-msg_entry_point: db 'Loaded at ', 0
-msg_entry_point_stack: db 'Stack at ', 0
banner: db "+========================+", CR
db "| Welcome to MINOS 0.0.1 |", CR
db "+========================+", CR
db CR, 0
-msg_test: db 'Kernel address: %x:%x (%d:%d)', CR
- db 'Stack address : %x:%x (%d:%d)', CR, CR, 0
+msg_entry_point: db 'Kernel address: %x:%x (%d:%d)', CR
+ db 'Stack address : %x:%x (%d:%d)', CR
+ db 'Boot device : %x', CR, CR, 0
; Error messages
error_msg_panic: db "PANIC: ", 0
-times 512 * 20h db 0
-dw 0xefbe
+times (512 * 20h) - 2 db 0 ; Until we have a file system just reserve 32k of "free space"
+dw 0xefbe ; The "BEEF" signature is a visual "end of kernel"
+ ; It has no meaning...