kernel.c 490 B

1234567891011121314151617181920212223
  1. #include "../cpu/isr.h"
  2. #include "../drivers/screen.h"
  3. #include "kernel.h"
  4. void main() {
  5. isr_install();
  6. irq_install();
  7. kprint("Type something, it will go through the kernel\n"
  8. "Type END to halt the CPU\n> ");
  9. // Do we need an infinite loop here?
  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. }