Install DOS in DOSBox

For Documentation: Userguides and howto's.

Install DOS in DOSBox

Postby Great Hierophant » 2012-3-22 @ 15:44

It is quite possible to install and use MS-DOS/PC-DOS/DR-DOS within DOSBox. This can be useful for checking software compatibility or getting install programs to work that do not with the built-in DOS in DOSBox. In this guide I will outline the steps in getting it to work. But first, let me start with the limitations :

1. The original DOSes only work with floppy and hard disk images. DOS within DOSBox will NOT work with CD-ROM images. The reason for this is the lack of ATAPI emulation, so no CD-ROM driver will load.

2. This will not assist you in getting hardware features to work that are not emulated in DOSBox, such as BASIC-in-ROM, floppy disk based copy protection, etc.

3. All the items taken for granted in native DOSBox, such as the mouse driver, auto configurations, must be replicated by the user within the disk images.

4. If the DOS you are trying to install is an OEM model, it may fail if it looks for a particular system signature in the BIOS. Tandy DOS may work if machine=tandy.

So, how do you do it? Well, let me give an example using MS-DOS 5.0, among the most popular DOSes of all time.

1. First we prepare a hard drive image. Bochs contains a program called bximage, which can create a bootable hard drive image up to 504MB in size. HAL9000's most recent DOSBox Megabuild has a program called imgmake that will allow you to create a bootable hard drive image up to 2GB. Typically you should not need more than 504MB. The default geometry of a 504MB disk image is 1024 cylinders, 16 heads, 63 sectors, 512 bytes per sector.

Run bximage and input a hard disk size anywhere from 10-504MB. Users of DOS prior to 4.0 should not use a hard drive size greater than 32MB unless you want to attempt to use multiple partitions on the disk image. Make sure the image is "flat" and write down the disk geometry, which will be important later. Name the resulting image file using the 8.3 format limitations, making sure to use the .img extension.

2. Obtain a complete set of floppy install disks for MS-DOS 5.0. Usually, MS-DOS 5.0 was released on 3x720KB or 6x360KB floppies. The first disk is bootable. Make sure their file names are in the 8.3 format and they use the img. extension. There is no difference between .ima and .img files, but DOSBox will only use its BOOT command with the latter.

3. Input these commands into your dosbox.conf file :
imgmount 2 [insert path and file name of hard disk image] -t hdd -fs none -size 512,63,16,1024
boot [insert path and file name of floppy disk images]

Make sure they are the only commands that are active! If you are using the 720KB MS-DOS installation disks, use file names like msdos13.img msdos23.img msdos33.img and put all of them after the boot.

4. Start DOSBox, and if everything went correctly, you will get to the install program. Follow the prompts, they are pretty self-explanatory. Switch disks with Ctrl + F4 when prompted. When the install program finishes, quit DOSBox by closing its window.

5. Change the above lines in your dosbox.conf to the following :

imgmount c [insert path and file name of hard disk image] -t hdd -fs fat -size 512,63,16,1024
mount d [insert path of directory to which you can to copy files from/to the hard drive image]
boot [insert path and file name of hard disk image] -l c

Your hard drive image will now boot to DOS and you can do useful things with it. You will need to mount a directory or images to copy files to/from the disk image.

6. Now you need to tame DOS. You have access to EDIT, so edit Autoexec.bat and Config.sys to suit your preferences. You should copy a mouse driver, since MS-DOS does not have one. Use Cutemouse's v1.91 for good results. You can also add SET SOUND and SET BLASTER variables for Sound Blaster support and copy over an appropriate CT-VOICE.DRV. You can install the Gravis Ultrasound drivers, Windows 3.x, etc.

EMM386.EXE is a bit tricky. With such a basic configuration, you should not need it for UMBs, but for Expanded Memory you will need it. Use the following line : DEVICE=C:\DOS\EMM386.EXE 4096 M5

You can REM the line out if you do not need it. Without the M switch, EMM386 will not be able to set the page frame and will not provide EMS memory.

7. To install programs and games from a floppy disk, you will need to a bootable floppy disk image. Unfortunately, this is a bit tricky when you boot off a hard disk image in DOSBox, as it will not recognize imgmount floppies. Make a copy of the original install disk, BOOT it, exit out of the install program, and edit the autoexec.bat and config.sys files to match your hard drive versions.

8. One you have a good boot disk, you can install whatever programs you like using these commands :

imgmount c [insert path and file name of hard disk image] -t hdd -fs fat -size 512,63,16,1024
boot [insert path and file name of bootable floppy disk image] disk1.img disk2.img . . . diskx.img

Use Ctrl + F4 to switch disks as the install program requests. This will allow you to install programs on floppy disk images to your hard drive that would not be installable in vanilla DOSBox.
Last edited by Great Hierophant on 2013-10-25 @ 20:28, edited 1 time in total. - Nerdly Pleasures - My Retro Gaming, Computing & Tech Blog
User avatar
Great Hierophant
Posts: 2398
Joined: 2003-4-27 @ 08:20

Re: Install DOS in DOSBox

Postby Dominus » 2012-3-22 @ 16:40

Good guide, small spell correction, step 8, you mean "Once" not one.

The old hard disk image guide also mentions a good windows program that allows one to put files on an image without having to use dosbox. Might be worth to mention if that program still exists. On a quick read over I didn't see it mention here but I'm tired and might have missed it ;)

Edit: I meant Disk Explorer from that guide viewtopic.php?t=7260 (worth mentioning, that you need to have the disk image partitioned and formatted before you can copy files to it :))
User avatar
DOSBox Moderator
Posts: 7975
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Install DOS in DOSBox

Postby DosFreak » 2012-3-22 @ 18:04

The image creation and mounting process is a pain for most users. (Mostly because they refuse to read)

A while back I created standard images for download here for 9x:

Probably best to include a .txt file with mount parameters along with the .img with each .zip.
Should be able to mount .img files.
User avatar
Posts: 10444
Joined: 2002-6-30 @ 16:35
Location: Your Head

Re: Install DOS in DOSBox

Postby ripsaw8080 » 2012-3-22 @ 19:05

Make sure their file names are in the 8.3 format and they use the img. extension. There is no difference between .ima and .img files, but DOSBox will only use its BOOT command with the latter.

AFAICT, DOSBox does not have such limitations on image filenames.
User avatar
DOSBox Author
Posts: 4406
Joined: 2006-4-25 @ 23:24

Return to DOSBox Guides

Who is online

Users browsing this forum: No registered users and 2 guests