Add option SC_KBD_PROBE_WORKS to syscons driver.

If you define this, it means your keyboard is actually probable using the
brain-dammaged probe routine in syscons, and if the keyboard is NOT found,
then you don't want syscons to activate itself further.

This makes life sane for those of us who use serial consoles most of the
time and want "the right thing" to happen when we plug a keyboard in.
This commit is contained in:
pst 1996-09-06 23:35:54 +00:00
parent aa7dd6a945
commit 10adc41d5e
6 changed files with 45 additions and 15 deletions

View File

@ -2,7 +2,7 @@
# LINT -- config file for checking all the sources, tries to pull in
# as much of the source tree as it can.
#
# $Id: LINT,v 1.274 1996/07/10 19:44:17 julian Exp $
# $Id: LINT,v 1.275 1996/08/15 10:41:34 asami Exp $
#
# NB: You probably don't want to try running a kernel built from this
# file. Instead, you should start from GENERIC, and add options from
@ -501,6 +501,8 @@ options PCVT_SCANSET=2 # IBM keyboards are non-std
# The syscons console driver (sco color console compatible) - default.
device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
options SC_KBD_PROBE_WORKS # keyboard probe should determine
# if syscons is available
#
# This device is mandatory.

View File

@ -25,12 +25,13 @@
* (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: syscons.c,v 1.164 1996/09/04 22:24:19 sos Exp $
* $Id: syscons.c,v 1.165 1996/09/06 23:08:09 phk Exp $
*/
#include "sc.h"
#include "apm.h"
#include "opt_ddb.h"
#include "opt_syscons.h"
#if NSC > 0
#include <sys/param.h>
@ -276,9 +277,12 @@ scprobe(struct isa_device *dev)
}
}
gotres:
if (retries < 0)
if (retries < 0) {
printf("scprobe: keyboard won't accept RESET command\n");
else {
#ifdef SC_KBD_PROBE_WORKS
return (0);
#endif
} else {
i = 10; /* At most 10 retries. */
gotack:
DELAY(100);
@ -288,8 +292,12 @@ gotack:
val = inb(KB_DATA);
if (val == KB_ACK && --i > 0)
goto gotack;
if (val != KB_RESET_DONE)
if (val != KB_RESET_DONE) {
printf("scprobe: keyboard RESET failed (result = 0x%02x)\n", val);
#ifdef SC_KBD_PROBE_WORKS
return (0);
#endif
}
}
#ifdef XT_KEYBOARD
kbd_wait();

View File

@ -2,7 +2,7 @@
# LINT -- config file for checking all the sources, tries to pull in
# as much of the source tree as it can.
#
# $Id: LINT,v 1.274 1996/07/10 19:44:17 julian Exp $
# $Id: LINT,v 1.275 1996/08/15 10:41:34 asami Exp $
#
# NB: You probably don't want to try running a kernel built from this
# file. Instead, you should start from GENERIC, and add options from
@ -501,6 +501,8 @@ options PCVT_SCANSET=2 # IBM keyboards are non-std
# The syscons console driver (sco color console compatible) - default.
device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
options SC_KBD_PROBE_WORKS # keyboard probe should determine
# if syscons is available
#
# This device is mandatory.

View File

@ -2,7 +2,7 @@
# LINT -- config file for checking all the sources, tries to pull in
# as much of the source tree as it can.
#
# $Id: LINT,v 1.274 1996/07/10 19:44:17 julian Exp $
# $Id: LINT,v 1.275 1996/08/15 10:41:34 asami Exp $
#
# NB: You probably don't want to try running a kernel built from this
# file. Instead, you should start from GENERIC, and add options from
@ -501,6 +501,8 @@ options PCVT_SCANSET=2 # IBM keyboards are non-std
# The syscons console driver (sco color console compatible) - default.
device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
options SC_KBD_PROBE_WORKS # keyboard probe should determine
# if syscons is available
#
# This device is mandatory.

View File

@ -25,12 +25,13 @@
* (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: syscons.c,v 1.164 1996/09/04 22:24:19 sos Exp $
* $Id: syscons.c,v 1.165 1996/09/06 23:08:09 phk Exp $
*/
#include "sc.h"
#include "apm.h"
#include "opt_ddb.h"
#include "opt_syscons.h"
#if NSC > 0
#include <sys/param.h>
@ -276,9 +277,12 @@ scprobe(struct isa_device *dev)
}
}
gotres:
if (retries < 0)
if (retries < 0) {
printf("scprobe: keyboard won't accept RESET command\n");
else {
#ifdef SC_KBD_PROBE_WORKS
return (0);
#endif
} else {
i = 10; /* At most 10 retries. */
gotack:
DELAY(100);
@ -288,8 +292,12 @@ gotack:
val = inb(KB_DATA);
if (val == KB_ACK && --i > 0)
goto gotack;
if (val != KB_RESET_DONE)
if (val != KB_RESET_DONE) {
printf("scprobe: keyboard RESET failed (result = 0x%02x)\n", val);
#ifdef SC_KBD_PROBE_WORKS
return (0);
#endif
}
}
#ifdef XT_KEYBOARD
kbd_wait();

View File

@ -25,12 +25,13 @@
* (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: syscons.c,v 1.164 1996/09/04 22:24:19 sos Exp $
* $Id: syscons.c,v 1.165 1996/09/06 23:08:09 phk Exp $
*/
#include "sc.h"
#include "apm.h"
#include "opt_ddb.h"
#include "opt_syscons.h"
#if NSC > 0
#include <sys/param.h>
@ -276,9 +277,12 @@ scprobe(struct isa_device *dev)
}
}
gotres:
if (retries < 0)
if (retries < 0) {
printf("scprobe: keyboard won't accept RESET command\n");
else {
#ifdef SC_KBD_PROBE_WORKS
return (0);
#endif
} else {
i = 10; /* At most 10 retries. */
gotack:
DELAY(100);
@ -288,8 +292,12 @@ gotack:
val = inb(KB_DATA);
if (val == KB_ACK && --i > 0)
goto gotack;
if (val != KB_RESET_DONE)
if (val != KB_RESET_DONE) {
printf("scprobe: keyboard RESET failed (result = 0x%02x)\n", val);
#ifdef SC_KBD_PROBE_WORKS
return (0);
#endif
}
}
#ifdef XT_KEYBOARD
kbd_wait();