Jamie Lokier | 1 Jul 01:05 2008

Re: "A disk read error occurred"

Avi Kivity wrote:
> Alexander (Sasha) Sirotkin wrote:
> >For some reason when I try to boot qemu with -hda /dev/sda (or -hda
> >/dev/hda), i.e. to use the whole disk, it fails with the above error
> >"A disk read error occurred". This happens only on IBM/Lenovo laptops
> >(tried a few models), while it works just fine on any desktop I can
> >get my hands on. Probably has something to do with bios...
> >
> >  
> 
> Can you add some printfs displaying the sector numbers being read?  Some 
> disks have trouble accessing the last sector.
> 
> Also, an strace can help show the problem.

Also, sometimes when booting the BIOS can print a disk read error
message, and an appropriate -hdachs will fix it.  I found that out
when rebooting Windows 2000 after installing it from CD (both in
QEMU), on a virtual disk 1GB in size.

-- Jamie

Jan Kiszka | 1 Jul 08:43 2008
Picon

[RESEND][PATCH] Report unmapped addresses in memory_dump

Instead of dumping incorrect (ie. previously read) data, report the
invalid virtual address to the user.

Signed-off-by: Jan Kiszka <jan.kiszka <at> web.de>
---
 monitor.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: b/monitor.c
===================================================================
--- a/monitor.c
+++ b/monitor.c
 <at>  <at>  -596,7 +596,10  <at>  <at>  static void memory_dump(int count, int f
             env = mon_get_cpu();
             if (!env)
                 break;
-            cpu_memory_rw_debug(env, addr, buf, l, 0);
+            if (cpu_memory_rw_debug(env, addr, buf, l, 0) < 0) {
+                term_printf(" Cannot access memory\n");
+                break;
+            }
         }
         i = 0;
         while (i < l) {

Jan Kiszka | 1 Jul 08:43 2008
Picon

[RESEND][PATCH] i386: Catch all non-present ptes in cpu_get_phys_page_debug

It helps debugging guests when yet unmapped pages are correctly reported
as, well, unmapped.

Signed-off-by: Jan Kiszka <jan.kiszka <at> web.de>
---
 target-i386/helper.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: b/target-i386/helper.c
===================================================================
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
 <at>  <at>  -1192,6 +1192,8  <at>  <at>  target_phys_addr_t cpu_get_phys_page_deb
             page_size = 4096;
             pte = ldq_phys(pte_addr);
         }
+        if (!(pte & PG_PRESENT_MASK))
+            return -1;
     } else {
         uint32_t pde;

 <at>  <at>  -1211,10 +1213,10  <at>  <at>  target_phys_addr_t cpu_get_phys_page_deb
                 /* page directory entry */
                 pte_addr = ((pde & ~0xfff) + ((addr >> 10) & 0xffc)) & env->a20_mask;
                 pte = ldl_phys(pte_addr);
-                if (!(pte & PG_PRESENT_MASK))
-                    return -1;
                 page_size = 4096;
             }
+            if (!(pte & PG_PRESENT_MASK))
(Continue reading)

Laurent Desnogues | 1 Jul 09:25 2008
Picon

[PATCH] Add missing return in arm-semi

Hello,

   there is a missing return for SYS_SYSTEM Angel semi-hosting call.
This was already sent on June 9th.

Laurent
Attachment (arm-semi.patch): text/x-patch, 510 bytes
Thiemo Seufer | 1 Jul 10:45 2008
Picon

[4811] Delete duplicate code.

Revision: 4811
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4811
Author:   ths
Date:     2008-07-01 08:45:45 +0000 (Tue, 01 Jul 2008)

Log Message:
-----------
Delete duplicate code.

Modified Paths:
--------------
    trunk/target-mips/translate.c

Modified: trunk/target-mips/translate.c
===================================================================
--- trunk/target-mips/translate.c	2008-06-30 17:51:26 UTC (rev 4810)
+++ trunk/target-mips/translate.c	2008-07-01 08:45:45 UTC (rev 4811)
 <at>  <at>  -7897,9 +7897,6  <at>  <at> 
         if (gen_opc_ptr >= gen_opc_end)
             break;

-        if (gen_opc_ptr >= gen_opc_end)
-            break;
-
         if (num_insns >= max_insns)
             break;
 #if defined (MIPS_SINGLE_STEP)

Mark Cave-Ayland | 1 Jul 11:03 2008
Picon

Re: "A disk read error occurred"

Jamie Lokier wrote:

> Also, sometimes when booting the BIOS can print a disk read error
> message, and an appropriate -hdachs will fix it.  I found that out
> when rebooting Windows 2000 after installing it from CD (both in
> QEMU), on a virtual disk 1GB in size.
> 
> -- Jamie

The message "A disk read error occurred" comes from the NT bootloader 
when it is unable to boot, typically caused by an incorrect drive geometry.

It sounds as if you are experiencing a similar problem to the one I 
blogged about here:

http://www.ilande.co.uk/index.php?/archives/6-Migrating-an-NT4-VM-from-VMWare-to-NT4-Part-1.html. 
In other words, in order to run an existing NT4 image under QEMU I had 
to halve the number of heads in the NTFS BPB in order for things to work 
properly. I suspect that this is a bug in either QEMU/BIOS, but I have 
no idea where to even start looking.

HTH,

Mark.

--

-- 
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063
(Continue reading)

Jamie Lokier | 1 Jul 11:08 2008

Re: "A disk read error occurred"

Mark Cave-Ayland wrote:
> >Also, sometimes when booting the BIOS can print a disk read error
> >message, and an appropriate -hdachs will fix it.  I found that out
> >when rebooting Windows 2000 after installing it from CD (both in
> >QEMU), on a virtual disk 1GB in size.
> >
> >-- Jamie
> 
> The message "A disk read error occurred" comes from the NT bootloader 
> when it is unable to boot, typically caused by an incorrect drive geometry.
> 
> It sounds as if you are experiencing a similar problem to the one I 
> blogged about here: 
>
http://www.ilande.co.uk/index.php?/archives/6-Migrating-an-NT4-VM-from-VMWare-to-NT4-Part-1.html. 
> In other words, in order to run an existing NT4 image under QEMU I had to 
> halve the number of heads in the NTFS BPB in order for things to work 
> properly. I suspect that this is a bug in either QEMU/BIOS, but I have no 
> idea where to even start looking.

Yes, very similar, except I saw the problem _without_ migrating
anything.  Windows 2000 was installed _inside_ QEMU (with no special
-hdachs setting) from its CD installer.  It couldn't boot its own
install after restarting QEMU.

I looked at the partition with fdisk, then copied the c,h,s values to
-hdachs...

...and QEMU said the values were out of range and refused to start!

(Continue reading)

Mark Cave-Ayland | 1 Jul 11:31 2008
Picon

Re: "A disk read error occurred"

Jamie Lokier wrote:

> Yes, very similar, except I saw the problem _without_ migrating
> anything.  Windows 2000 was installed _inside_ QEMU (with no special
> -hdachs setting) from its CD installer.  It couldn't boot its own
> install after restarting QEMU.
> 
> I looked at the partition with fdisk, then copied the c,h,s values to
> -hdachs...
> 
> ...and QEMU said the values were out of range and refused to start!
> 
> So I guessed some values which were not what fdisk reported, and it
> worked and booted fine.

Yeah, I went through exactly the same process with -hdachs myself :)  If 
you still have the broken image around, it would be interesting to 
compare the CHS settings between the MBR and VBR on your QEMU-installed 
copy to see what values you were getting...

ATB,

Mark.

--

-- 
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063

(Continue reading)

Sylvain Petreolle | 1 Jul 11:35 2008
Picon

Re : A disk read error occurred

As you may know, floppy disks formatted with XP are able to load NTLDR on the hard disk.
After getting the same error with XP SP2 image, I now always boot the VM with a floppy disk,
no more error at all :)

 
Kind regards,
Sylvain Petreolle (aka Usurp)

Support artists, not multinationals - http://Iwouldntsteal.net
Supportez les artistes, pas les multinationales - http://Iwouldntsteal.net

----- Message d'origine ----
> De : Alexander (Sasha) Sirotkin <sasha.sirotkin <at> gmail.com>
> À : qemu-devel <at> nongnu.org
> Envoyé le : Lundi, 30 Juin 2008, 22h23mn 18s
> Objet : [Qemu-devel] A disk read error occurred
> 
> For some reason when I try to boot qemu with -hda /dev/sda (or -hda
> /dev/hda), i.e. to use raw disk, it fails with the above error message
> - "A disk read error occurred". This happens only on IBM/Lenovo
> laptops (tried a few models), while it works just fine on any other
> desktop or laptop I can get my hands on. Probably has something to do
> with bios...
> 
> Any suggestions ?
> 
> Thanks

Alexander (Sasha) Sirotkin | 1 Jul 12:24 2008
Picon

Re: A disk read error occurred

On Tue, Jul 1, 2008 at 12:41 AM, Samuel Thibault
<samuel.thibault <at> eu.citrix.com> wrote:
> Alexander (Sasha) Sirotkin, le Mon 30 Jun 2008 23:23:18 +0300, a écrit :
>> For some reason when I try to boot qemu with -hda /dev/sda (or -hda
>> /dev/hda), i.e. to use raw disk, it fails with the above error message
>> - "A disk read error occurred". This happens only on IBM/Lenovo
>> laptops (tried a few models), while it works just fine on any other
>> desktop or laptop I can get my hands on. Probably has something to do
>> with bios...
>>
>> Any suggestions ?
>
> How big is the disk?

Not big, 40G.
My current guess is that the problem is not in qemu itself, but in the
bios. If there are no other suggestions, do you think it would be
possible to use IBM bios with qemu ?

BTW, I did not manage to find this error message ("A disk read error
occurred" in the sources - neither qemu, nor bochs bios.
>
> Samuel
>
>
>


Gmane