From owner-freebsd-arch@FreeBSD.ORG Fri Feb 6 17:05:16 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 890761065673; Fri, 6 Feb 2009 17:05:16 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6E3C38FC0C; Fri, 6 Feb 2009 17:05:15 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA20472; Fri, 06 Feb 2009 19:05:13 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <498C6DC9.8020700@icyb.net.ua> Date: Fri, 06 Feb 2009 19:05:13 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.19 (X11/20090110) MIME-Version: 1.0 To: John Baldwin References: <200901260947.32870.jhb@freebsd.org> <498C55BB.3030606@icyb.net.ua> <200902061143.10088.jhb@freebsd.org> <200902061155.48705.jhb@freebsd.org> In-Reply-To: <200902061155.48705.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-arch@freebsd.org Subject: Re: Trimming the default /boot/device.hints X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2009 17:05:17 -0000 on 06/02/2009 18:55 John Baldwin said the following: > On Friday 06 February 2009 11:43:09 am John Baldwin wrote: >> On Friday 06 February 2009 10:22:35 am Andriy Gapon wrote: >>> on 06/02/2009 16:37 John Baldwin said the following: >>>> Yes, it only needs the hint for it to be a console device. >>>> >>> I am slightly confused as to how that hint works then, it's not like a >>> standard isa hint it seems. >>> Can it somehow be built-in (into the code)? >> Specifically, look at sc_cnprobe() in sys/dev/syscons/syscons.c. It calls a >> sc_cons_get_priority() routine that on x86 maps lives in >> sys/isa/syscons_isa.c. This checks for a syscons hint. Changing it to >> always assume a unit 0 would probably allow this to work. > > Something like this (untested): I am not sure, but maybe, just in case, also add sc_get_softc(0,0) != NULL check? I guess device_get_softc returns NULL for non-attached/unknown devices. > --- //depot/user/jhb/acpipci/isa/syscons_isa.c > +++ /home/jhb/work/p4/acpipci/isa/syscons_isa.c > @@ -238,8 +238,10 @@ > *flags = f; > } > } > - if (*unit < 0) > - return CN_DEAD; > + if (*unit < 0) { > + *unit = 0; > + *flags = 0; > + } > #if 0 > return ((*flags & SC_KERNEL_CONSOLE) ? CN_INTERNAL : CN_NORMAL); > #endif > > -- Andriy Gapon