diff options
| author | James Barnett <noreply@jamesbarnett.xyz> | 2019-05-26 19:28:27 +0100 |
|---|---|---|
| committer | James Barnett <noreply@jamesbarnett.xyz> | 2019-05-26 19:28:27 +0100 |
| commit | bd77381c27ef5b61bf1c123efef3895b98a7a615 (patch) | |
| tree | ba798b442305ad4e174d79cf5bb7a822b7e1e2e9 /os/main.c | |
| parent | eb4de24523e8f0832daae89a083844c8e9a261e9 (diff) | |
| download | tinyOS-bd77381c27ef5b61bf1c123efef3895b98a7a615.tar.xz tinyOS-bd77381c27ef5b61bf1c123efef3895b98a7a615.zip | |
Proxy keypress from kernel to focused program
Diffstat (limited to 'os/main.c')
| -rw-r--r-- | os/main.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/os/main.c b/os/main.c new file mode 100644 index 0000000..905b0f7 --- /dev/null +++ b/os/main.c @@ -0,0 +1,42 @@ +#include "../kernel/gpu/text_mode/display.h" +#include "../kernel/gpu/text_mode/colours.h" +#include "main.h" +#include "./shell/shell.h" + +Program_t focused_program; + +void os_show_splash() +{ + scrn_enable_cursor(10, 12); + scrn_clear(); + scrn_set_text_colour(COLOUR_LIGHT_GREEN, COLOUR_BLACK); + + scrn_println(" _ _ ____ _____ "); + scrn_println(" | | (_) / __ \\ / ____|"); + scrn_println(" | |_ _ _ __ _ _| | | | (___ "); + scrn_println(" | __| | '_ \\| | | | | | |\\___ \\ "); + scrn_println(" | |_| | | | | |_| | |__| |____) |"); + scrn_println(" \\__|_|_| |_|\\__, |\\____/|_____/ "); + scrn_println(" __/ | "); + scrn_println(" |___/ "); + + scrn_set_text_colour(COLOUR_WHITE, COLOUR_BLACK); + scrn_newline(); +} + +void os_start() +{ + os_show_splash(); +} + +// TODO keep a stack of running programs +void os_update_focused_program(Program_t program) { + focused_program = shell_run(); +} + +// Send keypress from kernel to the currently focused programs keypress handler +void os_proxy_keypress(unsigned char key) { + (focused_program.keypress_handler)(key); +} + +// TODO display handling
\ No newline at end of file |