diff --git a/include/system.h b/include/system.h index f564faf..a47ff83 100644 --- a/include/system.h +++ b/include/system.h @@ -10,6 +10,7 @@ extern int strlen(const char *str); extern unsigned char inportb (unsigned short _port); extern void outportb (unsigned short _port, unsigned char _data); extern bool strcmp(char* str1, char* str2); +extern void idle(); /* ISRS.C */ void isrs_install(); /* This defines what the stack looks like after an ISR was running */ diff --git a/src/main.c b/src/main.c index 1c0c2e0..59c4548 100644 --- a/src/main.c +++ b/src/main.c @@ -114,4 +114,9 @@ void main() /* ...and leave this loop in. There is an endless loop in * 'start.asm' also, if you accidentally delete this next line */ for (;;); +} + +void idle() +{ + __asm__ __volatile__ ("hlt"); } \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 447e768..4ff974d 100644 --- a/src/shell.c +++ b/src/shell.c @@ -9,7 +9,7 @@ void run_shell() puts("Starting interactive shell...\n"); commandbuffer[0] = '\0'; puts("#>"); - for(;;); + for(;;) idle(); } void key_pressed(unsigned char* character)