Setting input-charset to 'UTF-8' from locale.
Size of boot image is 65552 sectors -> Emulating a hard disk
30.20% done, estimat […] Show full quote
Setting input-charset to 'UTF-8' from locale.
Size of boot image is 65552 sectors -> Emulating a hard disk
30.20% done, estimate finish Sat Jul 24 15:13:50 2021
60.43% done, estimate finish Sat Jul 24 15:13:50 2021
90.57% done, estimate finish Sat Jul 24 15:13:50 2021
Total translation table size: 2048
Total rockridge attributes bytes: 0
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used 22000
16564 extents written (32 MB)
and the iso file is roughly the correct size.
So k3b cd burner software happily burns the CD.
I put the CD in the target machine, try to boot it up, and instead of being told to insert a system disk, it recognizes it as a hard drive then the system stalls and my only option then is to turn off the computer.
The exact message on the screen since the target machine is a Dell Wyse thin client is:
Ok, I think I figured it out.
Well, at least I got it where the CD boots, the command prompt loads and the disk free space is accurate.
So here's how to do it if you want a 32MB bootable hard drive from CD:
1. Get dosemu installed,
2. create the folder named disk in your root drive,
3. change to "/disk" folder
4. create the file /disk/emu.conf and put these contents in it:
5. Get a valid dos boot floppy image and put it in the "/disk" folder. Mine is called dos6.22.img. That image must be able to boot dos 6.0 or later. Windows 9x/me boot disks would work too.
6. create a script that contains the following contents. Save it as something and put the file in the "/disk" folder.
7. execute the script. Dosemu box should appear and you should see its own bios screen with a "Starting (insert os)....". If you get a menu of options, you don't need to load any additional drivers.
Once you see the familiar command prompt, you'll need to execute the following 2 statements.
I discovered that failing to execute the last statement was what caused the DOS boot sequence to freeze before anything appeared on screen.
1SYS A: C: 2FDISK /MBR
8. copy whatever necessary over to the C: drive and that will be on the bootable CD later.
9. force-close dosemu
The rest of the script will create another image file then an iso file ready to be burned onto the CD
Then in your favorite burning software, when you make the CD, you need to choose the image file (/disk/new.iso) as the thing to burn.
Glad you got it to work and thanks for sharing the steps.
Just a question as to what distro/release you are using as compiling the latest release of the original DOSEMU on current Debian is, to put it mildly, less than fun .
I also managed to create a successfully bootable ISO, but did not use DOSEMU and did so on a current Linux distro with a 5.10 kernel . I used a Windows 98 SE bootable rescue floppy (as created in Windows 98 SE) as a starting point, but this should be adaptable to practically any DOS version (ok, maybe not if your preferred version does not have fixed disk support 😉 )
If using a version of DOS below 5.00 , DOS fdisk will not have an /mbr option . This means that the partitioning and formating will need to be done manually on the mounted disk image from within DOSBox (I have tested this once : instead of creating the partition with Linux fdisk, I did it from within DOSBOX and then DOS 7.1's format /s was enough the make the partition successfully bootable without running fdisk /mbr )
a) use bximage to create a 504MB image file ( could have used dd, but bximage calculates cylinder count for me) : bximage -mode=create -hd=504 -imgmode=flat -q /disk/newc.img
root@openmediavault:/disk# bximage -mode=create -hd=504 -imgmode=flat -q /disk/newc.img
========================================================================
bximage
Disk Image Creation / Conversion / Resize and Commit Tool for Bochs
$Id: bximage.cc 13069 2017-02-12 16:51:52Z vruppert $
========================================================================
Creating hard disk image '/disk/newc.img' with CHS=1024/16/63
The following line should appear in your bochsrc:
ata0-master: type=disk, path="/disk/newc.img", mode=flat
Spoiler
b) use Linux fdisk to create a DOS partition table with a single FAT16 NON-LBA partition (type 6) I also set partition active/bootable : printf "o\n n\n p\n 1\n \n \n t\n 6\n a\n w\n" | fdisk -c=dos /disk/newc.img
Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
DOS-compatible mode is deprecated.
Created a new DOS disklabel with disk identifier 0x5e45079f.
Command (m for help): DOS-compatible mode is deprecated.
Created a new DOS disklabel with disk identifier 0xedc7fe70.
Command (m for help): Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (63-1032191, default 63): Last sector, +/-sectors or +/-size{K,M,G,T,P} (63-1032191, default 1032191):
Created a new partition 1 of type 'Linux' and of size 504 MiB.
Command (m for help): Selected partition 1
Hex code (type L to list all codes): Changed type of partition 'Linux' to 'FAT16'.
Command (m for help): Selected partition 1
The bootable flag on partition 1 is enabled now.
Command (m for help): The partition table has been altered.
Syncing disks.
Device Boot Start End Sectors Size Id Type
/disk/newc.img1 * 63 1032191 1032129 504M 6 FAT16
Spoiler
c) Tweak the Windows 98 SE boot floppy image # warning do not boot from that floppy image unless you intend it to automatically format the c: drive without prompting: mount /disk/win98floppy.img /mnt
sed -i 's/menudefault=CD,30/menudefault=NOCD,1/g' /mnt/CONFIG.SYS
dos2unix /mnt/AUTOEXEC.BAT
echo "%RAMD%:\format c: /s /autotest" >> /mnt/AUTOEXEC.BAT
echo "fdisk /mbr" >> /mnt/AUTOEXEC.BAT
unix2dos /mnt/AUTOEXEC.BAT
umount /mnt
Spoiler
root@openmediavault:/disk# mount /disk/win98floppy.img /mnt
root@openmediavault:/disk# sed -i 's/menudefault=CD,30/menudefault=NOCD,1/g' /mnt/CONFIG.SYS
d) Let DOSBox format the partition for you using the floppy image modified in step c : and close DOSBox once format has finished . dosbox -c "mount d /disk" -c "d:" -c "imgmount 2 \"newc.img\" -size 512,63,16,1024 -t hdd -fs none" -c "boot \"win98floppy.img\""
Spoiler
e) Copy the HD image to the folder you want to use and generate the ISO file cp /disk/newc.img /outiso/
genisoimage -b newc.img -hard-disk-boot -o /disk/new.iso /outiso
Of course, if one wants to add files to the HDD the image prior to creating the ISO, mount the image through a loop device and copying files to it is possible as is using MTOOLS, if desired (no offset specify in either case as no DOSEMu header). I chose a 504MB image size as that is the biggest size that is mountable is DOSBox without resorting to fudging head/cylinder values (i.e. doubling the number of heads and halving the number of cylinders to keep cylinder count at 1024 or less) .
Also, it seems that multi-partition disk images cannot be used to create a bootable HDD image on an ISO using genisoimage (mkisofs successor). Whether this a limitation of the El Torito spec or of genisoimage I do not know .
root@openmediavault:/disk# genisoimage -b c.img -hard-disk-boot -o new.iso /outiso
I: -input-charset not specified, using utf-8 (detected in locale settings)
Size of boot image is 1252944 sectors -> Emulating a hard disk
Warning: image size does not match geometry (17316)
genisoimage: Boot image '/outiso/c.img' has multiple partitions.
Glad you got it to work and thanks for sharing the steps.
Just a question as to what distro/release you are using as compiling the latest release of the original DOSEMU on current Debian is, to put it mildly, less than fun .
Slackware 14.0 32-bit and I downloaded the latest dosemu 1.4