From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: grub-devel@gnu.org
Subject: Re: How to debug 'out of disk' error.
Date: Thu, 17 Mar 2011 20:01:09 +0100 [thread overview]
Message-ID: <4D825A75.1000507@gmail.com> (raw)
In-Reply-To: <20110317184014.GM343@caffeine.csclub.uwaterloo.ca>
[-- Attachment #1: Type: text/plain, Size: 3532 bytes --]
On 17.03.2011 19:40, Lennart Sorensen wrote:
> On Thu, Mar 17, 2011 at 05:29:51PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>
>> On 17.03.2011 17:09, Lennart Sorensen wrote:
>>
>>> On Wed, Mar 16, 2011 at 11:16:05PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>>>
>>>
>>>> It's not really a fixup. Correct return on no error is CF=0 AH=0. Some
>>>> BIOSes in some other functions returned CF=0, AH!= 0 on no error so it
>>>> was a wild guess.
>>>>
>>>>
>>>>> Failed int13_ext call: ah=42, drive=80, dap= 6fe00 returned eax=8000
>>>>>
>>>>>
>>>>>
>>>> Error 0x80 according to
>>>> http://www.delorie.com/djgpp/doc/rbinter/it/34/2.html means timeout.
>>>> Following code would retry on timeout:
>>>> === modified file 'grub-core/disk/i386/pc/biosdisk.c'
>>>> --- grub-core/disk/i386/pc/biosdisk.c 2011-01-04 14:42:47 +0000
>>>> +++ grub-core/disk/i386/pc/biosdisk.c 2011-03-16 22:13:12 +0000
>>>> @@ -72,6 +72,8 @@
>>>> grub_biosdisk_rw_int13_extensions (int ah, int drive, void *dap)
>>>> {
>>>> struct grub_bios_int_registers regs;
>>>> + int tries = 4;
>>>> + retry:
>>>> regs.eax = ah << 8;
>>>> /* compute the address of disk_address_packet */
>>>> regs.ds = (((grub_addr_t) dap) & 0xffff0000) >> 4;
>>>> @@ -80,6 +82,16 @@
>>>> regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
>>>>
>>>> grub_bios_interrupt (0x13, ®s);
>>>> + if (!(regs.flags & GRUB_CPU_INT_FLAGS_CARRY))
>>>> + return 0;
>>>> +
>>>> + if (((regs.eax >> 8) & 0xff) == 0x80 && tries)
>>>> + {
>>>> + grub_millisleep (10);
>>>> + tries--;
>>>> + goto retry;
>>>> + }
>>>> +
>>>> return (regs.eax >> 8) & 0xff;
>>>> }
>>>>
>>>>
>>> So that didn't make any difference to it.
>>>
>>> It just keeps returning 0x8000 in eax on every retry.
>>>
>>>
>>>
>> Another wild guess:
>> @@ -506,6 +520,8 @@ get_safe_sectors (grub_disk_addr_t secto
>> grub_size_t size;
>> grub_uint32_t offset;
>>
>> + return 1;
>> +
>> /* OFFSET = SECTOR % SECTORS */
>> grub_divmod64 (sector, sectors, &offset);
>>
> No go either.
>
>
Can you dump complete drp before and after every call?
(19:52:44) phcoder: cjwatson: may the Lennart's last message be caused
by 4K sectors?(idk if he has 512B or 4K sectors)
(19:56:14) cjwatson: possible; he can find out by printing
drp->bytes_per_sector after the call to
grub_biosdisk_get_diskinfo_int13_extensions in
grub-core/disk/i386/pc/biosdisk.c
(19:56:25) cjwatson: at least find out what the BIOS thinks
> Here is what I see with some more debugging:
>
> [snip]
> int13_ext call: ah=42, drive=80, dap= 6fe00 (len=16 rsvd=0 blks=1 buf=1744830464 sec=2078)
> int13_ext call: ah=42, drive=80, dap= 6fe00 (len=16 rsvd=0 blks=1 buf=1744830464 sec=2079)
> int13_ext call: ah=42, drive=80, dap= 6fe00 (len=16 rsvd=0 blks=1 buf=1744830464 sec=72091664)
> failed int13_ext call: ah=42, drive=80, dap= 6fe00 returned eax=8000
> error: hd0 out of disk.
> Entering rescue mode...
> grub rescue>
>
> Now it has no excuse for failing a call for sector 72091664 when the
> drive has 156000000 or so sectors.
>
> I imagine if I made a small boot partition (less than 8G), the stupid
> thing would boot fine, but that's not acceptable on a brand new design.
> I am going to try resizing the partition as a test.
>
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
next prev parent reply other threads:[~2011-03-17 19:01 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-16 15:13 How to debug 'out of disk' error Lennart Sorensen
2011-03-16 15:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-03-16 16:58 ` Lennart Sorensen
2011-03-16 17:21 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-03-16 17:32 ` Lennart Sorensen
2011-03-16 17:58 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-03-16 18:14 ` Lennart Sorensen
2011-03-16 19:19 ` Phillip Susi
2011-03-16 19:23 ` Lennart Sorensen
2011-03-16 20:09 ` Lennart Sorensen
2011-03-16 20:19 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-03-16 22:00 ` Lennart Sorensen
2011-03-16 22:16 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-03-17 14:06 ` Lennart Sorensen
2011-03-17 14:18 ` Lennart Sorensen
2011-03-17 16:09 ` Lennart Sorensen
2011-03-17 16:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-03-17 18:40 ` Lennart Sorensen
2011-03-17 19:01 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2011-03-17 19:22 ` Lennart Sorensen
2011-03-18 9:04 ` Grégoire Sutre
2011-03-18 14:22 ` Lennart Sorensen
2011-03-18 14:56 ` Grégoire Sutre
2011-03-18 15:26 ` Lennart Sorensen
2011-03-16 19:51 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-04-06 12:50 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-04-06 14:38 ` Lennart Sorensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D825A75.1000507@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.