pintos/src/devices/kbd.c File Reference

#include "devices/kbd.h"
#include <ctype.h>
#include <debug.h>
#include <stdio.h>
#include <string.h>
#include "devices/input.h"
#include "threads/init.h"
#include "threads/interrupt.h"
#include "threads/io.h"

Go to the source code of this file.

Data Structures

struct  keymap

Defines

#define DATA_REG   0x60

Functions

void kbd_init (void)
void kbd_print_stats (void)
static bool map_key (const struct keymap[], unsigned scancode, uint8_t *)
static void keyboard_interrupt (struct intr_frame *args UNUSED)

Variables

static bool left_shift
static bool right_shift
static bool left_alt
static bool right_alt
static bool left_ctrl
static bool right_ctrl
static bool caps_lock
static int64_t key_cnt
static intr_handler_func keyboard_interrupt
static struct keymap invariant_keymap []
static struct keymap unshifted_keymap []
static struct keymap shifted_keymap []


Define Documentation

#define DATA_REG   0x60

Definition at line 13 of file kbd.c.

Referenced by keyboard_interrupt().


Function Documentation

void kbd_init ( void   ) 

Definition at line 32 of file kbd.c.

References intr_register_ext(), and keyboard_interrupt.

Referenced by main().

void kbd_print_stats ( void   ) 

Definition at line 39 of file kbd.c.

References key_cnt, and printf().

Referenced by print_stats().

static void keyboard_interrupt ( struct intr_frame *args  UNUSED  )  [static]

static bool map_key ( const struct keymap  k[],
unsigned  scancode,
uint8_t c 
) [static]

Definition at line 207 of file kbd.c.

References keymap::chars, keymap::first_scancode, and strlen().

Referenced by keyboard_interrupt().


Variable Documentation

bool caps_lock [static]

Definition at line 23 of file kbd.c.

Referenced by keyboard_interrupt().

struct keymap invariant_keymap[] [static]

Initial value:

 
  {
    {0x01, "\033"},             
    {0x0e, "\b"},
    {0x0f, "\tQWERTYUIOP"},
    {0x1c, "\r"},
    {0x1e, "ASDFGHJKL"},
    {0x2c, "ZXCVBNM"},
    {0x37, "*"},
    {0x39, " "},
    {0x53, "\177"},             
    {0, NULL},
  }

Definition at line 56 of file kbd.c.

int64_t key_cnt [static]

Definition at line 26 of file kbd.c.

Referenced by kbd_print_stats(), and keyboard_interrupt().

intr_handler_func keyboard_interrupt [static]

Definition at line 28 of file kbd.c.

Referenced by kbd_init().

bool left_alt [static]

Definition at line 18 of file kbd.c.

Referenced by keyboard_interrupt().

bool left_ctrl [static]

Definition at line 19 of file kbd.c.

Referenced by keyboard_interrupt().

bool left_shift [static]

Definition at line 17 of file kbd.c.

Referenced by keyboard_interrupt().

bool right_alt [static]

Definition at line 18 of file kbd.c.

Referenced by keyboard_interrupt().

bool right_ctrl [static]

Definition at line 19 of file kbd.c.

Referenced by keyboard_interrupt().

bool right_shift [static]

Definition at line 17 of file kbd.c.

Referenced by keyboard_interrupt().

struct keymap shifted_keymap[] [static]

Initial value:

 
  {
    {0x02, "!@#$%^&*()_+"},
    {0x1a, "{}"},
    {0x27, ":\"~"},
    {0x2b, "|"},
    {0x33, "<>?"},
    {0, NULL},
  }

Definition at line 84 of file kbd.c.

struct keymap unshifted_keymap[] [static]

Initial value:

 
  {
    {0x02, "1234567890-="},
    {0x1a, "[]"},
    {0x27, ";'`"},
    {0x2b, "\\"},
    {0x33, ",./"},
    {0, NULL},
  }

Definition at line 72 of file kbd.c.


Generated on Mon Jan 10 16:43:58 2011 for Pintos by  doxygen 1.5.6