From owner-freebsd-arch Mon Sep 11 12:37:32 2000 Delivered-To: freebsd-arch@freebsd.org Received: from mass.osd.bsdi.com (adsl-63-202-177-115.dsl.snfc21.pacbell.net [63.202.177.115]) by hub.freebsd.org (Postfix) with ESMTP id 5963937B423; Mon, 11 Sep 2000 12:37:27 -0700 (PDT) Received: from mass.osd.bsdi.com (localhost [127.0.0.1]) by mass.osd.bsdi.com (8.9.3/8.9.3) with ESMTP id MAA14055; Mon, 11 Sep 2000 12:36:41 -0700 (PDT) (envelope-from msmith@mass.osd.bsdi.com) Message-Id: <200009111936.MAA14055@mass.osd.bsdi.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: mjacob@feral.com Cc: Poul-Henning Kamp , arch@FreeBSD.ORG, smp@FreeBSD.ORG Subject: Re: Device probing... In-reply-to: Your message of "Mon, 11 Sep 2000 08:00:04 PDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 11 Sep 2000 12:36:41 -0700 From: Mike Smith Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > The only theoretical problem with this is if you ever want to do a BOOT > driver based autoload mechanism. Currently FreeBSD has the ability to load > (preload) modules. If, in the future, you want to load modules after > loading a primary kernel object but before configuring your root device's > bus and driver stack, you need to do callbacks to a PROM driver. It's even > harder to do this if you've enabled interrupts (or even changed MMU > mappings, btw). Doing this on a PC is so problematic that the various PnP specifications that try to offload all of the resource management work onto the OS still talk about allocating resources for the "boot path". It's actually *extremely* difficult to do this, unless you have absolute knowledge of the mapping between "PROM device" and "kernel-space device". Consider the situation where you have initialised your disk driver, but want to use the "PROM driver" interface still to fetch another driver. Because (in the PC environment) you simply can't tell that the disk driver you've already initialised has taken over the hardware that the "PROM driver" path would use, you're stuck. In reality, this is less of an issue simply because most probing we do these days is entirely metainformation-based. How many of our probe routines actually do more than passive metainformation comparisons? > p.s.: FWIW, I'm *for* you doing this. I *hate* having to support polled mode > in drivers. I'm inclined to agree with this here. > On Sat, 9 Sep 2000, Poul-Henning Kamp wrote: > > > I would really like to se us move all the device probe/attach code > > to run in "normal context", ie enable interrupts before we probe > > everything. Most of the reasons for not doing this have gone away. We do need to re-order a few things though. Note that this will make it "interesting" if we want to support the interrupt hardware with "normal" drivers. > > The main argument for this is the drivers can then use the full > > complement of kernel infrastructure and interrupts during probe > > attach. > > > > Drivers needs to be able to function in this environment anyway > > if they support removeable devices (pccard, usb, etc). > > > > Are there reasons to not do this I have overlooked ? The biggest one that's left is that a lot of drivers will end up printing things in interrupt context, leading to *incredibly* messy console output. We'll need a cleaner way of presenting driver messages. -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message