VOGONS

Common searches


Large HD images (DOSBOX)

Topic actions

First post, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie

DOSBox cannot mount ISO images larger than 2GB due to some 32-bit functions (fseek/lseek/...) It is required to update the code in order to use 64bit functions that resolve the capacity limitation.

It led me to create a small patch to fix the issue against the current SVN. In my experiment, I was able to mount 4 gigabytes of hard disk image in DOSBox.

Attachments

  • Filename
    larger_than_2gb.7z
    File size
    6.12 KiB
    Downloads
    937 downloads
    File license
    Fair use/fair dealing exception

Reply 2 of 85, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie
leileilol wrote:

What are the limits with the patch, in theory? 110gb?

In theory? I don't know, but I think it depends upon the operating system and the file system.

Note that this is experimental and not a complete patch, meaning that it still may have some bugs. I confirmed that booting from my 4gb hdd img also works though.

Attachments

  • test1.png
    Filename
    test1.png
    File size
    32.57 KiB
    Views
    11237 views
    File license
    Fair use/fair dealing exception
Last edited by ykhwong on 2013-02-11, 17:51. Edited 1 time in total.

Reply 4 of 85, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

Ykhwong's patch is somewhat too aggressive as it changes all fopen functions (you won't need 2gb+ for reading conf, hopefully 😀), but lacking some other fixes (while 4GB might work, 4GB+ probably won't).

Since I've been doing something similar, I merged both patches + hal's megabuild imgmake. I also added the ability to read (fixed size, not dynamic) VHD images.

I tested the following:
- created a new 8GB VHD image with imgmake c:\dosbox\dosbox.vhd -t hd_8gig (the disk will not be formatted, only images <2GB will be formatted by imgmake as it cannot handle FAT32)
- mounted the VHD using Windows 7 Disk Manager
- initialized disk, created 1 partition and formatted it FAT32
- copied almost 8GB of large files to the image and created md5sum of the files
- inside dosbox, the FAT32 volume will not be visible, but Windows can be booted off another disk and will see the FAT32 volume
- ran md5sum and checked that all files are OK
- ran scandisk and checked it was ok

Only images up to 8GB are supported (1023/255/63). More would require working IDE emulation (edit: it seems extended int13/42h would also work). So far, a larger image can be mounted but Windows will most probably return "Error reading sector" as it tries to access data beyond the 1023 cyl. Creating 8GB image takes some time, be patient.

At first, I created the VHD with Win7 Disk Manager. For the 7GB image, it used only 16 heads and some 14000+ cylinders. Such image cannot be used as it exceeds 1023 cyl limit.

What is little known is that any "raw" image (such as the ones dosbox uses) can be converted to VHD with just writing the 512b footer. I use raw2vhd program for that and the functionality is now incorporated into imgmake. Why VHD? Because it can be natively mounted by Win7 & 8...Linux users? Tough luck 😀 (altough it still a valid raw image with the 512b footer at the end, kpartx will handle it just fine 😁)

Attachments

  • Filename
    raw2vhd.7z
    File size
    6.5 KiB
    Downloads
    568 downloads
    File license
    Fair use/fair dealing exception
Last edited by gulikoza on 2013-04-21, 10:35. Edited 1 time in total.

http://www.si-gamer.net/gulikoza

Reply 7 of 85, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

Here's a nice test...added INT13 extensions, so images >8GB (and >1023cyl) are supported. I was able to create a 12GB VHD image in Win7 fill it up and all md5sums passed inside dosbox.

Now the funny thing is, that images <8GB created with W7 disk manager still do not work. INT13 extension functions are not used even if available. I suspect this is because W7 will create a FAT32 partition type 0xB when image is <8GB. When over 8GB, 0xC partition type is created and INT13 extensions are used. Why W7 would create an image with more than 1023 cylinders and not set LBA partition type, I don't know, but maybe this would work if IDE would be supported.

Last edited by gulikoza on 2013-04-21, 10:34. Edited 1 time in total.

http://www.si-gamer.net/gulikoza

Reply 8 of 85, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

I wasn't really planning on working on this much more, but I found a pretty serious bug in the original hal's imgmake command. It creates partitions larger than disk (partition end cylinder is the same as disk geometry, but should be c-1 as cylinder count is zero based the same as heads) and that certainly can't be good 😀

Aside from that, I've fixed imgmake to take parameters in any order (after creating an image named '-t' during my tests 😀). I've added support for mounting empty (no mbr, unformatted) VHD images so they can be partitioned later in the booted system, and added geometry translation for <8GB && >1023cyl VHD images (fixes the problem mentioned in the above post).

BUT, here's a WARNING: Windows 7 Disk Manager no longer aligns partitions to cylinder boundary. While this may seem fine at first (the 7GB image created this way passed all md5sum checks) doing something like 'sys a: c:' will corrupt the filesystem! DOS & W9x officially need all partitions aligned to cylinder boundary (except the first and every logical which should be track +1). I assume images over 8GB (0xC partition type) are fine since they're using LBA and not CHS addressing. Therefore I'd suggest using internal imgmake for images <8GB (or partitioning the image with a program that creates compatible partition table).

Attachments

  • Filename
    mb-dosbox_imgmake.diff
    File size
    37.2 KiB
    Downloads
    358 downloads
    File license
    Fair use/fair dealing exception

http://www.si-gamer.net/gulikoza

Reply 9 of 85, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Moving this to the patches forum DOSBox Patches

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 10 of 85, by DosWin

User metadata
Rank Newbie
Rank
Newbie

I try to create 8gb hard drive image with Windows 98, but without success.
Steps, which I try:
1. Run DB . type - imgmake 8gb.vhd -t hd_8gig
2. Go to Win7 Disk Manager, select 8gb.vhd, init it.
3. Create simple partition, stay max size(max - 8022 MB, min - 8 MB, partition size - 8022MB), dont select word for 8gb.vhd.
4. Format setings: FAT32, 512, no fast format. Got a message - "cluster size is too small for selected filesystem".
5. Disconect 8gb.vhd from Win7 Disk Manager, run raw2vhd.exe. Got message - "default geometry C=1023 H=255 S=63 totalsize=8414461952 bytes complete"
6. Run dosbox with net commands in [autoexec]:
imgmount a "Boot.ima"
imgmount c "8gb.vhd" -t hdd -fs fat -ide 1m
imgmount d "win98se.iso" -fs iso -ide 2m
boot -l a
7. Got for 8gb.vhd - "The image must be on a host or local drive"(but in status window - "Mounted FAT volume is FAT12 with 2847 clusters"). Floppy(622C.img renamed to Boot.img) and CD(WIN98SE CD) mounts normally.
8. Go to D, cd Win98, setup. Got - "Cannot create temporaly folder. If NTFS, create MS-DOS boot sector".
9. View 8gb.vhd in WinImage, see - 0KB, 0 bytes free.

What I am doing wrong? With 2gb and 4gb mounts normally, but I also dont understand how to start Windows 98 installation. 8gb have few more problems.

I think, need more detailed guide\intruction for it, because, I think, its only obstacle to create 8gb hard drive image wth Windows 98.

Reply 11 of 85, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

If you create the vhd with patched dosbox, you don't need to run raw2vhd again as the footer is already written by dosbox (and running it again will create another).

Please re-read this thread...I advised against initing and creating partitions with Win7 Disk Manager as the partition will not be properly aligned for DOS & Win9x. Boot the bootdisk then partition and format the image from DOS.

http://www.si-gamer.net/gulikoza

Reply 12 of 85, by olddosuser

User metadata
Rank Newbie
Rank
Newbie

I just found this post about mounting images lager than 2 GB. I currently have Win98 installed on a 2 GB .img file created with imgmake (Hal's Megabuild). I would like to use the patch to create larger images. What files do I need to download and how to I apply them? Also, what are the steps to create and mount the image? I am running Windows 10 and I also ImDisk installed. I used imdisk to put the Win98 setup folder inside the image to install windows. What is the image size limit?

Reply 14 of 85, by collector

User metadata
Rank l33t
Rank
l33t

They are patches for the source which then has to be compiled. And note that Win9x is not supported in DOSBox. Spare yourself the pain and just use a VM instead of DOSBox.

The Sierra Help Pages -- New Sierra Game Installers -- Sierra Game Patches -- New Non-Sierra Game Installers

Reply 15 of 85, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

I provide a 3rd option for large disk image support through IMGMOUNT. Very simple and not intrusive to existing DOSBox SVN, just 2 files are changed. DOSBox INT13h handler already manages CHS at (1023/255/63) max which can support ~8GB disk image, it is the 32-bit file offset that is limiting the usable file size. Once switching to 64-bit file offset, we can fully utilize the max CHS scheme. No extended INT13h is required.

Hopefully, this can be accepted into DOSBox SVN.

Attached the patch files:
bigdiskCHS_8G - Switch to 64-bit file offset for fseek/ftell to harness the full 1023/255/63 CHS drive geometry.
bigFAT_2G - Switch to 64-bit file offset, fix a likely coding error and use C/255/63 instead of C/16/63 for auto-detecting drive geometry to support full 2G of FAT16 partition.

Attachments

  • Filename
    bigFAT_2G.txt
    File size
    1.38 KiB
    Downloads
    304 downloads
    File license
    Fair use/fair dealing exception
  • Filename
    bigdiskCHS_8G.txt
    File size
    1.26 KiB
    Downloads
    321 downloads
    File license
    Fair use/fair dealing exception
Last edited by kjliew on 2019-12-23, 23:44. Edited 1 time in total.

Reply 16 of 85, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie
collector wrote:

They are patches for the source which then has to be compiled. And note that Win9x is not supported in DOSBox. Spare yourself the pain and just use a VM instead of DOSBox.

I you are trying to recommend something, at least try it before it.. There is not working 3D driver for any Virtualization engine for Windows 98. Vmware is no longer developing 3D drivers for Vista and later, for Windows 9x exist only SVGA driver, Virtualbox and QEMU, VirtualPC never had 3D drivers for Windows 98.

I dont know if now DosBox support Vooodoo glide even in Windows 98, bad it would be hard to add it. Only alternative except real machine is now PCemu, which support up to P233 MMX and 2x Voodoo 2 SLI.

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 17 of 85, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie

Ok now is 2018, are some these patches integrated in some Dos Box build, which i can download?

I have last ykhwongs build -2015 (i really like that topmenu), im quite happy with that, how i do upgraded it to setting newer and the same keep my settings and data?

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 18 of 85, by robertmo

User metadata
Rank l33t++
Rank
l33t++

I think you can try this link
Complete VS2010/2015 build environments for DOSBox SVN
just make sure it works for you

and then just manually edit the files with the patches (the patch are very small so not a problem to do it manually)
you just remove the "-" lines and add "+" lines

Reply 19 of 85, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie
robertmo wrote:
I think you can try this link Complete VS2010/2015 build environments for DOSBox SVN just make sure it works for you […]
Show full quote

I think you can try this link
Complete VS2010/2015 build environments for DOSBox SVN
just make sure it works for you

and then just manually edit the files with the patches (the patch are very small so not a problem to do it manually)
you just remove the "-" lines and add "+" lines

Thanks, but i dont want compile something by myself, that is not limit which i want to cross, i dont even have VS2010/2015 installed.

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.