From 1005a24c7f91b96a7e20346e040913c86b7eaae2 Mon Sep 17 00:00:00 2001 From: Ain <41307858+nero@users.noreply.github.com> Date: Sat, 23 Mar 2019 20:23:17 +0000 Subject: [PATCH] Split nbp up into startup code and main --- kernel/main.asm | 24 ++++++++++++++++++++++++ nbp.asm | 25 +------------------------ 2 files changed, 25 insertions(+), 24 deletions(-) create mode 100644 kernel/main.asm diff --git a/kernel/main.asm b/kernel/main.asm new file mode 100644 index 0000000..6d0b0e6 --- /dev/null +++ b/kernel/main.asm @@ -0,0 +1,24 @@ +main: + mov ax, cs + mov ds, ax + mov es, ax + + mov bx, 0x002E + mov dx, debug_reg_ir + + call ivt_set + + call heap_init + mov ax, 18 + call malloc + + ret + +%include "kernel/heap.asm" +%include "kernel/intr.asm" +%include "kernel/debug.asm" +%include "kernel/kprintf.asm" + +align 16 +heap: + dw 0 diff --git a/nbp.asm b/nbp.asm index 69eca89..5192e68 100644 --- a/nbp.asm +++ b/nbp.asm @@ -39,27 +39,4 @@ _exit: .message: db "Halted: Waiting for poweroff...", 0 -main: - mov ax, cs - mov ds, ax - mov es, ax - - mov bx, 0x002E - mov dx, debug_reg_ir - - call ivt_set - - call heap_init - mov ax, 18 - call malloc - - ret - -%include "kernel/heap.asm" -%include "kernel/intr.asm" -%include "kernel/debug.asm" -%include "kernel/kprintf.asm" - -align 16 -heap: - dw 0 +%include "kernel/main.asm"