DOS on NTFS

From Grub4Dos Wiki

Jump to: navigation, search

This tutorial has currently it's focus on FreeDOS and Windows XP, it's also possible to expand these instructions for example to MS-DOS and Windows Vista, it's even possible to expand these instructions to Linux as grub4dos also supports ext2/3/4. The clue is that you install DOS which is not able to boot from NTFS directly to a NTFS partition without the need to change partitions, it will result in a fully appropriable DOS with permanent and full read and write access.

First you need to create raw image what this is and how to do so is described in the article raw image format. (dd if=/dev/zero of=c:\FreeDOS.img count=2000000) To prevent into the error "Error 60: File for drive emulation must be in one contiguous disk area" read http://diddy.boot-land.net/grub4dos/files/map.htm and use contig or wincontig before you use the image the first time. The raw image will be called FreeDOS.img in this tutorial and placed at C:\FreeDOS.img.

You can either install DOS to this image using a virtual machine supporting the raw image format (such as Qemu or Bochs) or you can install directly to this image on bare metal using grub4dos's device emulation features.

fdfullcd.iso is the FreeDOS installer CD you can download from http://www.freedos.org/, in this tutorial it will be placed on root folder on C:\ but you are free to adjust the paths yourself.

Use this as menu.lst and place it at C:\menu.lst.

timeout 30
color cyan/black black/light-gray green/black yellow/black

title booting FreeDOS from raw image (as harddisk)\nuse this to boot FreeDOS after you installed it
map --unsafe-boot /FreeDOS.img (hd0)
map --hook
chainloader --force (hd0)+1
rootnoverify (hd0)

title booting FreeDOS from raw image (as harddisk) + FreeDOS installer CD\nit's up to the operating system to load a device driver for the virtual CD-ROM, for example:\ndevload eltorito.sys /D:eltorito\nshsucdx.com /D:eltorito
map --unsafe-boot /FreeDOS.img (hd0)
map /fdfullcd.iso (hd32)
map --hook
chainloader --force (hd0)+1

title booting FreeDOS installer CD + FreeDOS from raw image (as harddisk)\nuse this to install FreeDOS
map /fdfullcd.iso (hd32)
map --hook
chainloader (hd32)
map --unsafe-boot /FreeDOS.img (hd0)
map --hook
rootnoverify (hd0)

title booting FreeDOS from raw image (as superfloppy)\nFreeDOS.img will get drive letter A:\ assigned\nif you want this it's up to you to keep care on relative paths\n not working yet
map --unsafe-boot /FreeDOS.img (fd0)
map --hook
chainloader --force (fd0)+1
rootnoverify (fd0)

title back to Windows Boot Menu\nreturn to ntldr
chainloader /ntldr

To start grub4dos form Windows XP Boot Menu edit the hidden file C:\boot.ini, initially it should look for example like

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect

and you must edit it to

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
C:\grldr="start grub4dos"

Download grub4dos and extract it so you get a menu structure like C:\boot\grub\grub.exe etc. Copy grldr from C:\boot\grub\grldr also to C:\.

After booting you should see the grub4dos menu entry in Windows XP Boot Menu.

Now you can install FreeDOS "as usual", first use fdisk and create a bootable primary partition, then reboot, then format the new partition on the virtual harddisk and use sys to make it bootable and/or use the FreeDOS installer.

To access the NTFS partition from FreeDOS you can use a NTFS driver for DOS. If you want to mount and read/write the image file where FreeDOS is inside you can look at raw image format.

Personal tools