c - Minix keyboard Driver -
i'm trying change keyboard driver in minix, idea store in file characters used introduced in keyboard.i declare global file * fp , insert piece of code in /usr/src/drivers/tty/keyboard.c
while (icount > 0) { scode = *itail++; /* take 1 key scan code */ if (itail == ibuf + kb_in_bytes) itail = ibuf; icount--; /* function keys being used debug dumps. */ if (func_key(scode)) continue; /* perform make/break processing. */ ch = make_break(scode); if (ch <= 0xff) { /* normal character. */ fp = fopen("log.txt","a+"); fprint(fp,"%c",ch); fclose(fp); buf[0] = ch; (void) in_process(tp, buf, 1); } else ...
then run "make" in directory , reboot not work. mean, file not created. idea?
this won't work. keyboard driver inside tty
"driver", service in charge of console. fs
/vfs
transmit i/o requests concerning console tty
. fopen
, fprint
, , fclose
in code ways perform such requests. vfs
can handle requests "user" programs (and transmit them down drivers); tty
not "user" program, , such, not allowed perform i/o requests.
Comments
Post a Comment