From b9d186cc2fe85c27a632a639e8d56e1ff765aec8 Mon Sep 17 00:00:00 2001 From: Aren Elchinyan Date: Thu, 28 Dec 2023 23:57:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/version.h | 2 +- kernel/start.c | 10 +++++++++- modules/modules.json | 7 +++++++ modules/ps2/main.c | 7 +++---- 4 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 modules/modules.json diff --git a/include/version.h b/include/version.h index 15713d0..78e5b27 100644 --- a/include/version.h +++ b/include/version.h @@ -1,3 +1,3 @@ #define VERSION_MAJOR 0 #define VERSION_MINOR 1 -#define VERSION_BUILD 897 +#define VERSION_BUILD 899 diff --git a/kernel/start.c b/kernel/start.c index f8a6755..18d9b43 100644 --- a/kernel/start.c +++ b/kernel/start.c @@ -15,6 +15,8 @@ #include #include +char (*getc)( ); + // Точка входа void _start( ) { asm volatile("cli"); @@ -42,13 +44,19 @@ void _start( ) { if (mod == NULL) { fb_set_text_color(0xFF0000); fb_printf("\tТребуется модуль ps2.ko!\n"); + getc = NULL; } else { fb_printf("\nОбнаружен модуль клавиатуры: %s\n", mod->name); + getc = mod->get_func(1); } fb_set_text_color(0x00D000); asm volatile("sti"); - for (;;) { asm volatile("hlt"); } + for (;;) { + asm volatile("hlt"); + + if (getc) { fb_printf("%c", getc( )); } + } } \ No newline at end of file diff --git a/modules/modules.json b/modules/modules.json new file mode 100644 index 0000000..1e16afc --- /dev/null +++ b/modules/modules.json @@ -0,0 +1,7 @@ +[ + { + "info": "Официальный репозиторий модулей", + "git": "https://git.synapseos.ru/Aren/BMOSP_repo.git", + "list": [] + } +] \ No newline at end of file diff --git a/modules/ps2/main.c b/modules/ps2/main.c index 00296ce..1fa42d1 100644 --- a/modules/ps2/main.c +++ b/modules/ps2/main.c @@ -86,7 +86,7 @@ static void handler( ) { while (!(inb(0x64) & 1)) { asm volatile("pause"); } uint8_t scancode = inb(0x60); - char c = ' \0'; + char c = '\0'; if (scancode == 0xE0) { current_state = PREFIX_STATE; @@ -100,20 +100,19 @@ static void handler( ) { } if (is_shift(scancode) != 0) { - keyboard_buffer->shift_pressed = is_shift(scancode); + keyboard_buffer.shift_pressed = is_shift(scancode); after_interrupt( ); return; } if (is_ctrl(scancode) != 0) { - keyboard_buffer->ctrl_pressed = is_ctrl(scancode); + keyboard_buffer.ctrl_pressed = is_ctrl(scancode); after_interrupt( ); return; } if (current_state == PREFIX_STATE) { current_state = NORMAL_STATE; } - if (ru) { if (keyboard_buffer.shift_pressed) { c = ru_chars_shifted[scancode];