qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] atapi on ppc issue (was Re: qemu-system-ppc broken ?)


From: François Revol
Subject: Re: [Qemu-devel] atapi on ppc issue (was Re: qemu-system-ppc broken ?)
Date: Sun, 09 Nov 2008 23:07:48 +0100 CET

> > > Though I still can't seem to get OpenHackware to read the CD:
> > > ERROR: ATAPI TEST_UNIT_READY : status 50 != 0x40
> >
> > Replying to myself, it seems this works around the issue, at least
> > it
> > goes further.
> > I suppose OpenHackware only compares instead of checking the ready
> > bit...
>
> It seems I'm not the only one:
> http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/6937d731e3d4d4a8
> >
> I could try to fix the code in OH but I likely don't have the
> toolchain
> required to rebuild it.
>

Ok...
The attached patch makes OpenHackware happy again.
At least qemu-system-ppc can now start debian iso, and mine as well
(though I had to remove the chrp script as OH only checks the CRC on it
instead of interpreting...)

So now I can debug the bootloader at least.

Just posting it in case someone really urgently needs ppc back, as it's
ugly.

OpenHackware should be fixed instead, but it seems the binary in svn
has been updated after the last sources I found (archive.org has a
mirror of the dead website):
r3309 | j_mayer | 2007-10-01 08:44:33 +0200 (lun, 01 oct 2007) | 2
lines
Quickly hack PowerPC BIOS able to boot on CDROM again.
...
r1354 | bellard | 2005-04-07 01:06:54 +0200 (jeu, 07 avr 2005) | 2
lines
Open Hack'Ware version 0.4.1

Seems the last update was already about ATAPI...
Anyone has the latest source used ?
I could at least fix it to check for bits on errors...

Of course it'd be much better to switch to a real OF instead...
but I don't have the time for that, couldn't find usable OpenBIOS
images, and it sees CoreBoot v2 and v3 don't support ppc yet.

François.

Index: hw/ide.c
===================================================================
--- hw/ide.c    (révision 5663)
+++ hw/ide.c    (copie de travail)
@@ -835,7 +835,7 @@
     int64_t sector_num;
     int ret, n;
 
-    s->status = READY_STAT | SEEK_STAT;
+    s->status = READY_STAT | 0/*SEEK_STAT*/;
     s->error = 0; /* not needed by IDE spec, but needed by Windows */
     sector_num = ide_get_sector(s);
     n = s->nsector;
@@ -940,7 +940,7 @@
 
     /* end of transfer ? */
     if (s->nsector == 0) {
-        s->status = READY_STAT | SEEK_STAT;
+        s->status = READY_STAT | 0/*SEEK_STAT*/;
         ide_set_irq(s);
     eot:
         bm->status &= ~BM_STATUS_DMAING;
@@ -1088,7 +1088,7 @@
 static void ide_atapi_cmd_ok(IDEState *s)
 {
     s->error = 0;
-    s->status = READY_STAT | SEEK_STAT;
+    s->status = READY_STAT | 0/*SEEK_STAT*/;
     s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO | ATAPI_INT_REASON_CD;
     ide_set_irq(s);
 }
@@ -1100,6 +1100,7 @@
 #endif
     s->error = sense_key << 4;
     s->status = READY_STAT | ERR_STAT;
+    s->status = DRQ_STAT;
     s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO | ATAPI_INT_REASON_CD;
     s->sense_key = sense_key;
     s->asc = asc;
@@ -1202,7 +1203,7 @@
     if (s->packet_transfer_size <= 0) {
         /* end of transfer */
         ide_transfer_stop(s);
-        s->status = READY_STAT | SEEK_STAT;
+        s->status = READY_STAT | 0/*SEEK_STAT*/;
         s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO | 
ATAPI_INT_REASON_CD;
         ide_set_irq(s);
 #ifdef DEBUG_IDE_ATAPI
@@ -1280,10 +1281,10 @@
     s->io_buffer_index = 0;
 
     if (s->atapi_dma) {
-       s->status = READY_STAT | SEEK_STAT | DRQ_STAT;
+       s->status = READY_STAT | 0/*SEEK_STAT*/ | DRQ_STAT;
        ide_dma_start(s, ide_atapi_cmd_read_dma_cb);
     } else {
-       s->status = READY_STAT | SEEK_STAT;
+       s->status = READY_STAT | 0/*SEEK_STAT*/;
        ide_atapi_cmd_reply_end(s);
     }
 }
@@ -1298,7 +1299,7 @@
     s->io_buffer_index = sector_size;
     s->cd_sector_size = sector_size;
 
-    s->status = READY_STAT | SEEK_STAT;
+    s->status = READY_STAT | 0/*SEEK_STAT*/;
     ide_atapi_cmd_reply_end(s);
 }
 

reply via email to

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