File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -34,3 +34,6 @@ created with the definitions.
3434` keyboard.c ` also has a long table to translate scancodes to ASCII keys. For the time
3535being, we will only implement a simple subset of the US keyboard. You can read
3636more [ about scancodes here] ( http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html )
37+
38+ I don't know about you, but I'm thrilled! We are very close to building a simple shell.
39+ In the next chapter, we will expand a little bit on keyboard input
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ static void timer_callback(registers_t regs) {
99 tick ++ ;
1010 kprint ("Tick: " );
1111
12- char * tick_ascii ;
12+ char tick_ascii [ 256 ] ;
1313 int_to_ascii (tick , tick_ascii );
1414 kprint (tick_ascii );
1515 kprint ("\n" );
Original file line number Diff line number Diff line change @@ -197,11 +197,14 @@ void print_letter(u8 scancode) {
197197 break ;
198198 default :
199199 /* 'keuyp' event corresponds to the 'keydown' + 0x80
200- * it may still be a scancode we haven't implemented yet */
201- if (scancode - 0x80 <= 0x39 ) {
200+ * it may still be a scancode we haven't implemented yet, or
201+ * maybe a control/escape sequence */
202+ if (scancode <= 0x7f ) {
203+ kprint ("Unknown key down" );
204+ } else if (scancode <= 0x39 + 0x80 ) {
202205 kprint ("key up " );
203206 print_letter (scancode - 0x80 );
204- } else kprint ("Unknown" );
207+ } else kprint ("Unknown key up " );
205208 break ;
206209 }
207210}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ void main() {
66 isr_install ();
77
88 asm volatile ("sti" );
9- // init_timer(50);
9+ init_timer (50 );
1010 /* Comment out the timer IRQ handler to read
1111 * the keyboard IRQs easier */
1212 init_keyboard ();
You can’t perform that action at this time.
0 commit comments