cnsl_kbd_write(ch);
}
+extern tty_t default_tty;
+extern tty_t monitor_tty;
+extern tty_t debug_tty;
+
void kbd_debug(unsigned char scan_code) {
static unsigned long kbd_cnt = 0;
printl(MPL_KEYBOARD, "keyboard irq: %d scan code %02x", kbd_cnt++, scan_code);
printd("[%02x]", scan_code);
- // if (scan_code == 0x3B) // F1
- // vga_switch(0);
- // if (scan_code == 0x3C) // F2
- // vga_switch(1);
- // if (scan_code == 0x3D) // F3
- // vga_switch(2);
- // if (scan_code == 0x3E) // F4
- // vga_switch(3);
+ if (scan_code == 0x3B) { // F1
+ tty_switch(&default_tty);
+ } else if (scan_code == 0x3C) { // F2
+ tty_switch(&monitor_tty);
+ } else if (scan_code == 0x3D) { // F3
+ tty_switch(&debug_tty);
+ }
if (scan_code == 0x3F) // F5
debug_wait_queue_put(0);
ata_test(0);
}
if (scan_code == 0x44) { // F10
-
void ata_send_read_identify_cmd(int dev);
ata_send_read_identify_cmd(0);
}
;
}
- extern tty_t default_tty;
- extern tty_t monitor_tty;
if (scan_code == 0x58) { // F12
current_tty = current_tty != &default_tty ? &default_tty : &monitor_tty;
tty_switch(current_tty);
#define TTY_BG_BLINK 0b1000
#define TTY_BLACK 0b0000
-#define TTY_WHITE 0b0111
-#define TTY_RED 0b0100
-#define TTY_GREEN 0b0010
#define TTY_BLUE 0b0001
+#define TTY_GREEN 0b0010
+#define TTY_CYAN 0b0011
+#define TTY_RED 0b0100
+#define TTY_PURPLE 0b101
+#define TTY_YELLOW 0b110
+#define TTY_WHITE 0b0111
typedef struct tty {
char name[32];
current_tty = &default_tty;
init_tty(&debug_tty, "tty.debug", VADDR + 7 * TTY_VRAM_SIZE);
- debug_tty.fg_color = TTY_BLACK;
- debug_tty.bg_color = TTY_RED;
+ debug_tty.fg_color = TTY_FG_HIGHLIGHT | TTY_WHITE;
+ debug_tty.bg_color = TTY_CYAN;
tty_clear(&debug_tty);
}