WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] x86, hvm, rombios: INT13 LBA48 support fo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86, hvm, rombios: INT13 LBA48 support for disks bigger than 128GB.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 27 Dec 2007 12:00:18 -0800
Delivery-date: Thu, 27 Dec 2007 12:00:45 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1198760440 0
# Node ID 7fbc521b07a918512a62dee712e3c2b1f228f8e0
# Parent  50bd5d2c15cf1ee8f62962fd7a8bbe0fe4ba9fd3
x86, hvm, rombios: INT13 LBA48 support for disks bigger than 128GB.
The new limit should be 2TB.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxx>
---
 tools/firmware/rombios/rombios.c |   63 +++++++++++++++++++++++++++------------
 1 files changed, 44 insertions(+), 19 deletions(-)

diff -r 50bd5d2c15cf -r 7fbc521b07a9 tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c  Thu Dec 27 12:56:32 2007 +0000
+++ b/tools/firmware/rombios/rombios.c  Thu Dec 27 13:00:40 2007 +0000
@@ -2538,7 +2538,10 @@ void ata_detect( )
         case ATA_TYPE_ATA:
           printf("ata%d %s: ",channel,slave?" slave":"master");
           i=0; while(c=read_byte(get_SS(),model+i++)) printf("%c",c);
-          printf(" ATA-%d Hard-Disk (%d MBytes)\n",version,(Bit16u)sizeinmb);
+          if (sizeinmb < 1UL<<16)
+            printf(" ATA-%d Hard-Disk (%04u 
MBytes)\n",version,(Bit16u)sizeinmb);
+          else
+            printf(" ATA-%d Hard-Disk (%04u 
GBytes)\n",version,(Bit16u)(sizeinmb>>10));
           break;
         case ATA_TYPE_ATAPI:
           printf("ata%d %s: ",channel,slave?" slave":"master");
@@ -2671,8 +2674,28 @@ Bit32u lba;
   if (mode == ATA_MODE_PIO32) blksize>>=2;
   else blksize>>=1;
 
+  // Reset count of transferred data
+  write_word(ebda_seg, &EbdaData->ata.trsfsectors,0);
+  write_dword(ebda_seg, &EbdaData->ata.trsfbytes,0L);
+  current = 0;
+
+  status = inb(iobase1 + ATA_CB_STAT);
+  if (status & ATA_CB_STAT_BSY) return 1;
+
+  outb(iobase2 + ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);
+
   // sector will be 0 only on lba access. Convert to lba-chs
   if (sector == 0) {
+    if ((count >= 1 << 8) || (lba + count >= 1UL << 28)) {
+      outb(iobase1 + ATA_CB_FR, 0x00);
+      outb(iobase1 + ATA_CB_SC, (count >> 8) & 0xff);
+      outb(iobase1 + ATA_CB_SN, lba >> 24);
+      outb(iobase1 + ATA_CB_CL, 0);
+      outb(iobase1 + ATA_CB_CH, 0);
+      command |= 0x04;
+      count &= (1UL << 8) - 1;
+      lba &= (1UL << 24) - 1;
+      }
     sector = (Bit16u) (lba & 0x000000ffL);
     lba >>= 8;
     cylinder = (Bit16u) (lba & 0x0000ffffL);
@@ -2680,15 +2703,6 @@ Bit32u lba;
     head = ((Bit16u) (lba & 0x0000000fL)) | 0x40;
     }
 
-  // Reset count of transferred data
-  write_word(ebda_seg, &EbdaData->ata.trsfsectors,0);
-  write_dword(ebda_seg, &EbdaData->ata.trsfbytes,0L);
-  current = 0;
-
-  status = inb(iobase1 + ATA_CB_STAT);
-  if (status & ATA_CB_STAT_BSY) return 1;
-
-  outb(iobase2 + ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);
   outb(iobase1 + ATA_CB_FR, 0x00);
   outb(iobase1 + ATA_CB_SC, count);
   outb(iobase1 + ATA_CB_SN, sector);
@@ -2814,8 +2828,28 @@ Bit32u lba;
   if (mode == ATA_MODE_PIO32) blksize>>=2;
   else blksize>>=1;
 
+  // Reset count of transferred data
+  write_word(ebda_seg, &EbdaData->ata.trsfsectors,0);
+  write_dword(ebda_seg, &EbdaData->ata.trsfbytes,0L);
+  current = 0;
+
+  status = inb(iobase1 + ATA_CB_STAT);
+  if (status & ATA_CB_STAT_BSY) return 1;
+
+  outb(iobase2 + ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);
+
   // sector will be 0 only on lba access. Convert to lba-chs
   if (sector == 0) {
+    if ((count >= 1 << 8) || (lba + count >= 1UL << 28)) {
+      outb(iobase1 + ATA_CB_FR, 0x00);
+      outb(iobase1 + ATA_CB_SC, (count >> 8) & 0xff);
+      outb(iobase1 + ATA_CB_SN, lba >> 24);
+      outb(iobase1 + ATA_CB_CL, 0);
+      outb(iobase1 + ATA_CB_CH, 0);
+      command |= 0x04;
+      count &= (1UL << 8) - 1;
+      lba &= (1UL << 24) - 1;
+      }
     sector = (Bit16u) (lba & 0x000000ffL);
     lba >>= 8;
     cylinder = (Bit16u) (lba & 0x0000ffffL);
@@ -2823,15 +2857,6 @@ Bit32u lba;
     head = ((Bit16u) (lba & 0x0000000fL)) | 0x40;
     }
 
-  // Reset count of transferred data
-  write_word(ebda_seg, &EbdaData->ata.trsfsectors,0);
-  write_dword(ebda_seg, &EbdaData->ata.trsfbytes,0L);
-  current = 0;
-
-  status = inb(iobase1 + ATA_CB_STAT);
-  if (status & ATA_CB_STAT_BSY) return 1;
-
-  outb(iobase2 + ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);
   outb(iobase1 + ATA_CB_FR, 0x00);
   outb(iobase1 + ATA_CB_SC, count);
   outb(iobase1 + ATA_CB_SN, sector);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86, hvm, rombios: INT13 LBA48 support for disks bigger than 128GB., Xen patchbot-unstable <=