From 885a097feb260ce2b1ba57f7421e07c2a9b6ad37 Mon Sep 17 00:00:00 2001 From: Aren Date: Thu, 1 Feb 2024 18:24:01 +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=B8=D0=B5=20=D0=BF=D1=80=D0=B5=D0=B4=D1=83=D0=BF?= =?UTF-8?q?=D1=80=D0=B5=D0=B6=D0=B4=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/cpu/idt.c | 2 +- kernel/mod.c | 4 ++-- modules/helloworld/main.c | 2 +- modules/ios/build.sh | 0 modules/ios/main.c | 1 + modules/ps2/main.c | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) mode change 100644 => 100755 modules/ios/build.sh diff --git a/kernel/cpu/idt.c b/kernel/cpu/idt.c index 6ad5a21..affa8c7 100644 --- a/kernel/cpu/idt.c +++ b/kernel/cpu/idt.c @@ -73,7 +73,7 @@ static void exception_handler(struct frame state) { } stack_frame_t *stk; - stk = state.rbp; + stk = (stack_frame_t *)state.rbp; LOG("Трассировка стека:\n"); diff --git a/kernel/mod.c b/kernel/mod.c index 407e0eb..e4760f2 100644 --- a/kernel/mod.c +++ b/kernel/mod.c @@ -127,7 +127,7 @@ void mod_init( ) { continue; } - module_info_t (*module_init)(env_t * env) = + module_info_t (*module_init)(env_t *env) = (module_info_t(*)(env_t * env)) elf_entry((elf64_header_t *)module_ptr->address); // LOG("\t->Точка входа: 0x%x\n", module_init); @@ -136,7 +136,7 @@ void mod_init( ) { sys_install(&main_env); - uint64_t id = task_new_thread(1, module_list[i].name); + uint64_t id = task_new_thread((void *)1, module_list[i].name); module_info_t ret = module_init(&main_env); LOG("\t->%s\n", ret.message); diff --git a/modules/helloworld/main.c b/modules/helloworld/main.c index 469a2e6..8f37069 100644 --- a/modules/helloworld/main.c +++ b/modules/helloworld/main.c @@ -1,6 +1,6 @@ #include -static const char name[] = "Привет мир!"; +static const char name[] = "[APP]Привет мир!"; static const char message[] = "Привет из модуля!"; module_info_t __attribute__((section(".minit"))) init(env_t *env) { diff --git a/modules/ios/build.sh b/modules/ios/build.sh old mode 100644 new mode 100755 diff --git a/modules/ios/main.c b/modules/ios/main.c index 207a935..eafc091 100644 --- a/modules/ios/main.c +++ b/modules/ios/main.c @@ -36,6 +36,7 @@ static void main( ) { delete_thread( ); } else { app_list = realloc(app_list, app_count * sizeof(module_info_t)); + for (uint64_t i = 0; i < app_count; i++) { fb_printf("%2u.\t%s\n", app_list[i]); } for (;;) { asm volatile("hlt"); } } diff --git a/modules/ps2/main.c b/modules/ps2/main.c index aceccce..5863362 100644 --- a/modules/ps2/main.c +++ b/modules/ps2/main.c @@ -80,7 +80,7 @@ static int is_ctrl(uint8_t scancode) { } } -static void handler(struct frame *state) { +void handler(struct frame *state) { (void)state; while (!(inb(0x64) & 1)) { asm volatile("pause"); }