From owner-freebsd-small Sat Aug 7 2:42:58 1999 Delivered-To: freebsd-small@freebsd.org Received: from outmail.utsunomiya-u.ac.jp (outmail.utsunomiya-u.ac.jp [160.12.196.3]) by hub.freebsd.org (Postfix) with ESMTP id 5B5F814D57; Sat, 7 Aug 1999 02:42:54 -0700 (PDT) (envelope-from yokota@zodiac.mech.utsunomiya-u.ac.jp) Received: from zodiac.mech.utsunomiya-u.ac.jp (IDENT:mh98pX4Zo3mMdFuY/zaX45Ur03snSMAO@zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by outmail.utsunomiya-u.ac.jp (8.9.3/3.7Wpl2) with ESMTP id SAA05569; Sat, 7 Aug 1999 18:42:05 +0900 (JST) Received: from zodiac.mech.utsunomiya-u.ac.jp (zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by zodiac.mech.utsunomiya-u.ac.jp (8.7.6+2.6Wbeta7/3.4W/zodiac-May96) with ESMTP id SAA14288; Sat, 7 Aug 1999 18:46:24 +0900 (JST) Message-Id: <199908070946.SAA14288@zodiac.mech.utsunomiya-u.ac.jp> To: Jay Kuri Cc: freebsd-small@freebsd.org, freebsd-hackers@freebsd.org, yokota@zodiac.mech.utsunomiya-u.ac.jp Subject: Re: Access to keyboard without video. In-reply-to: Your message of "Fri, 06 Aug 1999 17:10:15 -0400." References: Date: Sat, 07 Aug 1999 18:46:23 +0900 From: Kazutaka YOKOTA Sender: owner-freebsd-small@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I am working on an embedded server, and have run into some >difficulty. I need to access the keyboard (to read keys) on a machine >that has no video. (no video card, that is) > I wrote a program that works fine when run from the shell prompt >(working with stdin)... but this is probably going to have to be a daemon >of some sort, and I can't figure out how to access the keyboard directly. > >Can someone point me in the right direction? In FreeBSD version 3.1 or later, the keyboard controller atkbdc(4) and AT keyboard driver atkbd(4) will give you access to the keyboard even when there is no video card. Make sure you have both atkbdc and atkbd in your kernel configuration file (see man pages for atkbdc(4) and atkbd(4)). You also need to have the following option line. options KBD_INSTALL_CDEV Create the kbd device node in /dev as follows. cd /dev ./MAKEDEV kbd0 Then, your program can access the keyboard by opening /dev/kbd0. Note that the keyboard is usually exclusively claimed by the console driver sc (or vt) in the ordinary system with a video card and cannot be accessed by opening /dev/kbd0. The above technique works only when there is no console driver configured in the kernel, or when a console driver is configured in the kernel but is not attached because there is no video card in the system. Kazu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-small" in the body of the message