From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 4 16:27:01 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B4531065670 for ; Sat, 4 Feb 2012 16:27:01 +0000 (UTC) (envelope-from monthadar@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id CB3608FC12 for ; Sat, 4 Feb 2012 16:27:00 +0000 (UTC) Received: by iaeo4 with SMTP id o4so9637862iae.13 for ; Sat, 04 Feb 2012 08:27:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=FMuqkpefO29NTl2IjoSHKbGLFRnjS3AoUcMFYAxGKEQ=; b=aeJ7L7F9Bn3T4Qrd2Bl+V8K/OFekRpfD2kPZrKUPlWBuylU45dUXNMliN+M2TYD/zu GFBfp/GqrheWIymHnhsN8Bs31BDikUB5KenLWm1H93aUu8wEI9GEQiyUsaBgCnQVa0vs AYPcrAm5wMuBP6ZDZBmG6E4EOzcn8K36emM8s= MIME-Version: 1.0 Received: by 10.50.208.41 with SMTP id mb9mr13548823igc.25.1328370988525; Sat, 04 Feb 2012 07:56:28 -0800 (PST) Received: by 10.50.213.74 with HTTP; Sat, 4 Feb 2012 07:56:28 -0800 (PST) In-Reply-To: <20120202122503.759c9e6e.ray@ddteam.net> References: <20120202122503.759c9e6e.ray@ddteam.net> Date: Sat, 4 Feb 2012 16:56:28 +0100 Message-ID: From: Monthadar Al Jaberi To: Aleksandr Rybalko Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: dynamic attach of hinted devices 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: Sat, 04 Feb 2012 16:27:01 -0000 On Thu, Feb 2, 2012 at 11:25 AM, Aleksandr Rybalko wrote: > Hi FreeBSD hackers, > > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > No opinions on arch@, so i will try at hackers@, since here is bigger > audience :) > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > at first I want to say this: :) > WARNING: FOLLOWING DEVCTL PATCH MAY EASILY PANIC YOUR SYSTEM, PLEASE > DO NOT TRY IT ON PRODUCTION SERVERS AND TRY IT WITH FILESYSTEMS MOUNTED > AS READONLY :))))) > > So I introduce two patches first one [1] used to migrate from > static_hints or hints in the static_kenv to dynamic hints. > > sysctl kern.hintmode=2 will copy hints from static hints or from static > kenv and put it into dynamic kenv. Those will allow to manipulate hints > values and attach hinted devices with devctl tool. > > Second [2] allow attach/detach devices with userland tool devctl. > > devctl tool allow add and initialize new devices which is not able to > be auto-enumerating, such a hinted devices. > > Both designed to have ability update EEPROM items in runtime, since > some device can't work in mode when it accessible like a EEPROM chip. > > Example: > # sysctl kern.hintmode=2 > # kenv hint.mx25l.0.at="spibus0" > # kenv hint.mx25l.0.cs=0 > # kenv hint.mx25l.0.chipname="at25128" > # devctl hinted spibus 0 mx25l 0 > mx25l0: at cs 0 mode 0 on spibus0 > mx25l0: at25128, sector 64 bytes, 256 sectors > GEOM: new disk flash/spi0 This is nice. I tried it on a generic device and it loaded with a hint flawlessly :) > > Someone may found it also useful for testing device attach/detach code > (memory leaks, resource allocation, etc). Couldnt it also be useful for redirecting data, for example attaching a flash memory to your own bus and then out through something else? Or it could also help in testing and verifying interaction between userspace and driver without having real hardware and not modifying hint file/recompile. > > So, say me please your opinion. Good work, its always a plus for development with dynamic tools! > > 1. http://my.ddteam.net/files/2012-01-31.to_dynamic_hints.patch > 2. http://my.ddteam.net/files/2012-01-31.devctl2.patch > > WBW > -- > Aleksandr Rybalko > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" -- Monthadar Al Jaberi