AT keyboard support for Yeeloong

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2009-11-02 23:57:09 +01:00
parent 810d8224cd
commit 1b4595cebf
4 changed files with 10 additions and 36 deletions

View file

@ -6,7 +6,7 @@ cpuid_mod_CFLAGS = $(COMMON_CFLAGS)
cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += at_keyboard.mod pkglib_MODULES += at_keyboard.mod
at_keyboard_mod_SOURCES = term/i386/pc/at_keyboard.c at_keyboard_mod_SOURCES = term/at_keyboard.c
at_keyboard_mod_CFLAGS = $(COMMON_CFLAGS) at_keyboard_mod_CFLAGS = $(COMMON_CFLAGS)
at_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS) at_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS)

View file

@ -192,4 +192,10 @@ linux_mod_CFLAGS = $(COMMON_CFLAGS)
linux_mod_ASFLAGS = $(COMMON_ASFLAGS) linux_mod_ASFLAGS = $(COMMON_ASFLAGS)
linux_mod_LDFLAGS = $(COMMON_LDFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For at_keyboard.mod.
pkglib_MODULES += at_keyboard.mod
at_keyboard_mod_SOURCES = term/at_keyboard.c
at_keyboard_mod_CFLAGS = $(COMMON_CFLAGS)
at_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS)
include $(srcdir)/conf/common.mk include $(srcdir)/conf/common.mk

View file

@ -19,39 +19,7 @@
#ifndef GRUB_CPU_AT_KEYBOARD_HEADER #ifndef GRUB_CPU_AT_KEYBOARD_HEADER
#define GRUB_CPU_AT_KEYBOARD_HEADER 1 #define GRUB_CPU_AT_KEYBOARD_HEADER 1
#include <grub/machine/machine.h>
#define SHIFT_L 0x2a
#define SHIFT_R 0x36
#define CTRL 0x1d
#define ALT 0x38
#define CAPS_LOCK 0x3a
#define KEYBOARD_REG_DATA 0x60 #define KEYBOARD_REG_DATA 0x60
#define KEYBOARD_REG_STATUS 0x64 #define KEYBOARD_REG_STATUS 0x64
/* Used for sending commands to the controller. */
#define KEYBOARD_COMMAND_ISREADY(x) !((x) & 0x02)
#define KEYBOARD_COMMAND_READ 0x20
#define KEYBOARD_COMMAND_WRITE 0x60
#define KEYBOARD_COMMAND_REBOOT 0xfe
#define KEYBOARD_SCANCODE_SET1 0x40
#define KEYBOARD_ISMAKE(x) !((x) & 0x80)
#define KEYBOARD_ISREADY(x) ((x) & 0x01)
#define KEYBOARD_SCANCODE(x) ((x) & 0x7f)
#ifdef GRUB_MACHINE_IEEE1275
#define OLPC_UP GRUB_TERM_UP
#define OLPC_DOWN GRUB_TERM_DOWN
#define OLPC_LEFT GRUB_TERM_LEFT
#define OLPC_RIGHT GRUB_TERM_RIGHT
#else
#define OLPC_UP '\0'
#define OLPC_DOWN '\0'
#define OLPC_LEFT '\0'
#define OLPC_RIGHT '\0'
#endif
#endif #endif

View file

@ -17,9 +17,9 @@
*/ */
#include <grub/dl.h> #include <grub/dl.h>
#include <grub/i386/pc/console.h> #include <grub/at_keyboard.h>
#include <grub/i386/at_keyboard.h> #include <grub/cpu/at_keyboard.h>
#include <grub/i386/io.h> #include <grub/cpu/io.h>
#include <grub/misc.h> #include <grub/misc.h>
#include <grub/term.h> #include <grub/term.h>