Page 1 of 1

Keyboard driver doesnt work

Posted: Wed Sep 13, 2023 10:58 pm
by daniil1909
hello i have troubles with keyboard driver
the problem is keyboard driver print character only on first miliseconds of boot if i continue type after bios keyboard doesnt work
keyb.c

Code: Select all

void getc() {
int i, scancode;
scancode = inw(0x60);
for (i = 1000; i < 0; i++) {
    return scancode;
}
}
init.c keyb code

Code: Select all

    while ( 1 == 1 ) {
        
        if (scan & 0x80) {
            
        }
        else {
        kprintf(scan, k++, 0x17);    
        }
        
    }
if i type with if (scan & 0x80) it doesnt work
but without it prints but only on first second of boot when i type after one second it doesnt print

Re: Keyboard driver doesnt work

Posted: Sun Oct 15, 2023 2:14 pm
by Octocontrabass
Don't ignore compiler warnings.

Scan codes aren't ASCII, are you converting them somewhere before you print them?

Are you using interrupts or polling?