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

[Xen-devel] [PATCH 2/2] hvmloader->rombios use C/H/S, LBA when have been set by qemu



Hi,

hvmloader->rombios use C/H/S, LBA when have been set by qemu.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@xxxxxxxxxx>
Signed-off-by: Joe Jin <joe.jin@xxxxxxxxxx>
---
 rombios.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff -r 3263d0ff9476 tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c  Thu Jul 29 16:53:40 2010 +0100
+++ b/tools/firmware/rombios/rombios.c  Fri Aug 06 07:09:45 2010 +0800
@@ -2738,8 +2738,7 @@
         case ATA_TRANSLATION_NONE:
           break;
         case ATA_TRANSLATION_LBA:
-          spt = 63;
-          sectors_low /= 63;
+          sectors_low /= spt;
           heads = sectors_low / 1024;
           if (heads>128) heads = 255;
           else if (heads>64) heads = 128;
@@ -5440,6 +5439,7 @@
   Bit16u npc, nph, npspt, nlc, nlh, nlspt;
   Bit16u size, count;
   Bit8u  device, status;
+  Bit8u  translation;
 
   BX_DEBUG_INT13_HD("int13_harddisk: AX=%04x BX=%04x CX=%04x DX=%04x 
ES=%04x\n", AX, BX, CX, DX, ES);
 
@@ -5509,9 +5509,10 @@
 
       nph   = read_word(ebda_seg, &EbdaData->ata.devices[device].pchs.heads);
       npspt = read_word(ebda_seg, &EbdaData->ata.devices[device].pchs.spt);
+      translation = 
read_byte(ebda_seg,&EbdaData->ata.devices[device].translation);
 
       // if needed, translate lchs to lba, and execute command
-      if ( (nph != nlh) || (npspt != nlspt)) {
+      if ( (nph != nlh) || (npspt != nlspt) || (translation == 
ATA_TRANSLATION_LBA)) {
         lba_low = ((((Bit32u)cylinder * (Bit32u)nlh) + (Bit32u)head) * 
(Bit32u)nlspt) + (Bit32u)sector - 1;
         lba_high = 0;
         sector = 0; // this forces the command to be lba



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.