-
Notifications
You must be signed in to change notification settings - Fork 0
dos
MS-DOS 6.22 can see no more than 1024 cylinders, which is roughly 504 MB with 16 heads (C/H/S = 1024/16/63) and 8032.5 MB with 255 heads (C/H/S = 1024/255/63). Sector size is assumed to be 512 bytes.
A disk image file of 504 MB (with 16 "heads") can be created using the bximage
utility from bochs
. A disk image with 255 "heads" can be created using dd
:
dd if=/dev/zero of=path/to/hda.img bs=512 count=16450560
Don't forget to make the image file sparse:
fallocate -d path/to/hda.img
MS-DOS can be installed using the following [autoexec]
section in dosbox.conf
:
[autoexec]
@echo off
imgmount 2 path/to/hda.img -t hdd -fs none -size 512,63,255,1024
rem Install MS-DOS 6.22, Ctrl+F4 to swap floppy images.
boot path/to/disk01.img path/to/disk02.img path/to/disk03.img
Once MS-DOS is installed, be sure to update the boot command arguments:
[autoexec]
@echo off
imgmount 2 path/to/hda.img -t hdd -fs none -size 512,63,255,1024
cls
boot -l c
If extra partitions (D:, E:, F:) are created in the above 8 GB disk (using DOS
fdisk
), the image file geometry, as reported by Linux fdisk
, will be:
Disk hda.img: 7.84 GiB, 8422686720 bytes, 16450560 sectors
Geometry: 255 heads, 63 sectors/track, 1024 cylinders
Units: cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Cylinders Size Id Type
hda.img1 * 1 261 261 2G 6 FAT16
hda.img2 262 1024 764 5.8G 5 Extended
hda.img5 262 522 261 2G 6 FAT16
hda.img6 523 783 261 2G 6 FAT16
hda.img7 784 1024 241 1.8G 6 FAT16
Yet, upon the very next reboot, MS-DOS will either hang or run into a "divide
overflow" error.
This problem can be worked around: if MS-DOS setup is re-run from the floppy
disks, D:, E:, and F: drives can be formatted during the setup process,
and MS-DOS reinstalled. A run of scandisk
will be required, as some or all
logical drives will have missing FAT backup copies and/or lost clusters.
Still, such a multi-partition disk image will be impossible to correctly mount as a Linux loop device:
If you have VirtualBox installed, the disk image can be converted to the VHD format:
vbox-img convert --srcformat=RAW --srcfilename=hda.img --dstformat=VHD --dstfilename=hda.vhd
If the VHD image is attached to a Hyper-V virtual machine running Linux, fdisk
will show exactly the same geometry:
Running dosfsck
against /dev/sda1
will report bad file name errors,
consistently with the mounted FAT16 file system view:
Still, after all file system errors are fixed, an attempt to boot MS-DOS from the disk image will hang:
At the same time, if the above VHD image is converted back to RAW and
re-attached to DOSBox, MS-DOS boots just fine,
and scandisk
reports no further errors.
Yet, it may be more practical to use a 2 GB disk image (C/H/S = 261/255/63)
and create just a single FAT16 partition:
dd if=/dev/zero of=path/to/hda.img bs=512 count=4192965
The image file may be later mounted as a loop device (assuming codepage 866 is
compiled into the kernel, modprobe nls_cp866
):
sudo mount -t vfat -o loop,offset=32256,codepage=866,iocharset=utf8,fmask=133,uid=$(id -u),gid=$(id -g) path/to/hda.img mountpoint/
By default, DOSBox emulates S3 Trio64V+ video card. Drivers for Windows 3.x are available.
The driver package from S3 replaces some of the bitmap fonts (*.fon
) files
shipped with a localized (e.g.: Russian) version of Windows 3.x.
This messes up Cyrillic fonts.
Be sure to back up your *.fon
files immediately after Windows installation,
and restore the fonts once you've installed S3 video drivers.
Initially, a reasonable config.sys
might look like this:
device=c:\dos\himem.sys /testmem:off /verbose
dos=high,umb
device=c:\dos\emm386.exe min=0 noems novcpi verbose highscan
buffers=15,0
fcbs=4,0
files=30
switches=/F
lastdrive=Z
devicehigh=c:\dos\setver.exe
country=007,,c:\dos\country.sys
devicehigh=c:\dos\display.sys CON=(EGA,866,1)
installhigh=c:\dos\nlsfunc.exe c:\dos\country.sys
devicehigh=c:\dos\ramdrive.sys 8192 512 1024 /E
devicehigh=c:\dos\ansi.sys
autoexec.bat
:
@echo off
prompt $p$g
path c:\dos
set TEMP=c:\tmp
loadhigh c:\dos\smartdrv.exe /X
mode con codepage prepare=((866) c:\dos\ega.cpi)
mode con codepage select=866
chcp 866
loadhigh keyb ru,866,c:\dos\keyboard.sys
loadhigh c:\dos\doskey /insert
After memmaker
is run, it adds /L
(and, sometimes, /S
) arguments to
devicehigh
, installhigh
, and loadhigh
commands. config.sys
:
device=c:\dos\emm386.exe min=0 noems novcpi verbose highscan I=B000-B7FF X=C800-C9FF
devicehigh /L:1,12048 =c:\dos\setver.exe
devicehigh /L:1,15792 =c:\dos\display.sys CON=(EGA,866,1)
devicehigh /L:1,5888 =c:\dos\ramdrive.sys 8192 512 1024 /E
devicehigh /L:1,9072 =c:\dos\ansi.sys
autoexec.bat
:
loadhigh /L:0;2,45456 /S c:\dos\smartdrv.exe /X
loadhigh /L:2,16208 keyb ru,866,c:\dos\keyboard.sys
loadhigh /L:1,6384 c:\dos\doskey /insert
- Файл EMM386.EXE
- Setting Up an "EMS" Configuration with EMM386
- Setting Up a "No EMS" Configuration with EMM386
- The Importance of EMM386
Virtual 8086 mode is a sub-mode of Protected mode. In short, Virtual 8086 mode is whereby the CPU (in protected mode) is running an "Emulated" 16bit Real Mode machine.