kernel.c 476 B

12345678910111213141516171819202122
  1. #include "../cpu/isr.h"
  2. #include "../drivers/screen.h"
  3. #include "kernel.h"
  4. #include "../libc/string.h"
  5. void main() {
  6. isr_install();
  7. irq_install();
  8. kprint("Type something, it will go through the kernel\n"
  9. "Type END to halt the CPU\n> ");
  10. }
  11. void user_input(char *input) {
  12. if (strcmp(input, "END") == 0) {
  13. kprint("Stopping the CPU. Bye!\n");
  14. asm volatile("hlt");
  15. }
  16. kprint("You said: ");
  17. kprint(input);
  18. kprint("\n> ");
  19. }