MentOS  0.8.0
The Mentoring Operating System
Macros | Functions | Variables
keyboard.c File Reference

Keyboard handling. More...

Macros

#define __DEBUG_HEADER__   "[KEYBRD]"
 Change header.
 
#define __DEBUG_LEVEL__   LOGLEVEL_NOTICE
 Set log level.
 
#define KBD_LEFT_SHIFT   (1 << 0)
 Flag which identifies the left shift.
 
#define KBD_RIGHT_SHIFT   (1 << 1)
 Flag which identifies the right shift.
 
#define KBD_CAPS_LOCK   (1 << 2)
 Flag which identifies the caps lock.
 
#define KBD_NUM_LOCK   (1 << 3)
 Flag which identifies the num lock.
 
#define KBD_SCROLL_LOCK   (1 << 4)
 Flag which identifies the scroll lock.
 
#define KBD_LEFT_CONTROL   (1 << 5)
 Flag which identifies the left control.
 
#define KBD_RIGHT_CONTROL   (1 << 6)
 Flag which identifies the right control.
 
#define KBD_LEFT_ALT   (1 << 7)
 Flag which identifies the left alt.
 
#define KBD_RIGHT_ALT   (1 << 8)
 Flag which identifies the right alt.
 

Functions

static void keyboard_push_front (unsigned int c)
 Pushes a character into the scancode ring buffer. More...
 
static void keyboard_push_sequence (char *sequence)
 Pushes a sequence of characters (scancodes) into the keyboard buffer. More...
 
int keyboard_pop_back (void)
 Gets and removes a char from the back of the buffer. More...
 
int keyboard_back (void)
 Gets a char from the back of the buffer. More...
 
int keyboard_front (void)
 Gets a char from the front of the buffer. More...
 
void keyboard_isr (pt_regs *f)
 The interrupt service routine of the keyboard. More...
 
void keyboard_update_leds (void)
 Leds handler.
 
void keyboard_enable (void)
 Enable the keyboard.
 
void keyboard_disable (void)
 Disable the keyboard.
 
int keyboard_initialize (void)
 Initializes the keyboard drivers. More...
 
int keyboard_finalize (void)
 De-initializes the keyboard drivers. More...
 

Variables

static uint8_t ledstate = 0
 Tracks the state of the leds.
 
static uint32_t kflags = 0
 The flags concerning the keyboard.
 
fs_rb_scancode_t scancodes
 Where we store the keypress.
 
spinlock_t scancodes_lock
 Spinlock to protect access to the scancode buffer.
 

Detailed Description

Keyboard handling.