Keyboard driver doesnt work

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
daniil1909
Posts: 6
Joined: Wed Sep 13, 2023 10:52 pm

Keyboard driver doesnt work

Post 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
Octocontrabass
Member
Member
Posts: 5560
Joined: Mon Mar 25, 2013 7:01 pm

Re: Keyboard driver doesnt work

Post 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?
Post Reply