From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 11 19:24:54 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A9AAF16A4DD for ; Tue, 11 Jul 2006 19:24:54 +0000 (UTC) (envelope-from nitro@263.net) Received: from smtp.263.net (smtp.x263.net [211.150.96.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 272DE43D6E for ; Tue, 11 Jul 2006 19:24:52 +0000 (GMT) (envelope-from nitro@263.net) Received: from origin.intron.ac (unknown [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 72436F17BC for ; Wed, 12 Jul 2006 03:24:52 +0800 (CST) X-KSVirus-check: 0 References: <200607111115.59844.jhb@freebsd.org> <20060711.103327.-8650905.imp@bsdimp.com> <200607111413.37238.jhb@freebsd.org> In-Reply-To: <200607111413.37238.jhb@freebsd.org> From: mag@intron.ac To: John Baldwin Date: Wed, 12 Jul 2006 03:21:53 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-Id: <1152645891.31335@origin.intron.ac> X-Mailman-Approved-At: Wed, 12 Jul 2006 00:08:20 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: kern/99979: Get Ready for Kernel Module in C++ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2006 19:24:54 -0000 John Baldwin wrote: > On Tuesday 11 July 2006 12:33, M. Warner Losh wrote: >> In message: <200607111115.59844.jhb@freebsd.org> >> John Baldwin writes: >> : and OS X both of which I've written a PCI driver for) we require device >> : driver writers to go through a lot more hoops to do certain things like >> : allocate resources. At the very least there is much that can be improved > in >> : our driver model. >> >> bus_alloc_resources goes a long ways in this respect. > > Yes, but in OS X I didn't even have to do that. All I had to do was ask it to > map a BAR if I wanted to use it. It already "allocated" all the resources > regardless. Windows was the same way (though a bit weirder, you get a > message that lists all your resources and you have to map them if you want to > use them). > > -- > John Baldwin Do you mean that the kernel pre-allocate resources for all devices whether a device has been attached by a device driver? Does BIOS do the same thing before OS boots? ------------------------------------------------------------------------ From Beijing, China