From owner-freebsd-sparc64@FreeBSD.ORG Mon Mar 15 23:34:08 2004 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 47E4D16A4CE for ; Mon, 15 Mar 2004 23:34:08 -0800 (PST) Received: from electra.cse.Buffalo.EDU (electra.cse.Buffalo.EDU [128.205.32.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E8A343D45 for ; Mon, 15 Mar 2004 23:34:08 -0800 (PST) (envelope-from kensmith@cse.Buffalo.EDU) Received: from electra.cse.Buffalo.EDU (kensmith@localhost [127.0.0.1]) i2G7Y72Z017569; Tue, 16 Mar 2004 02:34:07 -0500 (EST) Received: (from kensmith@localhost) by electra.cse.Buffalo.EDU (8.12.10/8.12.9/Submit) id i2G7Y72a017568; Tue, 16 Mar 2004 02:34:07 -0500 (EST) Date: Tue, 16 Mar 2004 02:34:06 -0500 From: Ken Smith To: Marcel Moolenaar Message-ID: <20040316073406.GC17054@electra.cse.Buffalo.EDU> References: <20040316055650.GA15182@electra.cse.Buffalo.EDU> <20040316064541.GA12961@dhcp01.pn.xcllnt.net> <20040316070004.GA16684@electra.cse.Buffalo.EDU> <20040316070937.GA13045@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040316070937.GA13045@dhcp01.pn.xcllnt.net> User-Agent: Mutt/1.4.1i cc: Ken Smith cc: freebsd-sparc64@freebsd.org Subject: Re: Console patch part II... X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Mar 2004 07:34:08 -0000 On Mon, Mar 15, 2004 at 11:09:37PM -0800, Marcel Moolenaar wrote: > You need to fix the code to call cninit() soon enough that you > never need to panic before it? Expanding slightly... cninit() currently is before the first printf()'s or calls to panic(). But it can't stay there, at least some of the potential consoles (e.g. Kris's Creator-3D) wind up calling make_dev() and that was causing his panic's. Alpha had this same problem and the end solution for alpha is more or less identical to what I'm proposing with the kludge hack. On alpha we now use promcons (guaranteed to be available no matter what arch) early on, then call cninit() later when it's "safe". The analogy on sparc64 would be to use the ofw_console initially, and then again call cninit() later when it's safe. As far as I can tell these are the possible solutions: - Find out what the *minimum* stuff needed to make make_dev() happy and move that above the current location of cninit() I tried that but wasn't very successful, I can try harder I guess. - Move cninit() to after proc0 gets set up and live with not seeing anything useful printf()-wise or panic()-wise. :-) - The current suggested solution - minimal and omniscent console setup early on, ditch it and call cninit() once it's safe to do that. - [ This is a new thought... ] Restructure all the potential console drivers to be like ofw_console is. ofw_console doesn't call make_dev() in its attach routine. Instead it uses a sysinit() to handle the make_dev() later in the boot sequence instead of doing at attach time. And as always me not really understanding this stuff is a possibility... -- Ken Smith - From there to here, from here to | kensmith@cse.buffalo.edu there, funny things are everywhere. | - Theodore Geisel |