From owner-freebsd-emulation@FreeBSD.ORG Tue Apr 3 11:47:55 2007 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E609616A40B; Tue, 3 Apr 2007 11:47:55 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id 8166313C458; Tue, 3 Apr 2007 11:47:55 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p54A5D542.dip.t-dialin.net [84.165.213.66]) by redbull.bpaserver.net (Postfix) with ESMTP id DCB692E04C; Tue, 3 Apr 2007 13:47:50 +0200 (CEST) Received: from webmail.leidinger.net (webmail.Leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id C16CB5B4817; Tue, 3 Apr 2007 13:47:47 +0200 (CEST) Received: (from www@localhost) by webmail.leidinger.net (8.13.8/8.13.8/Submit) id l33Bllgd048700; Tue, 3 Apr 2007 13:47:47 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde MIME library) with HTTP; Tue, 03 Apr 2007 13:47:47 +0200 Message-ID: <20070403134747.gtie10l8g04os8k0@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Tue, 03 Apr 2007 13:47:47 +0200 From: Alexander Leidinger To: Roman Divacky References: <02e101c77557$c5a68e60$50f3ab20$@org> <20070402204557.GA49440@freebsd.org> <20070402154835.F9231@thebighonker.lerctr.org> <20070402212855.GA50351@freebsd.org> <20070402164027.I11442@thebighonker.lerctr.org> <20070402214258.GA50571@freebsd.org> In-Reply-To: <20070402214258.GA50571@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.3) / FreeBSD-7.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-15.287, required 8, autolearn=not spam, BAYES_00 -15.00, DK_POLICY_SIGNSOME 0.00, FORGED_RCVD_HELO 0.14, SMILEY -0.50, TW_OC 0.08) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: freebsd-emulation@freebsd.org Subject: Re: /dev/sga (Linux) SCSI Command Stuff X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2007 11:47:56 -0000 Quoting Roman Divacky (from Mon, 2 Apr 2007 =20 23:42:58 +0200): > On Mon, Apr 02, 2007 at 04:41:35PM -0500, Larry Rosenman wrote: >> On Mon, 2 Apr 2007, Roman Divacky wrote: >> >> >On Mon, Apr 02, 2007 at 03:50:23PM -0500, Larry Rosenman wrote: >> >>Also, we don't (AFAIK) expose /dev/sga to the linux world through the >> >>linux-o-lator so I don't even know if what I want is possible. >> > >> >hehe.. guess what.. netbsd supports that :) at least partially. so PLEAS= E >> >test the netbsd somehow so we know that the netbsd support is sufficient >> The box is 150+ miles away stuffed in a colo. It's also my main DNS / Ma= il >> / >> Web server. >> >> Sorry, but I don't think I can do that, at least with the scsi drive. >> >> I do have a new box coming that will have Seagate SATA drives, and might = be >> able to test that..... > > I am in a good mood so I guess I'll port the stuff from netbsd =20 > tomorrow. it looks > very easy. I hope you will test :) linux_util.c rev. 1.30: ---snip--- Enhance the Linux emulation layer to make MegaRAID SAS managements =20 tool happy. Add back in a scheme to emulate old type major/minor numbers via hooks in= to stat, linprocfs to return major/minors that Linux app's expect. Currentl= y only /dev/null is always registered. Drivers can register via the Linux type shim similar to the ioctl shim but by using linux_device_register_handler/linux_device_unregister_handler functions. The structure is: struct linux_device_handler { char *bsd_driver_name; char *linux_driver_name; char *bsd_device_name; char *linux_device_name; int linux_major; int linux_minor; int linux_char_device; }; Linprocfs uses this to display the major number of the driver. The soon to be available linsysfs will use it to fill in the driver name. Linux_stat uses it to translate the major/minor into Linux type values. ---snip--- I didn't look at the implementation, but this struct looks like an =20 translation layer... Bye, Alexander. --=20 BOFH excuse #139: UBNC (user brain not connected) http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID =3D B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID =3D 72077137