aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/boot/init/boot.s19
-rw-r--r--kernel/kernel/kernel.c2
2 files changed, 2 insertions, 19 deletions
diff --git a/kernel/boot/init/boot.s b/kernel/boot/init/boot.s
index d2000a3..32ebe8f 100644
--- a/kernel/boot/init/boot.s
+++ b/kernel/boot/init/boot.s
@@ -111,25 +111,6 @@ _start:
*/
call kernel_main
- /*
- If the system has nothing more to do, put the computer into an
- infinite loop. To do that:
- 1) Disable interrupts with cli (clear interrupt enable in eflags).
- They are already disabled by the bootloader, so this is not needed.
- Mind that you might later enable interrupts and return from
- kernel_main (which is sort of nonsensical to do).
- 2) Wait for the next interrupt to arrive with hlt (halt instruction).
- Since they are disabled, this will lock up the computer.
- 3) Jump to the hlt instruction if it ever wakes up due to a
- non-maskable interrupt occurring or due to system management mode.
- */
- cli
- jmp quit
-
-quit:
- hlt
- jmp quit
-
/*
Set the size of the _start symbol to the current location '.' minus its start.
This is useful when debugging or when you implement call tracing.
diff --git a/kernel/kernel/kernel.c b/kernel/kernel/kernel.c
index dbe0c8b..52e9b6e 100644
--- a/kernel/kernel/kernel.c
+++ b/kernel/kernel/kernel.c
@@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <kernel/halt.h>
#include <libk/io.h>
#include <drivers/serial.h>
@@ -28,4 +29,5 @@ kernel_main(void)
serial_initialize();
printk("kernel_main", "Started.");
+ halt();
}