diff --git a/kernel/main.asm b/kernel/main.asm index 6d0b0e6..bf2a86d 100644 --- a/kernel/main.asm +++ b/kernel/main.asm @@ -12,7 +12,11 @@ main: mov ax, 18 call malloc - ret + int 0x2E + +.endloop: + hlt + jmp .endloop %include "kernel/heap.asm" %include "kernel/intr.asm" diff --git a/nbp.asm b/nbp.asm index ff97f54..d158a31 100644 --- a/nbp.asm +++ b/nbp.asm @@ -7,8 +7,12 @@ org 0x0000 ; during PXE, CS=0000 and IP=7C00 _startup: xor ax, ax - mov ss, ax - mov sp, 0x0000 + + push cx ; byte counter + push si ; source offset + push di ; destination offset + push es ; destination segment + mov ds, ax mov es, ax @@ -16,16 +20,13 @@ _startup: mov di, 0x0500 mov cx, (_reloc_end) rep movsb - jmp 0x0050:main -_exit: - mov si, .message - call kprintf -.loop: - hlt - jmp .loop -.message: - db "Halted: Waiting for poweroff...", 0 + pop es + pop di + pop si + pop cx + + jmp 0x0050:main %include "kernel/main.asm"