Date: Sun, 14 Dec 1997 19:25:24 -0800 From: Amancio Hasty <hasty@rah.star-gate.com> To: Mike Smith <mike@smith.net.au> Cc: pb@fasterix.freenix.org (Pierre Beyssac), freebsd-current@freebsd.org Subject: linux kbd and virtual terminal patch Message-ID: <199712150325.TAA03045@rah.star-gate.com> In-Reply-To: Your message of "Mon, 15 Dec 1997 13:01:27 %2B1030." <199712150231.NAA00578@word.smith.net.au>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] Hi Mike, Here is the patch which I promised yesterday. Now whats left is to generate a Mesa library package with my version of svgalib for linux and we are all set to play quake2. In the mean time if people want to try out the quake2 test see: ftp://rah.star-gate.com/pub/README.GLQUAKE Enjoy, Amancio --- Explanation: These patches enables us to play quake2 . Support linux keyboard ioctl for setting RAW, MEDIUMRAW and XLATE. Support linux virtual terminal operations: OPENQRY, GETMODE, SETMODE, GETSTATE, ACTIVATE, and WAITACTIVE. [-- Attachment #2 --] *** linux.h.orig Sun Dec 14 18:50:25 1997 --- linux.h Sun Dec 14 19:01:19 1997 *************** *** 25,31 **** * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ! * $Id: linux.h,v 1.18 1997/11/17 04:00:29 ahasty Exp $ */ #ifndef _I386_LINUX_LINUX_H_ --- 25,31 ---- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ! * $Id: linux.h,v 1.17 1997/10/28 10:49:57 kato Exp $ */ #ifndef _I386_LINUX_LINUX_H_ *************** *** 167,172 **** --- 167,180 ---- #define LINUX_SIG_UNBLOCK 1 #define LINUX_SIG_SETMASK 2 + /* keyboard defines */ + #define LINUX_KDGKBMODE 0x4B44 + #define LINUX_KDSKBMODE 0x4B45 + + #define LINUX_KBD_RAW 0 + #define LINUX_KBD_XLATE 1 + #define LINUX_KBD_MEDIUMRAW 2 + /* termio commands */ #define LINUX_TCGETS 0x5401 #define LINUX_TCSETS 0x5402 *************** *** 215,220 **** --- 223,236 ---- #define LINUX_TIOCSERSWILD 0x5455 #define LINUX_TIOCGLCKTRMIOS 0x5456 #define LINUX_TIOCSLCKTRMIOS 0x5457 + #define LINUX_VT_OPENQRY 0x5600 + #define LINUX_VT_GETMODE 0x5601 + #define LINUX_VT_SETMODE 0x5602 + #define LINUX_VT_GETSTATE 0x5603 + #define LINUX_VT_ACTIVATE 0x5606 + #define LINUX_VT_WAITACTIVE 0x5607 + + /* arguments for tcflush() and LINUX_TCFLSH */ #define LINUX_TCIFLUSH 0 *** linux_ioctl.c.orig Sun Dec 14 18:49:58 1997 --- linux_ioctl.c Sun Dec 14 19:00:05 1997 *************** *** 44,49 **** --- 44,50 ---- #include <sys/sockio.h> #include <machine/soundcard.h> + #include <machine/console.h> #include <i386/linux/linux.h> #include <i386/linux/linux_proto.h> *************** *** 836,841 **** --- 837,894 ---- } return ioctl(p, (struct ioctl_args *)args); + case LINUX_VT_OPENQRY: + + args->cmd = VT_OPENQRY; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_GETMODE: + + args->cmd = VT_GETMODE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_SETMODE: + + args->cmd = VT_SETMODE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_GETSTATE: + + args->cmd = VT_GETACTIVE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_ACTIVATE: + + args->cmd = VT_ACTIVATE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_WAITACTIVE: + + args->cmd = VT_WAITACTIVE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_KDGKBMODE: + + args->cmd = KDGKBMODE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_KDSKBMODE: + { + int kbdmode; + switch (args->arg) { + case LINUX_KBD_RAW: + kbdmode = K_RAW; + return (*func)(fp, KDSKBMODE, (caddr_t)&kbdmode, p); + case LINUX_KBD_XLATE: + kbdmode = K_XLATE; + return (*func)(fp, KDSKBMODE , (caddr_t)&kbdmode, p); + case LINUX_KBD_MEDIUMRAW: + kbdmode = K_RAW; + return (*func)(fp, KDSKBMODE , (caddr_t)&kbdmode, p); + default: + return EINVAL; + } + } } uprintf("LINUX: 'ioctl' fd=%d, typ=0x%x(%c), num=0x%x not implemented\n", args->fd, (args->cmd&0xffff00)>>8,help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712150325.TAA03045>
