This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
OS_Project/Part2/A4/08_shell/kernel/kernel.c

23 lines
478 B
C
Raw Normal View History

2023-09-11 18:28:11 +00:00
#include "../cpu/isr.h"
#include "../drivers/screen.h"
#include "kernel.h"
#include "../libc/string.h"
void _start() {
isr_install();
irq_install();
kprint("Type something, it will go through the kernel\n"
"Type END to halt the CPU\n> ");
}
void user_input(char *input) {
if (strcmp(input, "END") == 0) {
kprint("Stopping the CPU. Bye!\n");
asm volatile("hlt");
}
kprint("You said: ");
kprint(input);
kprint("\n> ");
}