From owner-freebsd-hackers@freebsd.org Mon Dec 25 23:16:07 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1402BE80DE1 for ; Mon, 25 Dec 2017 23:16:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id E088F77981 for ; Mon, 25 Dec 2017 23:16:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mailman.ysv.freebsd.org (Postfix) id DFE4BE80DE0; Mon, 25 Dec 2017 23:16:06 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF87AE80DDF for ; Mon, 25 Dec 2017 23:16:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A36BC7797F for ; Mon, 25 Dec 2017 23:16:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22a.google.com with SMTP id z6so21021634iti.4 for ; Mon, 25 Dec 2017 15:16:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=pok2ezpPoFHplItpn6yU0uLbkFeNjqWMvxLnAUgQqjk=; b=ywk9IZ5c1rGj0UbKAM6ViWyJdMsTakMIKRHHd2OtIXgIlUNLLd3hrXx0Q6BbD8Q2/U Pob7/w3MRRAosKBhl85IznNWS1Ade2z4b9wDz6ZxWh6pmwq9sCkKa5IuZ8R5UGl+fPLy 9lAYfyzyBi7xupDjYhiEenPpU6/VRZYpE+YsHl1bGcacdJ7OiFiC3uHzFcTDB7Rxek0E dDLlIQw926hTbQD9TH0r0Yw6w5g2fluTWCrhHWRX7C9fK4fov+HD2DExI25K4P+/uEBO xk8Hnz8OrdGTwnA8GsTJhtSbPe8HOjBUU6zudtqe+Sk3jdrwISymLUn9Dlr9O9zBiHRz DMsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=pok2ezpPoFHplItpn6yU0uLbkFeNjqWMvxLnAUgQqjk=; b=P0ue7IYT3+Z45KPNsP+1jOQh873uWeSG7ciIfjB3LI8gGWh/M7riulRVcSO0jNQMUe uHuRHX8ma8FssEPEl8lKYx+IR3eMsditY9YQR3nSiSUkKnrx0vJMZmHPVJObsaGzEqs1 bvS8JU4tOSeJB9aEbMbQrc3mbmot5EP2dxqgXHrx2e3iuJPKDzuu5rpGP4gYNIEZVWqX rOJvY/V4Yk4r1JRN4Ua+ei1epF9X9sdQaG093s2Xa9n6GJoMyuuzKzLQEc/oHHWar7dc psxl8zu0qEthfrPLZcgSkwQ+NoZsPIwfXsD6uYldTVcWvrSw2YhGu10AUsFCJP/qVhW6 7hfA== X-Gm-Message-State: AKGB3mL6PaR12wB+f2yGSoPHgXRE8cnV45HiD1KGNgXeK0aMPpDzPIiE dSO8bJLwYM8ypggXlo6G95+T97eWy3NYXMnk5RvfZA== X-Google-Smtp-Source: ACJfBos10moNB3SdjdbsYkll4fPeyG1D5AwJBzZI+em/vXEVfUCvbryKHRcqDZabLbMUXFmy8gsWcrJVmFyBA/Y73rs= X-Received: by 10.36.77.143 with SMTP id l137mr30761881itb.50.1514243765858; Mon, 25 Dec 2017 15:16:05 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Mon, 25 Dec 2017 15:16:05 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20171225224458.e925f49181221a2315a1974f@bidouilliste.com> References: <20171225224458.e925f49181221a2315a1974f@bidouilliste.com> From: Warner Losh Date: Mon, 25 Dec 2017 16:16:05 -0700 X-Google-Sender-Auth: 3FmxZSFcGxmknl0CdBf2ZiV5kC0 Message-ID: Subject: Re: devmatch(8) committed .... To: Emmanuel Vadot Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 23:16:07 -0000 On Mon, Dec 25, 2017 at 2:44 PM, Emmanuel Vadot wrote: > > Hello Warner, > > On Mon, 25 Dec 2017 11:57:10 -0700 > Warner Losh wrote: > > > I've committed devmatch(8) to the tree in r327176. It's a building block > > for automating the loading of modules. While we can load modules today by > > adding FOO_load=YES to loader.conf, there's no easy way to load only the > > modules you need based on the hardware you have in the system. > devmatch(8) > > provides the base framework to allow one to do that. It does this my > > looking at the PNP tables recorded in /boot/kernel/linker.hints. > > > > The version I've committed doesn't have the devd nor the rc.d > integration. > > I've committed it for people to play with and give me feedback while > those > > parts are finalized (and while other bugs are fixed). I don't intend to > > commit them until the kinks are worked out. > > > > Some notes: > > > > (1) You'll need a newly built kernel. Older kernels have minor bugs that > > allowed the terminating sentinel to be included in linker hints. All > known > > oens, at least for amd64, have been fixed. > > (2) Lots and lots of drivers need to have their plug and play tables > > decorated. This is where I need people's help. I'll be writing up > something > > for those that want to help. ISAPNP, PC Card and USB drivers already have > > this data. A few PCI drivers have it, and almost no ACPI drivers. The > data > > is generally there, just not properly decorated for devmatch(8) and > > kldxref(8) to do their thing. > > (3) There's an issue with the USB pnp data. It's too long for the current > > devinfo(3) interfaces. I have fixes in the works to correct this. I could > > just bump the limits, but I want to do something more general and long > term. > > (4) The end game for this is a GENERIC with most of the drivers removed > > that loads drivers automatically. Bootable storage drivers will have to > > remain for now until the loader can make use of this code.This is why the > > warning about hinted ISA devices went into the tree this week. > > (5) modules will print more than once. also the if_em/if_igb driver is a > > hard link so both of those will always print. > > > > Please send me your feedback. Happy Holidays! > > > > Warner > > This is all excellent news I can't wait to try. > > I've not currently started to look at the code but have you thought of > fdt based system ? I would love a minimal GENERIC arm/arm64 kernel with > everything else in modules. > I know we still have to do a lot of work in the arm world to make > almost everything usable in module form. > It's completely bus agnostic. There's no code in devmatch() that knows anything at all about any specific bus. fdt is easier than most because it's just a simple string compare and several of the drivers are already properly decorated. Warner