[Top][All Lists]

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

Re: my simple OS won't boot in QEMU

From: Donald R Laster Jr
Subject: Re: my simple OS won't boot in QEMU
Date: Sun, 4 Apr 2021 00:17:50 -0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.7


  The first question to consider is how did you remove /dev/sda4?  Did you use 
[c]fdisk, or an appropriate W95/DOS disk partition tool, to delete the 
/dev/sda4 partition, or was some other manual method used (i.e. a short cut 
copy process).  It is possible the loader is expecting specific information in 
the disk partition table. Also, remember the last sector on the disk often 
contains a copy of the MBR.

  I did a duckduckgo search using "disk partition boot record" and one of the 
sites found with information that might be useful is:


What you may want to do is setup the virtual machine that is using the disk 
image to effectively boot from a bootable CD/DVD device/image and from within 
the booted OS change the disk partition data  with [c]fdisk or appropriate 
W95/DOS disk partition tool.

  And since you are using what appears to be a raw image, i.e. .img, the way 
you removed /dev/sda4 may have caused the issue due to the you not using the 
expected size of the disk image.


bilsch01 wrote on 4/2/21 3:15 PM:
This post concerns booting sda2 using QEMU.  sda2 boots just fine when run on 
The layout of the HD looks like this:

Device     Boot     Start             End Sectors    Size       Id    Type
/dev/sda1            63                3903794         3903732 1.9G       6    
/dev/sda2   *        3903795      4032314           128520 62.8M    e     W95 
/dev/sda3            4032315      4082714             50400 24.6M    e     W95 
/dev/sda4            4083710   976771071     972687362 463.8G 5     Extended

The command line I have been using is:  qemu-system-i386  -drive 

File qemu4dell.img is an image of the first 3 partitions created using the 
linux dd command as follows:

dd if=/dev/sda of=qemu4dell.img bs=512 count=4082720 (the file has 6 extra 

In the first sector (the MBR) of qemu4dell.img I have zeroed out line 4 of the 
partition table because the file does not include partition 4.

If the boot flag is set for sda1 in file qemu4dell.img the command line above 
boots sda1 (MSDOS 6.22) just fine.

If the boot flag is set for sda2 in file qemu4dell.img the command line above 
results in error message:

missing operating system.

Careful examination of the boot program (IPL) in the first sector of 
qemu4dell.img shows that that message occurs if the IPL can't find the hex 
value AA55 at the end of the first sector of the partition to be booted (which 
is sda2). I refer to the first sector of sda2 as vbs2. I have double checked in 
qemu4dell.img and ensured that vbs2 sector is in the correct location in the 
file and that the value AA55 is in the correct place in the sector.

I can see no reason why QEMU doesn't boot sda2, because QEMU can boot sda1 ok, 
and also sda2 boots fine on the HD itself. Perhaps someone in this QEMU group 
knows the answer.


Bill Schaible

reply via email to

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