2

I'm trying to emulate windows with bochs on my android device. I've got the following drives: an empty disk image to install windows on, a virtual vvfat drive with the setup files, and a cdrom drive with the latest version of DOS. Bochs recognizes all drives correctly.

The problem is, when I boot into DOS, the disk image is not recognized. I used the vol command to identify the drives. A was assigned to the cdrom, B gave a read error, C was assigned to the virtual vvfat drive and the others were unassigned. The read error B gave, however, has nothing to do with the image file. If I disconnected all drives except for the cdrom, the error would still be there. It's probably an emulated floppy disk.

I think the problem is in the image file. I've made it using dd in terminal. I used the following configuration:

dd if=/dev/zero of=/sdcard/Win.img bs=64k count=8192

And formatted it with:

mkfs.vfat /sdcard/Win.img

It didn't work. Then I found out old windows versions only support up to 4 kB block or cluster size so I made a new one:

dd if=/dev/zero of=/sdcard/Win.img bs=4k count=131072

And again formatted it with mkfs.vfat.

Since it still didn't work I started experimenting on the filesystems and partitions. I've used fdisk to partition the image:

fdisk /sdcard/Win.img, n, p, 1, 1, 65

But still no result. Maybe I did something wrong here because when I printed the partition table it would say linux at the end.

My question is: does anyone know how to format a disk image with terminal so that it will be recognized by DOS?

3
  • DOS only recognizes FAT16. and no partitions >2gb ever.
    – cybernard
    Commented Jul 17, 2015 at 4:21
  • I was trying to get DOS to recognize the drive because I thought Windows setup needed that in order to recognize it too. It seems that's not the case, but after partitioning it with fdisk in dos, I should have formatted it with the format command. Anyways, thank you all very much, because you did solve the question. Commented Jul 18, 2015 at 19:04
  • 1
    The "block size" you've specified in dd command has nothing to do with the actual block size created by mkfs. Both dd commands are equivalent.
    – ilkhd
    Commented Jul 18, 2015 at 19:25

4 Answers 4

1

mkfs.vfat -F you can use 12 or 16 ONLY.(32 is incompatible with DOS)

mkfs.vfat -F 16 -f 2

You need to avoid the automatic method as it will want to use a 32 bit file system will be incompatible with any DOS program.

The 12 bit file system is traditional reserved for floppy disks. Although, it can be used its MAX size is 1/4 or 512mb of FAT16.

In DOS hard drives are normally FAT16. This is specifically why I said to use 16 bits and the lower case -f 2 indicates 2 copies which is the way DOS works.

3
  • This is not correct "-F FAT-size - Specifies the type of file allocation tables used (12, 16 or 32 bit). If nothing is specified, mkdosfs will automatically select between 12, 16 and 32 bit, whatever fits better for the file system size." mkfs.vfat(8) - Linux man page
    – DavidPostill
    Commented Jul 17, 2015 at 7:23
  • @DavidPostill Yes, the docs says it will auto select, but if it auto select 32 bit DOS will fail to recognize the file system. The user may assume its ok to have a 10gb file system, but when specify 16 bit it will fail and tell them of their error.
    – cybernard
    Commented Jul 17, 2015 at 14:25
  • 2
    Then you should add this to your answer to explain why not to use 32. Your current answer is not clear it reads as if 32 is not an allowed value when it is. And also explain why use 16 and not 12.
    – DavidPostill
    Commented Jul 17, 2015 at 14:30
1

You can streamline the whole process using mkdosfs, especially if you need strict compatibility with DOS. mkdosfs has the -C flag that lets you skip the dd step. To create a 1.44MB floppy disk image called Win.img, enter mkdosfs -C /sdcard/Win.img 1440.

However, I doubt the problem disk image is of floppy disk variety. Even Windows 3.0 takes up between 6-8MB of disk space when installed.

1
  • I've tried mkdosfs and it didn't work. I am, however, using a 512 MB disk image, and not a 1.44 MB floppy image. Commented Jul 18, 2015 at 18:50
1

You can download ready-made hard drives from the internet, including blank ones. People use them as boot images for cdroms.

DOS has a sector size of 512 bytes, and if windows 9x is going to dual boot with an earlier DOS, make the partitions less than 126 MB. This is a fat16 partition that win9x won't convert to fat32.

When you get a partition going, you have to use DOS fdisk to create partitions, and format to format the partitions. You can do this from the floppy. vol only sees the created partitions. You have to set a primary partition 'active' otherwise it won't boot.

Once formatted, you can sys the drive, and install DOS, Windows..

0

By default fdisk creates partitions of type "Linux". You need to change it to "Windows". Go back to fdisk and type (after what you've already typed) "t", "1", "b". Save and exit.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .