[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH] Re: Native CD test results

From: Pavel Roskin
Subject: [RFC PATCH] Re: Native CD test results
Date: Thu, 27 Mar 2008 02:37:15 -0400
User-agent: Internet Messaging Program (IMP) H3 (4.1.4)

Quoting Pavel Roskin <address@hidden>:

One rather old system with a Syntax SV266A motherboard and
800 MHz AMD Duron would hang while showing "Welcome to GRUB!"  That
system is also unique for having 3 IDE CD drives (2 CD-RWs and one
DVD+-RW), and GRUB would hang regardless of which drive the CD is in.

I could reproduce it on another machine with AWARD BIOS, AMD Athlon CPU running at 1.1GHz and just one DVD+-RW drive. It turns out the BIOS doesn't like that we represent the scratch address as 0x6000:0x8000, but it works with 0x6800:0x0000.

Even though int 13 returns in the original code (I can see it by modifying video memory from the real mode), something get corrupted, and GRUB fails to return to the protected mode.

I have a working fix, but I still need to test it on the original system. I see that a lot of code in kern/i386/pc/startup.S minimizes the segment address, but some code minimizes the offset. I don't feel good about unifying it across the board. Ad-hoc approach to BIOS bugs should work better.

By the way, I prefer 32-bit operations in 32-bit code. They should produce tighter code without prefixes. Again, I'm not going to fix others' code (just to avoid breakage), but the new code should try to avoid non-native register width.


        * kern/i386/pc/startup.S
        (grub_biosdisk_get_diskinfo_int13_extensions): When converting
        the data block address to the real mode, keep the offset to the
        minimum.  This works around a bug in AWARD BIOS affecting CD

diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S
index 35b19fd..635630d 100644
--- a/kern/i386/pc/startup.S
+++ b/kern/i386/pc/startup.S
@@ -806,7 +806,7 @@ FUNCTION(grub_biosdisk_get_diskinfo_int13_extensions)

        /* compute the address of drive parameters */
        movw    %dx, %si
-       xorw    %dx, %dx
+       andl    $0xf, %esi
        shrl    $4, %edx
        movw    %dx, %bx        /* save the segment into %bx */
        /* drive */

Pavel Roskin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]