From owner-rawio@oss.sgi.com Fri Mar 24 12:12:37 2000 Received: by oss.sgi.com id ; Fri, 24 Mar 2000 12:12:27 -0800 Received: from adsl-63-194-89-126.dsl.snfc21.pacbell.net ([63.194.89.126]:24080 "HELO skull.piratehaven.org") by oss.sgi.com with SMTP id ; Fri, 24 Mar 2000 12:12:08 -0800 Received: (qmail 13274 invoked by uid 1012); 24 Mar 2000 20:12:07 -0000 Date: Fri, 24 Mar 2000 12:12:07 -0800 From: Brian Pomerantz To: rawio@oss.sgi.com Subject: Ping Message-ID: <20000324121207.A12999@skull.piratehaven.org> Mail-Followup-To: rawio@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i X-homepage: http://www.piratehaven.org/~bapper/ Sender: owner-rawio@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;rawio-outgoing I'm a Linux developer at LLNL and am currently working on squeezing as much performance out of a couple of RAID systems on Alpha Linux as I possibly can. Right now I'm working on getting some QLogic QLA2200 going as well as a rack of 8 Ciprico Rimfire 7010's going. I guess the performance numbers under Irix are around 50MB/s writes per controller and 90MB/s reads. I'm hoping to attain this performance or better with the rawio patches. So my question is, is this stuff still being worked on and if so, are there plans on working it into the kernel? I think I saw that Steven Tweedie's work is already in the 2.3.xx tree, what sort of difference in performance can I expect between the SGI changes and the work that Steven Tweedie has done? BAPper From owner-rawio@oss.sgi.com Fri Mar 24 14:46:35 2000 Received: by oss.sgi.com id ; Fri, 24 Mar 2000 14:46:25 -0800 Received: from deliverator.sgi.com ([204.94.214.10]:38983 "EHLO deliverator.sgi.com") by oss.sgi.com with ESMTP id ; Fri, 24 Mar 2000 14:46:06 -0800 Received: from griffin.engr.sgi.com (griffin.engr.sgi.com [163.154.5.72]) by deliverator.sgi.com (980309.SGI.8.8.8-aspam-6.2/980310.SGI-aspam) via ESMTP id OAA21134 for ; Fri, 24 Mar 2000 14:41:27 -0800 (PST) mail_from (slurn@griffin.engr.sgi.com) Received: (from slurn@localhost) by griffin.engr.sgi.com (980427.SGI.8.8.8/960327.SGI.AUTOCF) id OAA27600; Fri, 24 Mar 2000 14:44:25 -0800 (PST) From: slurn@griffin.engr.sgi.com (Scott Lurndal) Message-Id: <200003242244.OAA27600@griffin.engr.sgi.com> Subject: Re: Ping To: bapper@piratehaven.org (Brian Pomerantz) Date: Fri, 24 Mar 2000 14:44:25 -0800 (PST) Cc: rawio@oss.sgi.com In-Reply-To: <20000324121207.A12999@skull.piratehaven.org> from "Brian Pomerantz" at Mar 24, 2000 12:12:07 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-rawio@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;rawio-outgoing > > I'm a Linux developer at LLNL and am currently working on squeezing as > much performance out of a couple of RAID systems on Alpha Linux as I > possibly can. Right now I'm working on getting some QLogic QLA2200 > going as well as a rack of 8 Ciprico Rimfire 7010's going. I guess There is a driver from qlogic (qla2100.c) in the SGI propack which performs quite a bit better (and more reliably) than the qlogicfc driver in the standard linux trees. (propack is on http://oss.sgi.com) > the performance numbers under Irix are around 50MB/s writes per > controller and 90MB/s reads. I'm hoping to attain this performance or > better with the rawio patches. So my question is, is this stuff still To a certain extent, the performance also depends on the system chipset - some intel motherboards for example won't do more than 70 or 80 mbytes/sec on the pci bus. > being worked on and if so, are there plans on working it into the > kernel? I think I saw that Steven Tweedie's work is already in the > 2.3.xx tree, what sort of difference in performance can I expect > between the SGI changes and the work that Steven Tweedie has done? There are two key differences in the sgi raw I/O over what is in 2.3: 1) Device naming (/dev/raw pseudo devices in SCT vs. /dev/rsd* character devices in SGI patch) 2) I/O size (SCT patch breaks all raw I/O up into 1 or 4k chunks. SGI patch will issue full sized I/O's (up to 1Mb per I/O)). We'll have a 2.3.99pre patch next week sometime. scott > > > BAPper > From owner-rawio@oss.sgi.com Fri Mar 24 15:00:05 2000 Received: by oss.sgi.com id ; Fri, 24 Mar 2000 14:59:55 -0800 Received: from adsl-63-194-89-126.dsl.snfc21.pacbell.net ([63.194.89.126]:17926 "HELO skull.piratehaven.org") by oss.sgi.com with SMTP id ; Fri, 24 Mar 2000 14:59:34 -0800 Received: (qmail 19529 invoked by uid 1012); 24 Mar 2000 22:59:34 -0000 Date: Fri, 24 Mar 2000 14:59:34 -0800 From: Brian Pomerantz To: rawio@oss.sgi.com Subject: Re: Ping Message-ID: <20000324145934.A19118@skull.piratehaven.org> Mail-Followup-To: rawio@oss.sgi.com References: <20000324121207.A12999@skull.piratehaven.org> <200003242244.OAA27600@griffin.engr.sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: <200003242244.OAA27600@griffin.engr.sgi.com>; from slurn@griffin.engr.sgi.com on Fri, Mar 24, 2000 at 02:44:25PM -0800 X-homepage: http://www.piratehaven.org/~bapper/ Sender: owner-rawio@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;rawio-outgoing On Fri, Mar 24, 2000 at 02:44:25PM -0800, Scott Lurndal wrote: > > > > I'm a Linux developer at LLNL and am currently working on squeezing as > > much performance out of a couple of RAID systems on Alpha Linux as I > > possibly can. Right now I'm working on getting some QLogic QLA2200 > > going as well as a rack of 8 Ciprico Rimfire 7010's going. I guess > > There is a driver from qlogic (qla2100.c) in the SGI propack which > performs quite a bit better (and more reliably) than the qlogicfc > driver in the standard linux trees. (propack is on http://oss.sgi.com) > Will this driver work under Alpha Linux? I guess I'll download it and give it a try. > > > the performance numbers under Irix are around 50MB/s writes per > > controller and 90MB/s reads. I'm hoping to attain this performance or > > better with the rawio patches. So my question is, is this stuff still > > To a certain extent, the performance also depends on the system > chipset - some intel motherboards for example won't do more than > 70 or 80 mbytes/sec on the pci bus. On our ES40s (quad Alpha cpus), we are seeing about 212MB/s maximum throughput on the PCI bus so we shouldn't have a problem there. > > > being worked on and if so, are there plans on working it into the > > kernel? I think I saw that Steven Tweedie's work is already in the > > 2.3.xx tree, what sort of difference in performance can I expect > > between the SGI changes and the work that Steven Tweedie has done? > > There are two key differences in the sgi raw I/O over what > is in 2.3: > > 1) Device naming (/dev/raw pseudo devices in SCT vs. > /dev/rsd* character devices in SGI patch) > > 2) I/O size (SCT patch breaks all raw I/O up into 1 or 4k > chunks. SGI patch will issue full sized > I/O's (up to 1Mb per I/O)). > > We'll have a 2.3.99pre patch next week sometime. > Do you know what the chances of this stuff making its way into the main Linux kernel are? It sounds to me, without having used either of these patches yet, that the approach SGI is taking is a little more robust and easier for developers to utilize. I would like to minimize the number of dependencies we have on foreign patches as I don't really want to have to maintain things that aren't part of the regular kernel if the original developers stop maintenance. As it is we have quite a few changes we've had to make to the kernel for our cluster work. Hopefully we'll have these changes made public soon and can work on getting them accepted into the main kernel tree. BAPper BAPper From owner-rawio@oss.sgi.com Fri Mar 24 15:30:54 2000 Received: by oss.sgi.com id ; Fri, 24 Mar 2000 15:30:45 -0800 Received: from deliverator.sgi.com ([204.94.214.10]:40540 "EHLO deliverator.sgi.com") by oss.sgi.com with ESMTP id ; Fri, 24 Mar 2000 15:30:38 -0800 Received: from griffin.engr.sgi.com (griffin.engr.sgi.com [163.154.5.72]) by deliverator.sgi.com (980309.SGI.8.8.8-aspam-6.2/980310.SGI-aspam) via ESMTP id PAA25999 for ; Fri, 24 Mar 2000 15:25:59 -0800 (PST) mail_from (slurn@griffin.engr.sgi.com) Received: (from slurn@localhost) by griffin.engr.sgi.com (980427.SGI.8.8.8/960327.SGI.AUTOCF) id PAA26054; Fri, 24 Mar 2000 15:27:57 -0800 (PST) From: slurn@griffin.engr.sgi.com (Scott Lurndal) Message-Id: <200003242327.PAA26054@griffin.engr.sgi.com> Subject: Re: Ping To: bapper@piratehaven.org (Brian Pomerantz) Date: Fri, 24 Mar 2000 15:27:57 -0800 (PST) Cc: rawio@oss.sgi.com In-Reply-To: <20000324145934.A19118@skull.piratehaven.org> from "Brian Pomerantz" at Mar 24, 2000 02:59:34 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-rawio@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;rawio-outgoing > > On Fri, Mar 24, 2000 at 02:44:25PM -0800, Scott Lurndal wrote: > > > > > > I'm a Linux developer at LLNL and am currently working on squeezing as > > > much performance out of a couple of RAID systems on Alpha Linux as I > > > possibly can. Right now I'm working on getting some QLogic QLA2200 > > > going as well as a rack of 8 Ciprico Rimfire 7010's going. I guess > > > > There is a driver from qlogic (qla2100.c) in the SGI propack which > > performs quite a bit better (and more reliably) than the qlogicfc > > driver in the standard linux trees. (propack is on http://oss.sgi.com) > > > > Will this driver work under Alpha Linux? I guess I'll download it and > give it a try. I don't believe that there are any intelisms in the driver, but I've not tried it on alpha myself. It came directly from qlogic and is based upon their master source tree (which supports most proprietary unices) so I suspect it will work fine. > > > > > > the performance numbers under Irix are around 50MB/s writes per > > > controller and 90MB/s reads. I'm hoping to attain this performance or > > > better with the rawio patches. So my question is, is this stuff still > > > > To a certain extent, the performance also depends on the system > > chipset - some intel motherboards for example won't do more than > > 70 or 80 mbytes/sec on the pci bus. > > On our ES40s (quad Alpha cpus), we are seeing about 212MB/s maximum > throughput on the PCI bus so we shouldn't have a problem there. On a single bus? Ah, alpha - 64 bit PCI bus, right? Is it 33mhz or 66 mhz? > > > > > > being worked on and if so, are there plans on working it into the > > > kernel? I think I saw that Steven Tweedie's work is already in the > > > 2.3.xx tree, what sort of difference in performance can I expect > > > between the SGI changes and the work that Steven Tweedie has done? > > > > There are two key differences in the sgi raw I/O over what > > is in 2.3: > > > > 1) Device naming (/dev/raw pseudo devices in SCT vs. > > /dev/rsd* character devices in SGI patch) > > > > 2) I/O size (SCT patch breaks all raw I/O up into 1 or 4k > > chunks. SGI patch will issue full sized > > I/O's (up to 1Mb per I/O)). > > > > We'll have a 2.3.99pre patch next week sometime. > > > > Do you know what the chances of this stuff making its way into the > main Linux kernel are? It sounds to me, without having used either of > these patches yet, that the approach SGI is taking is a little more > robust and easier for developers to utilize. I would like to minimize I tend to agree with the above characterization - particularly that the interface via the character device is exactly the same on all flavors of unix. The linux /dev/raw stuff is an anomoly and limits one to 256 raw partitions - a significant limitation on large systems. Insofar as acceptance goes, I'm trying to craft the patch in such a way that it won't be objectionable to the community - but no guarantees. We are willing to work with the community to ensure acceptance eventually. It is likely that the XFS work will make use of the scsi raw stuff for performance reasons, so we may push it through that vehicle - xfs should be released shortly (perhaps next month). scott > the number of dependencies we have on foreign patches as I don't > really want to have to maintain things that aren't part of the regular > kernel if the original developers stop maintenance. As it is we have > quite a few changes we've had to make to the kernel for our cluster > work. Hopefully we'll have these changes made public soon and can > work on getting them accepted into the main kernel tree. > > > BAPper > > > BAPper > From owner-rawio@oss.sgi.com Fri Mar 24 15:42:05 2000 Received: by oss.sgi.com id ; Fri, 24 Mar 2000 15:41:54 -0800 Received: from adsl-63-194-89-126.dsl.snfc21.pacbell.net ([63.194.89.126]:23118 "HELO skull.piratehaven.org") by oss.sgi.com with SMTP id ; Fri, 24 Mar 2000 15:41:47 -0800 Received: (qmail 23586 invoked by uid 1012); 24 Mar 2000 23:41:47 -0000 Date: Fri, 24 Mar 2000 15:41:47 -0800 From: Brian Pomerantz To: rawio@oss.sgi.com Subject: Re: Ping Message-ID: <20000324154147.A22488@skull.piratehaven.org> Mail-Followup-To: rawio@oss.sgi.com References: <20000324145934.A19118@skull.piratehaven.org> <200003242327.PAA26054@griffin.engr.sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: <200003242327.PAA26054@griffin.engr.sgi.com>; from slurn@griffin.engr.sgi.com on Fri, Mar 24, 2000 at 03:27:57PM -0800 X-homepage: http://www.piratehaven.org/~bapper/ Sender: owner-rawio@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;rawio-outgoing On Fri, Mar 24, 2000 at 03:27:57PM -0800, Scott Lurndal wrote: > > I don't believe that there are any intelisms in the driver, but > I've not tried it on alpha myself. It came directly from qlogic > and is based upon their master source tree (which supports most > proprietary unices) so I suspect it will work fine. > Okay, cool. > > > > On our ES40s (quad Alpha cpus), we are seeing about 212MB/s maximum > > throughput on the PCI bus so we shouldn't have a problem there. > > On a single bus? Ah, alpha - 64 bit PCI bus, right? Is it 33mhz or > 66 mhz? Yup, single bus. We are seeing this throughput on a Quadrics Elan interconnect. What I am hoping to do is have my file system on one bus and the Elan on the other bus and hopefully saturate the link on the Elan with file I/O. I'm pretty sure these PCI busses are 33MHz. The Elan supports 400MB/s on the wire and is capable of 66MHz so I would think we would be seeing better performance out of it if it were 66MHz. I also think I read it was 33MHz in the owner's manual. :) > > > > Do you know what the chances of this stuff making its way into the > > main Linux kernel are? It sounds to me, without having used either of > > these patches yet, that the approach SGI is taking is a little more > > robust and easier for developers to utilize. I would like to minimize > > I tend to agree with the above characterization - particularly that > the interface via the character device is exactly the same on > all flavors of unix. The linux /dev/raw stuff is an anomoly > and limits one to 256 raw partitions - a significant limitation > on large systems. > > Insofar as acceptance goes, I'm trying to craft the patch in > such a way that it won't be objectionable to the community - > but no guarantees. We are willing to work with the community > to ensure acceptance eventually. It is likely that the XFS > work will make use of the scsi raw stuff for performance reasons, > so we may push it through that vehicle - xfs should be released > shortly (perhaps next month). > Haha! Yeah, we are trying to do the same sort of thing with some of our changes. Make the one that most people want to depend on something that isn't in the kernel already. At least this way people will see how these changes are used. If someone has a work around for us that is already in the kernel, it is fine since I would like to avoid bloat, but I seriously think that the Linux kernel is still in its infancy and has a ways to go for scaling up to ASCI level HPC. BAPper From owner-rawio@oss.sgi.com Fri Mar 24 15:58:55 2000 Received: by oss.sgi.com id ; Fri, 24 Mar 2000 15:58:46 -0800 Received: from pneumatic-tube.sgi.com ([204.94.214.22]:8230 "EHLO pneumatic-tube.sgi.com") by oss.sgi.com with ESMTP id ; Fri, 24 Mar 2000 15:58:27 -0800 Received: from griffin.engr.sgi.com (griffin.engr.sgi.com [163.154.5.72]) by pneumatic-tube.sgi.com (980327.SGI.8.8.8-aspam/980310.SGI-aspam) via ESMTP id QAA02809 for ; Fri, 24 Mar 2000 16:02:00 -0800 (PST) mail_from (slurn@griffin.engr.sgi.com) Received: (from slurn@localhost) by griffin.engr.sgi.com (980427.SGI.8.8.8/960327.SGI.AUTOCF) id PAA27712; Fri, 24 Mar 2000 15:56:45 -0800 (PST) From: slurn@griffin.engr.sgi.com (Scott Lurndal) Message-Id: <200003242356.PAA27712@griffin.engr.sgi.com> Subject: Re: Ping To: bapper@piratehaven.org (Brian Pomerantz) Date: Fri, 24 Mar 2000 15:56:45 -0800 (PST) Cc: rawio@oss.sgi.com In-Reply-To: <20000324154147.A22488@skull.piratehaven.org> from "Brian Pomerantz" at Mar 24, 2000 03:41:47 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-rawio@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;rawio-outgoing > > On Fri, Mar 24, 2000 at 03:27:57PM -0800, Scott Lurndal wrote: > > > > On a single bus? Ah, alpha - 64 bit PCI bus, right? Is it 33mhz or > > 66 mhz? > > Yup, single bus. We are seeing this throughput on a Quadrics Elan > interconnect. What I am hoping to do is have my file system on one > bus and the Elan on the other bus and hopefully saturate the link on > the Elan with file I/O. I'm pretty sure these PCI busses are 33MHz. > The Elan supports 400MB/s on the wire and is capable of 66MHz so I > would think we would be seeing better performance out of it if it were > 66MHz. I also think I read it was 33MHz in the owner's manual. :) Ok. 33mhz makes sense. That should peak at ~264 megabytes/second and with arbitration delays and bus turnaround delays accounted for, about 220 MB/sec is optimal. > > > > Insofar as acceptance goes, I'm trying to craft the patch in > > such a way that it won't be objectionable to the community - > > but no guarantees. We are willing to work with the community > > to ensure acceptance eventually. It is likely that the XFS > > work will make use of the scsi raw stuff for performance reasons, > > so we may push it through that vehicle - xfs should be released > > shortly (perhaps next month). > > > > Haha! Yeah, we are trying to do the same sort of thing with some of our > changes. Make the one that most people want to depend on something > that isn't in the kernel already. At least this way people will see > how these changes are used. If someone has a work around for us that > is already in the kernel, it is fine since I would like to avoid > bloat, but I seriously think that the Linux kernel is still in its > infancy and has a ways to go for scaling up to ASCI level HPC. Agreed. Have a good weekend, scott > > > BAPper > From owner-rawio@oss.sgi.com Thu Mar 30 10:35:15 2000 Received: by oss.sgi.com id ; Thu, 30 Mar 2000 10:35:05 -0800 Received: from adsl-63-194-89-126.dsl.snfc21.pacbell.net ([63.194.89.126]:1544 "HELO skull.piratehaven.org") by oss.sgi.com with SMTP id ; Thu, 30 Mar 2000 10:34:40 -0800 Received: (qmail 20067 invoked by uid 1012); 30 Mar 2000 18:34:30 -0000 Date: Thu, 30 Mar 2000 10:34:30 -0800 From: Brian Pomerantz To: rawio@oss.sgi.com Subject: dd Message-ID: <20000330103430.A19958@skull.piratehaven.org> Mail-Followup-To: rawio@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3us X-homepage: http://www.piratehaven.org/~bapper/ Sender: owner-rawio@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;rawio-outgoing Would it be possible to get the source code to the dd.raw file that is on the web page for the rawio patch? I just wanted it for a reference on how to use the rawio facility. Plus, I can't run it since I'm working with Linux on the Alpha platform. BAPper From owner-rawio@oss.sgi.com Thu Mar 30 11:23:54 2000 Received: by oss.sgi.com id ; Thu, 30 Mar 2000 11:23:45 -0800 Received: from pneumatic-tube.sgi.com ([204.94.214.22]:55910 "EHLO pneumatic-tube.sgi.com") by oss.sgi.com with ESMTP id ; Thu, 30 Mar 2000 11:23:31 -0800 Received: from griffin.engr.sgi.com (griffin.engr.sgi.com [163.154.5.72]) by pneumatic-tube.sgi.com (980327.SGI.8.8.8-aspam/980310.SGI-aspam) via ESMTP id LAA04600 for ; Thu, 30 Mar 2000 11:27:11 -0800 (PST) mail_from (slurn@griffin.engr.sgi.com) Received: (from slurn@localhost) by griffin.engr.sgi.com (980427.SGI.8.8.8/960327.SGI.AUTOCF) id LAA42878; Thu, 30 Mar 2000 11:21:49 -0800 (PST) From: slurn@griffin.engr.sgi.com (Scott Lurndal) Message-Id: <200003301921.LAA42878@griffin.engr.sgi.com> Subject: Re: dd To: bapper@piratehaven.org (Brian Pomerantz) Date: Thu, 30 Mar 2000 11:21:49 -0800 (PST) Cc: rawio@oss.sgi.com In-Reply-To: <20000330103430.A19958@skull.piratehaven.org> from "Brian Pomerantz" at Mar 30, 2000 10:34:30 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-rawio@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;rawio-outgoing > > Would it be possible to get the source code to the dd.raw file that is > on the web page for the rawio patch? I just wanted it for a reference > on how to use the rawio facility. Plus, I can't run it since I'm > working with Linux on the Alpha platform. > > > BAPper > I sent the diffs off to the fileutil's maintainer quite some time ago. *** /tmp/dd.c.orig Wed Jul 7 16:19:02 1999 --- dd.c Wed Jul 7 16:33:14 1999 *************** *** 532,547 **** copy (void) { unsigned char *ibuf, *bufstart; /* Input buffer. */ int nread; /* Bytes read in the current block. */ int exit_status = 0; /* Leave at least one extra byte at the beginning and end of `ibuf' for conv=swab, but keep the buffer address even. But some peculiar device drivers work only with word-aligned buffers, so leave an extra two bytes. */ ! ibuf = (unsigned char *) xmalloc (input_blocksize + 2 * SWAB_ALIGN_OFFSET); ! ibuf += SWAB_ALIGN_OFFSET; if (conversions_mask & C_TWOBUFS) obuf = (unsigned char *) xmalloc (output_blocksize); --- 532,572 ---- copy (void) { unsigned char *ibuf, *bufstart; /* Input buffer. */ + unsigned char *realbuf; /* real buffer address before alignment */ int nread; /* Bytes read in the current block. */ int exit_status = 0; + int bump; /* Skip this amount to page align buffer */ + unsigned long pagesize; /* Leave at least one extra byte at the beginning and end of `ibuf' for conv=swab, but keep the buffer address even. But some peculiar device drivers work only with word-aligned buffers, so leave an extra two bytes. */ ! /* ! * Some devices require alignment on a sector or page boundary ! * (e.g. character disk devices). Align the input buffer to a ! * page boundary to cover all bases. Note that due to the swab ! * algorithm, we must have at least one byte in the page before ! * the input buffer; thus we allocate 2 pages of slop in the ! * real buffer. 8k above the blocksize shouldn't bother anyone. ! */ ! ! #if defined(HAVE_GETPAGESIZE) ! pagesize = getpagesize(); ! #else ! pagesize = 4096; ! #endif ! ! realbuf = (unsigned char *) xmalloc(input_blocksize + ! (2 * SWAB_ALIGN_OFFSET) + ! (2 * pagesize) - 1); ! ibuf = realbuf; ! ibuf += SWAB_ALIGN_OFFSET; /* allow space for swab */ ! bump = ((unsigned long) ibuf) & (pagesize - 1); ! if (bump) { ! ibuf += (pagesize - bump); ! } if (conversions_mask & C_TWOBUFS) obuf = (unsigned char *) xmalloc (output_blocksize); *************** *** 684,690 **** } } ! free (ibuf - SWAB_ALIGN_OFFSET); if (obuf != ibuf) free (obuf); --- 709,715 ---- } } ! free (realbuf); if (obuf != ibuf) free (obuf); From owner-rawio@oss.sgi.com Thu Mar 30 11:39:05 2000 Received: by oss.sgi.com id ; Thu, 30 Mar 2000 11:38:55 -0800 Received: from adsl-63-194-89-126.dsl.snfc21.pacbell.net ([63.194.89.126]:51464 "HELO skull.piratehaven.org") by oss.sgi.com with SMTP id ; Thu, 30 Mar 2000 11:38:34 -0800 Received: (qmail 22746 invoked by uid 1012); 30 Mar 2000 19:38:26 -0000 Date: Thu, 30 Mar 2000 11:38:26 -0800 From: Brian Pomerantz To: rawio@oss.sgi.com Subject: Re: dd Message-ID: <20000330113826.A22409@skull.piratehaven.org> Mail-Followup-To: rawio@oss.sgi.com References: <20000330103430.A19958@skull.piratehaven.org> <200003301921.LAA42878@griffin.engr.sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3us In-Reply-To: <200003301921.LAA42878@griffin.engr.sgi.com> X-homepage: http://www.piratehaven.org/~bapper/ Sender: owner-rawio@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;rawio-outgoing Thanks. BAPper On Thu, Mar 30, 2000 at 11:21:49AM -0800, Scott Lurndal wrote: > > > > Would it be possible to get the source code to the dd.raw file that is > > on the web page for the rawio patch? I just wanted it for a reference > > on how to use the rawio facility. Plus, I can't run it since I'm > > working with Linux on the Alpha platform. > > > > > > BAPper > > > > I sent the diffs off to the fileutil's maintainer quite > some time ago. > > *** /tmp/dd.c.orig Wed Jul 7 16:19:02 1999 > --- dd.c Wed Jul 7 16:33:14 1999 > *************** > *** 532,547 **** > copy (void) > { > unsigned char *ibuf, *bufstart; /* Input buffer. */ > int nread; /* Bytes read in the current block. */ > int exit_status = 0; > > /* Leave at least one extra byte at the beginning and end of `ibuf' > for conv=swab, but keep the buffer address even. But some peculiar > device drivers work only with word-aligned buffers, so leave an > extra two bytes. */ > > ! ibuf = (unsigned char *) xmalloc (input_blocksize + 2 * SWAB_ALIGN_OFFSET); > ! ibuf += SWAB_ALIGN_OFFSET; > > if (conversions_mask & C_TWOBUFS) > obuf = (unsigned char *) xmalloc (output_blocksize); > --- 532,572 ---- > copy (void) > { > unsigned char *ibuf, *bufstart; /* Input buffer. */ > + unsigned char *realbuf; /* real buffer address before alignment */ > int nread; /* Bytes read in the current block. */ > int exit_status = 0; > + int bump; /* Skip this amount to page align buffer */ > + unsigned long pagesize; > > /* Leave at least one extra byte at the beginning and end of `ibuf' > for conv=swab, but keep the buffer address even. But some peculiar > device drivers work only with word-aligned buffers, so leave an > extra two bytes. */ > > ! /* > ! * Some devices require alignment on a sector or page boundary > ! * (e.g. character disk devices). Align the input buffer to a > ! * page boundary to cover all bases. Note that due to the swab > ! * algorithm, we must have at least one byte in the page before > ! * the input buffer; thus we allocate 2 pages of slop in the > ! * real buffer. 8k above the blocksize shouldn't bother anyone. > ! */ > ! > ! #if defined(HAVE_GETPAGESIZE) > ! pagesize = getpagesize(); > ! #else > ! pagesize = 4096; > ! #endif > ! > ! realbuf = (unsigned char *) xmalloc(input_blocksize + > ! (2 * SWAB_ALIGN_OFFSET) + > ! (2 * pagesize) - 1); > ! ibuf = realbuf; > ! ibuf += SWAB_ALIGN_OFFSET; /* allow space for swab */ > ! bump = ((unsigned long) ibuf) & (pagesize - 1); > ! if (bump) { > ! ibuf += (pagesize - bump); > ! } > > if (conversions_mask & C_TWOBUFS) > obuf = (unsigned char *) xmalloc (output_blocksize); > *************** > *** 684,690 **** > } > } > > ! free (ibuf - SWAB_ALIGN_OFFSET); > if (obuf != ibuf) > free (obuf); > > --- 709,715 ---- > } > } > > ! free (realbuf); > if (obuf != ibuf) > free (obuf);