static int process_gdb_command(struct gdb_data *data, char *buf, int len) { #ifdef DEBUG_GDB printc("process_gdb_command: %s\n", buf); #endif switch (buf[0]) { case '?': /* Return target halt reason */ return run_final_status(data); case 'z': case 'Z': return set_breakpoint(data, buf[0] == 'Z', buf + 1); case 'r': /* Restart */ case 'R': return restart_program(data); case 'g': /* Read registers */ return read_registers(data); case 'G': /* Write registers */ return write_registers(data, buf + 1); case 'q': /* Query */ if (!strncmp(buf, "qRcmd,", 6)) return monitor_command(data, buf + 6); if (!strncmp(buf, "qSupported", 10)) return gdb_send_supported(data); break; case 'm': /* Read memory */ return read_memory(data, buf + 1); case 'M': /* Write memory */ return write_memory(data, buf + 1); case 'c': /* Continue */ return run(data, buf + 1); case 's': /* Single step */ return single_step(data, buf + 1); case 'k': /* kill */ return -1; } #ifdef DEBUG_GDB printc("process_gdb_command: unknown command %s\n", buf); #endif /* For unknown/unsupported packets, return an empty reply */ return gdb_send(data, ""); }
void keyboard_handler ( registers_t *regs ) { u8int scancode = inb ( 0x60 ); u8int specialKey = 0; specialKey = isSpecialKey ( scancode ); currentKey = 0; if ( scancode & 0x80 ) { scancode = scancode - 0x80; if ( scancode == 42 || scancode - 0x80 == 54 ) { shift_flag = 0; } } else { if ( scancode == 42 || scancode - 0x80 == 54 ) { shift_flag = 1; } if ( scancode == 0x3A ) { CapsOn = !CapsOn; i8042_Caps(CapsOn, 0, 0); } if ( shift_flag == 0 && CapsOn == 0 ) { //monitor_put ( lowerCaseKbdus[scancode] ); setKey ( lowerCaseKbdus[scancode] ); //set Current Key for key logger. } if ( shift_flag == 1 || CapsOn == 1 ) { //monitor_put ( upperCaseKbdus[scancode] ); setKey ( upperCaseKbdus[scancode] ); //set Current Key for key logger. } //monitor_put(currentKey); //standard print keys to screen if ( specialKey != 0 ) { switch ( specialKey ) { case 1: monitor_command ( "cursor", "left" ); break; case 2: monitor_command ( "cursor", "right" ); break; case 3: monitor_command ( "cursor", "up" ); break; case 4: monitor_command ( "cursor", "down" ); break; case 5: monitor_put ( '\r' ); setKey ( '\r' ); break; default: break; } } } //i8042_Caps(CapsOn, 0, 0); }