From owner-freebsd-hackers Sun Apr 23 22:59:15 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id WAA23277 for hackers-outgoing; Sun, 23 Apr 1995 22:59:15 -0700 Received: from zibbi.mikom.csir.co.za (zibbi.mikom.csir.co.za [146.64.24.58]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id WAA23269 ; Sun, 23 Apr 1995 22:59:03 -0700 Received: (from jhay@localhost) by zibbi.mikom.csir.co.za (8.6.11/8.6.6) id HAA02863; Mon, 24 Apr 1995 07:55:49 +0200 From: John Hay Message-Id: <199504240555.HAA02863@zibbi.mikom.csir.co.za> Subject: Re: syscons probe function To: bde@zeta.org.au (Bruce Evans) Date: Mon, 24 Apr 1995 07:55:48 +0200 (SAT) Cc: hackers@FreeBSD.org, jhay@mikom.csir.co.za, sos@FreeBSD.org In-Reply-To: <199504240211.MAA14777@godzilla.zeta.org.au> from "Bruce Evans" at Apr 24, 95 12:11:50 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 1992 Sender: hackers-owner@FreeBSD.org Precedence: bulk > > >The changes to syscons.c in the last month or so panic my machines that do > >not have a screen but have syscons in the kernel (they only have a serial > >terminal). It happens somewhere in the attach routine during a bcopy. > > >This led me to look through the the syscons.c file. One thing that bothers me > >is that the probe can never fail. It assumes that there is a screen. In the > >attach routine it will check if it is a colour screen otherwise it reverts > >to monochrome. > > >Shouldn't the probe determine if there is a screen and fail if there isn't? > > Yes, but scinit() needs to decide before the probe is even called. > Well just to get my machines working with a new kernel and not exclude syscons I made the following change to the syscons probe routine. It just fail the probe if the keyboard isn't there. NOTE that I don't think this is the right or best way I just wanted to get going again. *** syscons.c.v2.10.org Wed Apr 19 21:09:18 1995 --- syscons.c Wed Apr 19 21:14:23 1995 *************** *** 173,181 **** } } gotres: ! if (!retries) printf("scprobe: keyboard won't accept RESET command\n"); ! else { gotack: DELAY(10); while ((inb(KB_STAT) & KB_BUF_FULL) == 0) DELAY(10); --- 173,182 ---- } } gotres: ! if (!retries) { printf("scprobe: keyboard won't accept RESET command\n"); ! return 0; ! } else { gotack: DELAY(10); while ((inb(KB_STAT) & KB_BUF_FULL) == 0) DELAY(10); *************** *** 183,190 **** val = inb(KB_DATA); if (val == KB_ACK) goto gotack; ! if (val != KB_RESET_DONE) printf("scprobe: keyboard RESET failed %02x\n", val); } #ifdef XT_KEYBOARD kbd_wait(); --- 184,193 ---- val = inb(KB_DATA); if (val == KB_ACK) goto gotack; ! if (val != KB_RESET_DONE) { printf("scprobe: keyboard RESET failed %02x\n", val); + return 0; + } } #ifdef XT_KEYBOARD kbd_wait(); -- John Hay -- jhay@mikom.csir.co.za