From 53809eab9c7cc3769cf6155c1026ecc71a2d1904 Mon Sep 17 00:00:00 2001 From: Paul Traina Date: Fri, 6 Sep 1996 23:35:54 +0000 Subject: [PATCH] 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. --- sys/conf/NOTES | 4 +++- sys/dev/syscons/syscons.c | 16 ++++++++++++---- sys/i386/conf/LINT | 4 +++- sys/i386/conf/NOTES | 4 +++- sys/i386/isa/syscons.c | 16 ++++++++++++---- sys/isa/syscons.c | 16 ++++++++++++---- 6 files changed, 45 insertions(+), 15 deletions(-) diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 86ddb825c33..a514b7bb2aa 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -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. diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 02218f93302..2a81f4127bb 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -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 @@ -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(); diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT index 86ddb825c33..a514b7bb2aa 100644 --- a/sys/i386/conf/LINT +++ b/sys/i386/conf/LINT @@ -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. diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 86ddb825c33..a514b7bb2aa 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -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. diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c index 02218f93302..2a81f4127bb 100644 --- a/sys/i386/isa/syscons.c +++ b/sys/i386/isa/syscons.c @@ -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 @@ -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(); diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c index 02218f93302..2a81f4127bb 100644 --- a/sys/isa/syscons.c +++ b/sys/isa/syscons.c @@ -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 @@ -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();