From a0086b3107b923df4ffe50f481705f87c2cd739c Mon Sep 17 00:00:00 2001 From: Axel Hanikel Date: Sat, 21 Oct 2017 00:50:34 +0200 Subject: [PATCH] Avoid the busy waiting by calling hlt after each interrupt. --- kernel.asm | 2 ++ kernel.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel.asm b/kernel.asm index 1c2fee7..5a69a61 100644 --- a/kernel.asm +++ b/kernel.asm @@ -44,7 +44,9 @@ start: cli ;block interrupts mov esp, stack_space call kmain +forever: hlt ;halt the CPU + jmp forever section .bss resb 8192; 8KB for stack diff --git a/kernel.c b/kernel.c index 3435fc9..cab094d 100644 --- a/kernel.c +++ b/kernel.c @@ -158,6 +158,4 @@ void kmain(void) idt_init(); kb_init(); - - while(1); }