Your message dated 18 Apr 2000 11:55:34 -0600
with message-id <[EMAIL PROTECTED]>
and subject line fixed in woody
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Darren Benham
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 26 Dec 1999 05:41:21 +0000
Received: (qmail 17663 invoked from network); 26 Dec 1999 05:41:19 -0000
Received: from blastula.phys.columbia.edu (128.59.132.160)
  by master.debian.org with SMTP; 26 Dec 1999 05:41:19 -0000
Received: from localhost (zack@localhost)
        by blastula.phys.columbia.edu (8.9.3/8.9.3/2) with ESMTP id AAA21848
        for <[EMAIL PROTECTED]>; Sun, 26 Dec 1999 00:41:18 -0500 (EST)
Message-Id: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: grub: needs fallback from LBA to CHS enabled
Date: Sun, 26 Dec 1999 00:41:18 -0500
From: Zack Weinberg <[EMAIL PROTECTED]>


Package: grub
Version: 0.5.93.1

I have a buggy BIOS that supports the extended drive information call, but
not LBA read.  Grub can't read anything from the disk if NO_INT13_FALLBACK
is defined.  I see no reason not to enable the fallback all the time; the
appended patch for bios.c does that, and cleans up the logic a bit.

The motherboard is an Asus P3B-F; I am not sure of the precise BIOS
revision.

Incidentally, shouldn't grub use the cylinder/head/sector values from the
extended drive info call if available?

zw

--- grub-0.5.93.1/stage2/bios.c Thu Aug 12 02:38:44 1999
+++ grub-0.5.93.1z/stage2/bios.c        Sat Dec 25 08:55:26 1999
@@ -37,7 +37,14 @@
                                unsigned long *cylinders,
                                unsigned long *heads,
                                unsigned long *sectors);
-
+struct disk_address_packet
+{
+  unsigned char length;
+  unsigned char reserved;
+  unsigned short blocks;
+  unsigned long buffer;
+  unsigned long long block;
+};
 
 /* Read/write NSEC sectors starting from SECTOR in DRIVE disk with GEOMETRY
    from/into SEGMENT segment. If READ is BIOSDISK_READ, then read it,
@@ -48,19 +55,12 @@
 biosdisk (int read, int drive, struct geometry *geometry,
          int sector, int nsec, int segment)
 {
-  int err;
+  struct disk_address_packet dap;
+  int cylinder_offset, head_offset, sector_offset;
+  int head;
   
   if (geometry->flags & BIOSDISK_FLAG_LBA_EXTENSION)
     {
-      struct disk_address_packet
-      {
-       unsigned char length;
-       unsigned char reserved;
-       unsigned short blocks;
-       unsigned long buffer;
-       unsigned long long block;
-      } dap;
-      
       if (sector >= geometry->total_sectors)
        return BIOSDISK_ERROR_GEOMETRY;
 
@@ -70,46 +70,33 @@
       dap.block = sector;
       dap.blocks = nsec;
       dap.reserved = 0;
-      /* This is undocumented part. The address is formated in
-        SEGMENT:ADDRESS.  */
+      /* The buffer address is expected in SEGMENT:OFFSET notation.
+        We know the OFFSET is zero.  */
       dap.buffer = segment << 16;
       
-      err = biosdisk_int13_extensions (read + 0x42, drive, &dap);
+      if (biosdisk_int13_extensions (read + 0x42, drive, &dap) == 0)
+       return 0;
 
-#define NO_INT13_FALLBACK      1
-#ifndef NO_INT13_FALLBACK
-      if (err)
-       {
-         geometry->flags &= ~BIOSDISK_FLAG_LBA_EXTENSION;
-         geometry->total_sectors = (geometry->cylinders
-                                    * geometry->heads
-                                    * geometry->sectors);
-         return biosdisk (read, drive, geometry, sector, nsec, segment);
-       }
-#endif /* ! NO_INT13_FALLBACK */
-      
+      /* That didn't work.  Fall back to the old BIOS call.  */
+      geometry->flags &= ~BIOSDISK_FLAG_LBA_EXTENSION;
+      geometry->total_sectors = (geometry->cylinders
+                                * geometry->heads
+                                * geometry->sectors);
     }
-  else
-    {
-      int cylinder_offset, head_offset, sector_offset;
-      int head;
 
-      /* SECTOR_OFFSET is counted from one, while HEAD_OFFSET and
-        CYLINDER_OFFSET are counted from zero.  */
-      sector_offset = sector % geometry->sectors + 1;
-      head = sector / geometry->sectors;
-      head_offset = head % geometry->heads;
-      cylinder_offset = head / geometry->heads;
+  /* SECTOR_OFFSET is counted from one, while HEAD_OFFSET and
+     CYLINDER_OFFSET are counted from zero.  */
+  sector_offset = sector % geometry->sectors + 1;
+  head = sector / geometry->sectors;
+  head_offset = head % geometry->heads;
+  cylinder_offset = head / geometry->heads;
       
-      if (cylinder_offset >= geometry->cylinders)
-       return BIOSDISK_ERROR_GEOMETRY;
-
-      err = biosdisk_standard (read + 0x02, drive,
-                              cylinder_offset, head_offset, sector_offset,
-                              nsec, segment);
-    }
+  if (cylinder_offset >= geometry->cylinders)
+    return BIOSDISK_ERROR_GEOMETRY;
 
-  return err;
+  return biosdisk_standard (read + 0x02, drive,
+                           cylinder_offset, head_offset, sector_offset,
+                           nsec, segment);
 }
 
 /* Return the geometry of DRIVE in GEOMETRY. If an error occurs, return

---------------------------------------
Received: (at 53507-done) by bugs.debian.org; 18 Apr 2000 17:59:19 +0000
Received: (qmail 24701 invoked from network); 18 Apr 2000 17:59:19 -0000
Received: from unknown (HELO trick.fig.org) (204.83.206.163)
  by master.debian.org with SMTP; 18 Apr 2000 17:59:19 -0000
Received: from ppp24-72-52-223.reverse.accesscomm.ca (faust.fig.org) [24.72.52.223] 
        by trick.fig.org with esmtp (Exim 2.05 #1 (Debian))
        id 12hcGn-0000Be-00; Tue, 18 Apr 2000 11:58:42 -0600
Received: from gord by faust.fig.org with local (Exim 2.05 #1 (Debian))
        id 12hcDm-00056c-00; Tue, 18 Apr 2000 11:55:34 -0600
To: [EMAIL PROTECTED], [EMAIL PROTECTED],
        [EMAIL PROTECTED]
Subject: fixed in woody
X-Attribution:  Gord
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: text/plain; charset=US-ASCII
From: Gordon Matzigkeit <[EMAIL PROTECTED]>
Date: 18 Apr 2000 11:55:34 -0600
Message-ID: <[EMAIL PROTECTED]>
Lines: 4


-- 
 Gordon Matzigkeit <[EMAIL PROTECTED]>  //\ I'm a FIG (http://fig.org/)
Committed to freedom and diversity \// I use GNU (http://gnu.fig.org/)

Reply via email to