From owner-freebsd-arch@FreeBSD.ORG Wed May 11 17:10:50 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 599C9106564A; Wed, 11 May 2011 17:10:50 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id B93AC8FC13; Wed, 11 May 2011 17:10:49 +0000 (UTC) Received: by bwz12 with SMTP id 12so886299bwz.13 for ; Wed, 11 May 2011 10:10:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.71.193 with SMTP id i1mr1056186bkj.102.1305133848454; Wed, 11 May 2011 10:10:48 -0700 (PDT) Received: by 10.204.36.2 with HTTP; Wed, 11 May 2011 10:10:48 -0700 (PDT) In-Reply-To: <4DCA684B.4020400@FreeBSD.org> References: <4DC95006.1020404@FreeBSD.org> <4DCA684B.4020400@FreeBSD.org> Date: Wed, 11 May 2011 13:10:48 -0400 Message-ID: From: Doug Rabson To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD Arch Subject: Re: arch-independent disks in sys/boot, libstand X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 17:10:50 -0000 On 11 May 2011 06:43, Andriy Gapon wrote: > on 11/05/2011 12:16 Doug Rabson said the following: > > There is an example of this in sys/boot/zfs. The approach taken is to > scan > > physical drives as they appear and piece them together into ZFS pools > based on the > > drive metadata. The pools appear as devices in the device table and the > actual ZFS > > filesystem reader is built on top of that. > > Yes, thank you, I've seen that code. > My question was not specific enough - I am interested in the things like > i386_fmtdev vs other archs, i386_parsedev vs other archs, struct > i386_devdesc vs > other archs, etc. > I.e. I would like to make ZFS representable (in some shape) via struct > devdesc. > But it seems that every supported arch has its own extension of struct > devdesc > that it uses and its own set of functions to work with that struct. > Or, using another example, I'd like to be able to specify something like > "zfs:/pool/fs:/boot/kernel" as a kernel name and have that work for all > archs. > I'd hate to duplicate code that would handle that acress all xxx_parsedev > implementations for all architectures. > The fmtdev/parsedev stuff is a huge mess. In many if not all cases, the device and partition code is identical across the different arches and should be shared.