* [Qemu-devel] Hard disk support is broken in Windows 98SE guest
@ 2007-10-02 12:16 Victor Shkamerda
2007-10-02 16:43 ` Thiemo Seufer
0 siblings, 1 reply; 5+ messages in thread
From: Victor Shkamerda @ 2007-10-02 12:16 UTC (permalink / raw)
To: qemu-devel
Hi,
Hard disk support is broken in recent CVS for Windows 98SE OS guest.
DOS also have problems. Windows 2003 seems to be fine.
Try to create hard disk image using "dd of=w98.img bs=1 count=0
seek=508M" and install Windows 98SE by booting from installation CD.
Installation failed not able to partition, format and verify file
system.
It all works fine in version 0.9.0.
With best regards,
Victor Shkamerda
-- --- --
LIMITARE DE OBLIGATIUNI: Mesajele expediate din cadrul Bancii Nationale
a Moldovei sunt transmise cu buna intentie si nu trebuie considerate
drept obligatorii in activitatea acestei organizatii. Informatia
transmisa este destinata doar pentru adresat si poate contine date
confidentiale si / sau privilegiate. In caz ca primiti mesajul dat din
greseala, va rugam sa contactati expeditorul si sa stergeti informatia
in cauza din computerul Dvs.
DISCLAIMER: Any e-mail messages from the National Bank of Moldova are
sent in good faith, but shall not be binding nor construed as
constituting any obligation on the part of the Bank. The information
transmitted is intended only for the person or entity to which it is
addressed and may contain confidential and/or privileged material. If
you received this in error, please contact the sender and delete the
material from any computer.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Hard disk support is broken in Windows 98SE guest
2007-10-02 12:16 [Qemu-devel] Hard disk support is broken in Windows 98SE guest Victor Shkamerda
@ 2007-10-02 16:43 ` Thiemo Seufer
2007-10-03 7:57 ` Victor Shkamerda
0 siblings, 1 reply; 5+ messages in thread
From: Thiemo Seufer @ 2007-10-02 16:43 UTC (permalink / raw)
To: Victor Shkamerda; +Cc: qemu-devel
Victor Shkamerda wrote:
> Hi,
>
> Hard disk support is broken in recent CVS for Windows 98SE OS guest.
> DOS also have problems. Windows 2003 seems to be fine.
>
> Try to create hard disk image using "dd of=w98.img bs=1 count=0
> seek=508M" and install Windows 98SE by booting from installation CD.
> Installation failed not able to partition, format and verify file
> system.
>
> It all works fine in version 0.9.0.
I don't have such a system for tests. Can you narrow down which CVS
commit broke it?
Thiemo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Hard disk support is broken in Windows 98SE guest
2007-10-02 16:43 ` Thiemo Seufer
@ 2007-10-03 7:57 ` Victor Shkamerda
2007-10-03 18:18 ` Leonardo Reiter
0 siblings, 1 reply; 5+ messages in thread
From: Victor Shkamerda @ 2007-10-03 7:57 UTC (permalink / raw)
To: qemu-devel
Hello,
>>> On 10/2/2007 at 7:43 PM, in message <20071002164337.GH16772@networkno.de>,
Thiemo Seufer <ths@networkno.de> wrote:
> I don't have such a system for tests. Can you narrow down which CVS
> commit broke it?
hw/ide.c 1.64 works, version 1.65 doesn't. Only BIOS operations seems to be affected, so it may be BIOS fault after all. You can use FreeDOS for testing, it doesn't install too.
Victor Shkamerda
-- --- --
LIMITARE DE OBLIGATIUNI: Mesajele expediate din cadrul Bancii Nationale a Moldovei sunt transmise cu buna intentie si nu trebuie considerate drept obligatorii in activitatea acestei organizatii. Informatia transmisa este destinata doar pentru adresat si poate contine date confidentiale si / sau privilegiate. In caz ca primiti mesajul dat din greseala, va rugam sa contactati expeditorul si sa stergeti informatia in cauza din computerul Dvs.
DISCLAIMER: Any e-mail messages from the National Bank of Moldova are sent in good faith, but shall not be binding nor construed as constituting any obligation on the part of the Bank. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you received this in error, please contact the sender and delete the material from any computer.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Hard disk support is broken in Windows 98SE guest
2007-10-03 7:57 ` Victor Shkamerda
@ 2007-10-03 18:18 ` Leonardo Reiter
2007-10-03 18:30 ` Leonardo Reiter
0 siblings, 1 reply; 5+ messages in thread
From: Leonardo Reiter @ 2007-10-03 18:18 UTC (permalink / raw)
To: qemu-devel
On 10/3/07, Victor Shkamerda <vvs@auto.bnm.org> wrote:
> Hello,
>
> >>> On 10/2/2007 at 7:43 PM, in message <20071002164337.GH16772@networkno.de>,
> Thiemo Seufer <ths@networkno.de> wrote:
> > I don't have such a system for tests. Can you narrow down which CVS
> > commit broke it?
>
> hw/ide.c 1.64 works, version 1.65 doesn't. Only BIOS operations seems to be affected, so it may be BIOS fault after all. You can use FreeDOS for testing, it doesn't install too.
>
The problem seems to be that the BIOS does not wait for the previous
write to complete before trying the next one. It's not clear to me
whether this needs to be fixed in the BIOS or in hw/ide.c. One
correct fix may be to have ide_sector_write set BUSY_STAT and then let
the AIO callback function set the status to READY_STAT, but this
definitely does not work well with the BOCHS BIOS. Here's a hack that
seems to work, but it's pretty ugly:
Index: hw/ide.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/ide.c,v
retrieving revision 1.69
diff -a -u -r1.69 ide.c
--- hw/ide.c 17 Sep 2007 08:09:47 -0000 1.69
+++ hw/ide.c 3 Oct 2007 18:00:31 -0000
@@ -900,7 +900,9 @@
if(bm == NULL) {
bm = qemu_mallocz(sizeof(BMDMAState));
s->bmdma = bm;
- }
+ } else if (bm->aiocb != NULL)
+ qemu_aio_wait();
+
bm->ide_if = s;
bm->dma_cb = ide_sector_write_aio_cb;
The danger here is that the AIO signal came in already by the time we
call qemu_aio_wait() (but bm->aiocb was not called yet), which is
pretty unlikely, but I think it could trigger a deadlock. I don't
think that's correct, but the fact is the BIOS assumes that the write
is done by the time it does another write. That seems to step on the
io_buffer, which is part of the asynchronous write that is pending.
Another solution may be to use a separate buffer for the write, but
then you have a copy and you have to hold on to the memory until the
write finishes. I think ultimately the correct fix is in the BIOS -
perhaps a spinlock on BUSY_STAT like it does after seeks, or something
like that. Maybe someone who knows more about this can comment.
Please note that I am not asking for the above patch to be committed,
just putting it out there as food for thought. It's probably (likely)
the wrong approach.
The reason the old win2k-hack worked, even if the BIOS didn't wait for
the IDE interrupt to write the next buffer, is because the actual host
write() was synchronous and the IO buffer could be safely stepped on
at any point after that. AIO writes have to hold on to the buffer
until they complete (see man page for aio_write).
- Leo Reiter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Hard disk support is broken in Windows 98SE guest
2007-10-03 18:18 ` Leonardo Reiter
@ 2007-10-03 18:30 ` Leonardo Reiter
0 siblings, 0 replies; 5+ messages in thread
From: Leonardo Reiter @ 2007-10-03 18:30 UTC (permalink / raw)
To: qemu-devel
On 10/3/07, Leonardo Reiter <lreiter76@gmail.com> wrote:
> Index: hw/ide.c
> ===================================================================
> RCS file: /cvsroot/qemu/qemu/hw/ide.c,v
> retrieving revision 1.69
> diff -a -u -r1.69 ide.c
> --- hw/ide.c 17 Sep 2007 08:09:47 -0000 1.69
> +++ hw/ide.c 3 Oct 2007 18:00:31 -0000
> @@ -900,7 +900,9 @@
> if(bm == NULL) {
> bm = qemu_mallocz(sizeof(BMDMAState));
> s->bmdma = bm;
> - }
> + } else if (bm->aiocb != NULL)
> + qemu_aio_wait();
> +
> bm->ide_if = s;
> bm->dma_cb = ide_sector_write_aio_cb;
>
>
> The danger here is that the AIO signal came in already by the time we
> call qemu_aio_wait() (but bm->aiocb was not called yet), which is
> pretty unlikely, but I think it could trigger a deadlock.
If you want to try that hack, I think it's probably safer (and more
correct) to use qemu_aio_flush() instead of qemu_aio_wait().
Regards,
Leo Reiter
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-10-03 18:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-02 12:16 [Qemu-devel] Hard disk support is broken in Windows 98SE guest Victor Shkamerda
2007-10-02 16:43 ` Thiemo Seufer
2007-10-03 7:57 ` Victor Shkamerda
2007-10-03 18:18 ` Leonardo Reiter
2007-10-03 18:30 ` Leonardo Reiter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).