diff options
Diffstat (limited to 'os/shell')
| -rw-r--r-- | os/shell/shell.c | 23 | ||||
| -rw-r--r-- | os/shell/shell.h | 3 |
2 files changed, 26 insertions, 0 deletions
diff --git a/os/shell/shell.c b/os/shell/shell.c new file mode 100644 index 0000000..933b19c --- /dev/null +++ b/os/shell/shell.c @@ -0,0 +1,23 @@ +#include "../../os/main.h" +#include "../../kernel/gpu/text_mode/display.h" + +void keypress_handler(unsigned char key) { + switch(key) + { + case '\b': + scrn_backspace(); + break; + case '\n': + scrn_newline(); + break; + default: + scrn_putchar(key); + } +} + +Program_t shell_run() { + Program_t this; + this.keypress_handler = keypress_handler; + this.name = "shell"; + return this; +}
\ No newline at end of file diff --git a/os/shell/shell.h b/os/shell/shell.h new file mode 100644 index 0000000..2a8f508 --- /dev/null +++ b/os/shell/shell.h @@ -0,0 +1,3 @@ +#include "../../os/main.h" + +Program_t shell_run();
\ No newline at end of file |