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.
34
34
` keyboard.c ` also has a long table to translate scancodes to ASCII keys. For the time
35
35
being, we will only implement a simple subset of the US keyboard. You can read
36
36
more [ 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) {
9
9
tick ++ ;
10
10
kprint ("Tick: " );
11
11
12
- char * tick_ascii ;
12
+ char tick_ascii [ 256 ] ;
13
13
int_to_ascii (tick , tick_ascii );
14
14
kprint (tick_ascii );
15
15
kprint ("\n" );
Original file line number Diff line number Diff line change @@ -197,11 +197,14 @@ void print_letter(u8 scancode) {
197
197
break ;
198
198
default :
199
199
/* '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 ) {
202
205
kprint ("key up " );
203
206
print_letter (scancode - 0x80 );
204
- } else kprint ("Unknown" );
207
+ } else kprint ("Unknown key up " );
205
208
break ;
206
209
}
207
210
}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ void main() {
6
6
isr_install ();
7
7
8
8
asm volatile ("sti" );
9
- // init_timer(50);
9
+ init_timer (50 );
10
10
/* Comment out the timer IRQ handler to read
11
11
* the keyboard IRQs easier */
12
12
init_keyboard ();
You can’t perform that action at this time.
0 commit comments