This is a multi-part message in MIME format. --------------040700000608080407030403 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: quoted-printable Hi, after re-reading some of your cvs-logs and checking again the data=20 sheet, here my second version of fdc1.diff. This version is IMHO cleaner/saver, because it wouldn't break the hack=20 (fdc.c; rev. 1.14) in the SENSE INTERRUPT STATUS and it is more data=20 sheet conforming. Sorry about the first fdc1.diff-"noise". Ciao Walter W. Tasin schrieb: > Hello *, > > I tried to make OS9/x86 runnable on qemu; with an existing hd image it=20 > already worked, but w/o floppy support. To make this also available=20 > I'd a look at the sources and (after some time ...) I was able to=20 > solve 3 little problems. > - boot from floppy didn't work > - floppy support inside os9/x86 didn't work > - a second ide reset sequence didn't work correctly > > So here my patches (against snapshot=20 > http://qemu-forum.ipi.fi/qemu-snapshots/qemu-snapshot-2007-05-18_05.tar= .bz2)=20 > > > You can find a more detailed explanation on=20 > http://pc01-lsw.ee.fhm.edu/wiki/QEmu/OS9Patch > > HTH > Ciao > > Walter > > PS: Please CC me on questions, 'cause I'm not subscribed to the list. > --=20 Walter Tasin, M.Sc. Fakult=E4t f=FCr Elektrotechnik und Informationstechnik Fachhochschule M=FCnchen, Munich University of Applied Sciences --------------040700000608080407030403 Content-Type: text/plain; name="fdc1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fdc1.diff" --- hw/fdc.c Mon May 21 10:38:54 2007 +++ hw/fdc.c Mon May 21 10:39:20 2007 @@ -377,6 +377,7 @@ uint8_t dma_en; uint8_t cur_drv; uint8_t bootsel; + uint8_t first_sense; /* Command FIFO */ uint8_t fifo[FD_SECTOR_LEN]; uint32_t data_pos; @@ -597,6 +598,7 @@ fdctrl->irq = irq; fdctrl->dma_chann = dma_chann; fdctrl->io_base = io_base; + fdctrl->first_sense=0; fdctrl->config = 0x60; /* Implicit seek, polling & FIFO enabled */ if (fdctrl->dma_chann != -1) { fdctrl->dma_en = 1; @@ -655,7 +657,7 @@ return; } #endif - if (~(fdctrl->state & FD_CTRL_INTR)) { + if (!(fdctrl->state & FD_CTRL_INTR)) { qemu_set_irq(fdctrl->irq, 1); fdctrl->state |= FD_CTRL_INTR; } @@ -672,6 +674,7 @@ fdctrl_reset_irq(fdctrl); /* Initialise controller */ fdctrl->cur_drv = 0; + fdctrl->first_sense = 4; /* FIFO state */ fdctrl->data_pos = 0; fdctrl->data_len = 0; @@ -1384,6 +1387,7 @@ FLOPPY_DPRINTF("SPECIFY command\n"); /* 1 parameter cmd */ fdctrl->data_len = 3; + fdctrl->first_sense=0; goto enqueue; case 0x04: /* SENSE_DRIVE_STATUS */ @@ -1401,21 +1405,29 @@ /* SENSE_INTERRUPT_STATUS */ FLOPPY_DPRINTF("SENSE_INTERRUPT_STATUS command (%02x)\n", fdctrl->int_status); + uint8_t act_drv = fdctrl->cur_drv; /* No parameters cmd: returns status if no interrupt */ + if (fdctrl->first_sense > 0) + act_drv=4-fdctrl->first_sense--; + #if 0 fdctrl->fifo[0] = - fdctrl->int_status | (cur_drv->head << 2) | fdctrl->cur_drv; + (fdctrl->state & FD_CTRL_INTR) ? + (fdctrl->int_status | (cur_drv->head << 2) | act_drv) : 0x80; #else /* XXX: int_status handling is broken for read/write commands, so we do this hack. It should be suppressed ASAP */ fdctrl->fifo[0] = - 0x20 | (cur_drv->head << 2) | fdctrl->cur_drv; + (fdctrl->state & FD_CTRL_INTR) ? + (0x20 | (cur_drv->head << 2) | act_drv) : 0x80 ; #endif + fdctrl->fifo[1] = cur_drv->track; - fdctrl_set_fifo(fdctrl, 2, 0); - fdctrl_reset_irq(fdctrl); - fdctrl->int_status = 0xC0; + fdctrl_set_fifo(fdctrl, (fdctrl->fifo[0] != 0x80) ? 2 : 1, 0); + + fdctrl_reset_irq(fdctrl); + fdctrl->int_status = 0xC0; return; case 0x0E: /* DUMPREG */ --------------040700000608080407030403--