From: Alan Cox Date: Tue, 30 Dec 2014 19:04:17 +0000 (+0000) Subject: vt: add the framework for reporting the keyboard map and VT size X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=58dab1bb45399a7a4ac7c8a9a8a9514ba79e6be2;p=FUZIX.git vt: add the framework for reporting the keyboard map and VT size --- diff --git a/Kernel/include/vt.h b/Kernel/include/vt.h index 709bed0e..4968769a 100644 --- a/Kernel/include/vt.h +++ b/Kernel/include/vt.h @@ -3,6 +3,10 @@ /* Optional defines */ +#ifndef MAX_VT +#define MAX_VT 1 +#endif + #ifndef VT_MAP_CHAR #define VT_MAP_CHAR(x) (x) #endif @@ -33,5 +37,6 @@ void scroll_up(void); void scroll_down(void); void plot_char(int8_t y, int8_t x, uint16_t c); void do_beep(void); +int vt_ioctl(uint8_t minor, uint16_t op, char *ptr); #endif \ No newline at end of file diff --git a/Kernel/vt.c b/Kernel/vt.c index 71353f96..2a58d65f 100644 --- a/Kernel/vt.c +++ b/Kernel/vt.c @@ -1,4 +1,5 @@ #include +#include #include #include @@ -182,6 +183,24 @@ void vtoutput(unsigned char *p, unsigned int len) cursor_on(cursory, cursorx); } +int vt_ioctl(uint8_t minor, uint16_t request, char *data) +{ + /* FIXME: need to address the multiple vt switching case + here.. probably need to switch vt */ + if (minor <= MAX_VT) { + switch(request) { + case KBMAPSIZE: + return KEY_ROWS << 8 | KEY_COLS; + case KBMAPGET: + return uput(keymap, data, sizeof(keymap)); + case VTSIZE: + return VT_HEIGHT << 8 | VT_WIDTH; + } + } + return tty_ioctl(minor, request, data); +} + + void vtinit(void) { vtmode = 0;