From owner-freebsd-questions@FreeBSD.ORG Sun Feb 12 03:03:29 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0BC3F16A420 for ; Sun, 12 Feb 2006 03:03:29 +0000 (GMT) (envelope-from gs_stoller@juno.com) Received: from outbound-mail.nyc.untd.com (outbound-mail.nyc.untd.com [64.136.20.164]) by mx1.FreeBSD.org (Postfix) with SMTP id E973343D45 for ; Sun, 12 Feb 2006 03:03:25 +0000 (GMT) (envelope-from gs_stoller@juno.com) Received: from webmail65.nyc.untd.com (webmail65.nyc.untd.com [10.141.27.205]) by smtpout02.nyc.untd.com with SMTP id AABB87KLXAHJAMDJ for (sender ); Sat, 11 Feb 2006 19:02:45 -0800 (PST) Received: (from gs_stoller@juno.com) by webmail65.nyc.untd.com (jqueuemail) id LGYSES84; Sat, 11 Feb 2006 19:02:37 PST Received: from [67.84.55.15] by webmail65.nyc.untd.com with HTTP: Sun, 12 Feb 2006 03:02:06 GMT X-Originating-IP: [67.84.55.15] Mime-Version: 1.0 From: "gs_stoller@juno.com" Date: Sun, 12 Feb 2006 03:02:06 GMT To: freebsd-questions@freebsd.org X-Mailer: Webmail Version 4.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-Type: text/plain Message-Id: <20060211.190237.29586.250540@webmail65.nyc.untd.com> X-ContentStamp: 7:3:1261575873 X-UNTD-OriginStamp: /s5f1SIGSI3+WdnoYQ8yRORbALEFtJillfboxNY+QarYIENiCwESoQ== X-UNTD-Peer-Info: 10.141.27.205|webmail65.nyc.untd.com|webmail65.nyc.untd.com|gs_stoller@juno.com X-Mailman-Approved-At: Sun, 12 Feb 2006 05:33:14 +0000 Subject: (no subject) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2006 03:03:29 -0000 I would like to have the source code of (the set of) programs that can "read from"/"write to" any sector of a disk without a file-system, think of them as the disk i/o programs that underly the file-system. I expect them to have (collectively) about four arguments,= one specifying the disk to access, the second pointing to a buffer (supplying the data to write or to accept the data read), the third stating the number of bytes to transfer, and the fourth giving the LBA = = address of the sector to be accessed. One function common to both the read program and the write program is the function to position the disk read/write head at the desired sector (given by its LBA ) [or notify the user via an interrupt (which one?) when that sector is at the read/write head]. This function is often named "seek". Source code with good comments are more desireable. One could combine the read & write programs into one program and add another argument telling the program whether it is to read or to write. One program that meets some of these requirements (but not all) is fdisk [it accesses only sector 0 ]. Its source would also be appreciated, all of those in the following versions of FreeBSD if available: versions 4.3, 4.7, & current-stable (6.0).