From e21551f008560a2eb2ab25f3ff4e36ac229e948a Mon Sep 17 00:00:00 2001 From: Aren Elchinyan Date: Fri, 2 Feb 2024 19:18:55 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BD=D0=B0=D0=B6=D0=B0=D1=82=D0=B8=D0=B9=20PS/?= =?UTF-8?q?2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/version.h | 2 +- kernel/cpu/idt.c | 2 +- kernel/mod.c | 3 ++- modules/ios/main.c | 2 +- modules/ps2/main.c | 8 ++------ 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/include/version.h b/include/version.h index 95cfc82..9933966 100644 --- a/include/version.h +++ b/include/version.h @@ -1,3 +1,3 @@ #define VERSION_MAJOR 0 #define VERSION_MINOR 2 -#define VERSION_BUILD 14 +#define VERSION_BUILD 34 diff --git a/kernel/cpu/idt.c b/kernel/cpu/idt.c index affa8c7..a693c3a 100644 --- a/kernel/cpu/idt.c +++ b/kernel/cpu/idt.c @@ -89,7 +89,7 @@ static void exception_handler(struct frame state) { void isr_generic(struct frame state) { if (state.int_number > 255) { return; } - // if (state.int_number != 32) { LOG("Обработка прерывания %u\n", state.int_number); } + if (state.int_number != 32) { LOG("Обработка прерывания %u\n", state.int_number); } if (state.int_number < 32) { exception_handler(state); diff --git a/kernel/mod.c b/kernel/mod.c index 82358df..025c1f8 100644 --- a/kernel/mod.c +++ b/kernel/mod.c @@ -33,7 +33,7 @@ static void *elf_entry(elf64_header_t *module_bin) { // Приводим заголовок ELF файла к типу elf64_header_t elf64_header_t *elf_header = (elf64_header_t *)module_bin; - // LOG("(uint64_t)elf_header->e_entry = 0x%x, type = %u\n", (uint64_t)elf_header->e_entry, elf_header->e_type); + LOG("(uint64_t)elf_header->e_entry = 0x%x, тип = %u\n", (uint64_t)elf_header->e_entry, elf_header->e_type); if (elf_header->e_type != 2) { LOG("\t\tОшибка! Модуль неправильно собран!\n"); @@ -92,6 +92,7 @@ void mod_init( ) { LOG("Ошибка выделения памяти для массива module_list\n"); return; } + LOG("module_list = 0x%x\n", module_list); } for (uint64_t i = 0; i < module_count; i++) { diff --git a/modules/ios/main.c b/modules/ios/main.c index adc2151..7ef9e98 100644 --- a/modules/ios/main.c +++ b/modules/ios/main.c @@ -22,7 +22,7 @@ static void main( ) { for (uint64_t i = 0; i < *mod_count; i++) { if (str_contains(mod_list[i].name, "[APP]")) { - //fb_printf("%u. %s\n", app_count, mod_list[i].name); + // fb_printf("%u. %s\n", app_count, mod_list[i].name); app_list[app_count] = mod_list[i]; app_count++; } diff --git a/modules/ps2/main.c b/modules/ps2/main.c index 5863362..48ae06c 100644 --- a/modules/ps2/main.c +++ b/modules/ps2/main.c @@ -8,9 +8,6 @@ static char c_char = '\0'; static key_event_t keyboard_buffer; void virt_exit( ) { - fb_printf("Выход для Bochs\n"); - outw(0xB004, 0x2000); - fb_printf("Выход для Qemu\n"); outw(0x604, 0x2000); @@ -80,8 +77,7 @@ static int is_ctrl(uint8_t scancode) { } } -void handler(struct frame *state) { - (void)state; +static void handler( ) { while (!(inb(0x64) & 1)) { asm volatile("pause"); } uint8_t scancode = inb(0x60); @@ -169,6 +165,6 @@ module_info_t __attribute__((section(".minit"))) init(env_t *env) { .err_code = 0, .module_id = 0, .irq = 33, - .irq_handler = handler, + .irq_handler = &handler, .get_func = __get_func }; } \ No newline at end of file