diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2025-01-01 08:26:16 -0500 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-01-01 08:26:16 -0500 |
commit | 54b3a60e84a6f4e2e664a75ba2782fada0967d58 (patch) | |
tree | 34d122dcbe575fd4cd2a8f016cf135bca44ee69e | |
parent | 9f5c5bc6cb88913af96da62f30cdb070f2c30df5 (diff) |
kernel: Disable halting from boot.s
Kernel now halts by itself.
-rw-r--r-- | kernel/boot/init/boot.s | 19 | ||||
-rw-r--r-- | kernel/kernel/kernel.c | 2 |
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(); } |