For the compatibility mode check, the ATA driver uses the bits in the "Revision" byte instead of the "Programming Interface Byte" of the class value (See T13/1510D). The compat_use[] flags are never set.

This patch fixes both issues.

Christian

2009-01-11  Christian Franke  <fra...@computer.org>

        * disk/ata.c (grub_ata_pciinit): Fix bit numbers of compatibility
        mode check.  Fix setting of compat_use[].


diff --git a/disk/ata.c b/disk/ata.c
index 6e0b8b8..4ca63c2 100644
--- a/disk/ata.c
+++ b/disk/ata.c
@@ -504,7 +504,7 @@ grub_ata_pciinit (int bus, int device, int func,
   for (i = 0; i < 2; i++)
     {
       /* Set to 0 when the channel operated in compatibility mode.  */
-      int compat = (class >> (2 * i)) & 1;
+      int compat = (class >> (8 + 2 * i)) & 1;
 
       rega = 0;
       regb = 0;
@@ -515,7 +515,7 @@ grub_ata_pciinit (int bus, int device, int func,
 	{
 	  rega = grub_ata_ioaddress[i];
 	  regb = grub_ata_ioaddress2[i];
-	  compat_use[i] = 0;
+	  compat_use[i] = 1;
 	}
       else if (compat)
 	{
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to