From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Jl78X-0001hv-G2 for mharc-grub-devel@gnu.org; Sun, 13 Apr 2008 14:41:09 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jl78V-0001hq-Dw for grub-devel@gnu.org; Sun, 13 Apr 2008 14:41:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jl78T-0001he-UQ for grub-devel@gnu.org; Sun, 13 Apr 2008 14:41:07 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jl78T-0001hb-SM for grub-devel@gnu.org; Sun, 13 Apr 2008 14:41:05 -0400 Received: from aybabtu.com ([69.60.117.155]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jl78T-0001Hn-Go for grub-devel@gnu.org; Sun, 13 Apr 2008 14:41:05 -0400 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Jl78S-00078g-Bg for grub-devel@gnu.org; Sun, 13 Apr 2008 20:41:04 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1Jl788-0002V7-FZ for grub-devel@gnu.org; Sun, 13 Apr 2008 20:40:44 +0200 Date: Sun, 13 Apr 2008 20:40:44 +0200 From: Robert Millan To: grub-devel@gnu.org Message-ID: <20080413184044.GA9480@thorin> References: <20080321151446.GA22187@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080321151446.GA22187@thorin> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] wrong CHS limit check X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2008 18:41:07 -0000 Committed. On Fri, Mar 21, 2008 at 04:14:46PM +0100, Robert Millan wrote: > > This patch fixes (I think) the grub_biosdisk_rw() CHS limit check, which as > described in http://www.allensmith.net/Storage/HDDlimit/Int13h.htm is slightly > below LBA-24, not LBA-32 as current code assumes. > > -- > Robert Millan > > I know my rights; I want my phone call! > What use is a phone call… if you are unable to speak? > (as seen on /.) > 2008-03-21 Robert Millan > > * disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Fix CHS limit check, > as per http://www.allensmith.net/Storage/HDDlimit/Int13h.htm > > diff -urp grub2/disk/i386/pc/biosdisk.c tmp/disk/i386/pc/biosdisk.c > --- grub2/disk/i386/pc/biosdisk.c 2008-02-03 09:27:15.000000000 +0100 > +++ tmp/disk/i386/pc/biosdisk.c 2008-03-21 16:11:20.000000000 +0100 > @@ -237,15 +237,17 @@ grub_biosdisk_rw (int cmd, grub_disk_t d > { > unsigned coff, hoff, soff; > unsigned head; > - unsigned real_sector = (unsigned) sector; > > - /* It is impossible to reach over 2TB with the traditional > - CHS access. */ > - if (sector > ~0UL) > + /* It is impossible to reach over 8064 MiB (a bit less than LBA24) with > + the traditional CHS access. */ > + if (sector > > + 1024 /* cylinders */ * > + 256 /* heads */ * > + 63 /* spt */) > return grub_error (GRUB_ERR_OUT_OF_RANGE, "out of disk"); > > - soff = real_sector % data->sectors + 1; > - head = real_sector / data->sectors; > + soff = sector % data->sectors + 1; > + head = sector / data->sectors; > hoff = head % data->heads; > coff = head / data->heads; > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel -- Robert Millan I know my rights; I want my phone call! What use is a phone call… if you are unable to speak? (as seen on /.)