Skip to content

Commit

Permalink
Исправлена обработка нажатий PS/2
Browse files Browse the repository at this point in the history
  • Loading branch information
0Nera committed Feb 2, 2024
1 parent 9deba0b commit e21551f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/version.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_BUILD 14
#define VERSION_BUILD 34
2 changes: 1 addition & 1 deletion kernel/cpu/idt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion kernel/mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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++) {
Expand Down
2 changes: 1 addition & 1 deletion modules/ios/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down
8 changes: 2 additions & 6 deletions modules/ps2/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 };
}

0 comments on commit e21551f

Please sign in to comment.