From owner-freebsd-hackers@FreeBSD.ORG Sat Jun 24 22:21:15 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E527E16A492 for ; Sat, 24 Jun 2006 22:21:14 +0000 (UTC) (envelope-from andrew.chace@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34A5F43D45 for ; Sat, 24 Jun 2006 22:21:14 +0000 (GMT) (envelope-from andrew.chace@gmail.com) Received: by ug-out-1314.google.com with SMTP id m3so401057uge for ; Sat, 24 Jun 2006 15:21:12 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=TWifmTmIQ09WYjArLlm83+Huj6McB0ifbNmB/2AmhrKGFErd6wvi51OP/qgRDuPzixOtBHA4tpwUxPGV6pyNMOUH+cerh9GksvECJbC7zmHZppLNs29Soq6AmoiYuUxC30O/mJMDzaICXo8aW5su8T5pyAPzPvAW/tp6Amw5dzc= Received: by 10.78.97.7 with SMTP id u7mr1662584hub; Sat, 24 Jun 2006 15:21:12 -0700 (PDT) Received: by 10.78.120.1 with HTTP; Sat, 24 Jun 2006 15:21:12 -0700 (PDT) Message-ID: <5af45dee0606241521r1deda55fh235aac8edd58a49d@mail.gmail.com> Date: Sat, 24 Jun 2006 17:21:12 -0500 From: "andrew chace" To: "Frank Mitchell" In-Reply-To: <000101c697ab$8684f4e0$0dd5ae51@hal> MIME-Version: 1.0 References: <1151008839.2360.30.camel@LatitudeFC5.network> <000101c697ab$8684f4e0$0dd5ae51@hal> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: Coding question: finding the size of a block device 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, 24 Jun 2006 22:21:15 -0000 On 6/24/06, Frank Mitchell wrote: > > Let's assume your Block Device is an ATA Hard Disk and you're using > FreeBSD > 6.0 like me. > > Take a look at and you'll see a large fully-commented > structure, > "struct ata_params", which is used to return the information from the ATA > "IDENTIFY DEVICE" command using something like: > "ioctl(DevFil,IOCATAGPARM,&Parms);" > > This probably tells you everything you need. Plus IOCATAGPARM also returns > CD/DVD Drive information using the related IDENTIFY PACKET DEVICE command. > > For further details consult the T13 Website. For ATA/ATAPI you might start > with: "T13 1153D Revision 18" "Information Technology - AT Attachment with > Packet Interface Extension (ATA/ATAPI-4)". Though there are later > versions: > "T13 1321D" (ATA/ATAPI-5) and "T13 1410D" (ATA/ATAPI-6). > > Whatever device you have there's probably some Hardware Command which > gives > you all the technical details. > > Faictz Ce Que Vouldras: Frank Mitchell > > > > Hello, Thanks to all who have offered suggestions about how to tackle this problem. I have a number of different possiblities to consider here, and need to do some reading at this point to see which option would be best suited to this particular problem. Thanks very much for your advice! -Andrew