以下是引用不点在2004-1-30 16:15:55的发言:
windrv兄:
谢谢您提的问题。您的问题很有启发性。
1. I have one hard disk with only one FAT32 partition.
2. I boot Grub for DOS and map (hd0,0)/hd.img (hd0)
3. and boot hd.img with DOS system
Does hd.img appear as C: after booting into real DOS mode?
是的,由于 hd.img 成为第一个 BIOS 硬盘,所以,它里面的某个分区将成为 C: 盘。注意它里面可以有多个逻辑分区的,那些逻辑分区,如果存在的话,将成为 D:, E: 等等。
Does the only partition in the hard disk appear as D:?
不。GRUB for DOS 不增加系统中磁盘的个数。GRUB for DOS 仅仅把 (hd0) 的读写,重新定向到 (hd0,0)/hd.img 文件。如果系统中没有另外一个硬盘 (hd1),那么 GRUB for DOS 也不会增加上一个硬盘 (hd1) 的。但是,如果系统中存在一个真实的 (hd1),则您可以同时用这样两条命令:
map (hd0,0)/hd.img (hd0)
map (hd0) (hd1)
来定义您的磁盘 map。这样,BIOS 访问 0x80 硬盘的时候,就去找 hd.img ,而访问 0x81 硬盘的时候,就去找 真实的 0x80 号硬盘。如此一来,真实的 0x80 号硬盘上的那个分区,就会被访问到的,也即,会成为 D: 盘。而真实的 0x81 号磁盘,将不可访问了,也就是,它将被隐藏了。
正如以前和 wengier 讨论的那样,我们的 GRUB for DOS 不增加磁盘总数,也不减少磁盘总数。要想增减磁盘总数的话,必须同时修改 BIOS 数据区中的硬盘和软盘个数字节;这一点,我们没有实现【也不打算实现,不过,如果有很多人要求实现的话,我可以考虑加入这一功能】。
假如有了真实的 (hd1) 硬盘,要达到 C: == D: 的目的,不需要 DOS 的 subst 命令。我们可以这样做:
map (hd0) (hd1)
这条命令使得对 0x81 的读写,转向对 0x80 进行读写。所以,磁盘 D: 将和磁盘 C: 完全一样。而真实的 0x81 号硬盘将不可访问了。
作为对比,以下命令将交换 0x80 和 0x81 :
map (hd0) (hd1)
map (hd1) (hd0)
两个硬盘都可以访问,不过真实的 C:成了虚拟的 D:,而真实的 D:成了虚拟的 C:了。
----------------
以上都假定只运行 DOS,不运行 windows。
Dear TinyBit,
Thank you very much for your clarification.
From your clarification, I now know that:
If I have only one hard disk with one FAT32 partition in which I place the hd.img,
after mapping the hd.img and booting it up, my hd0 will disappear and the hd.img
within will become C:. Is that correct?
What I actually want is to explore whether and how your Grub For DOS can be used
together with our WINDRV to enable users to deploy different bootable img files on
a FAT32 hard disk so that they can start up Grub For DOS and boot into these
different bootable img files so that they can select different versions of Win95, Win98
or WinMe of different sizes and different configurations and run these graphical OSes
safely.
Let me explain a little bit how WINDRV takes Win95/98/ME to run on ramdisk.
Suppose we have one hard disk with one partition.
After booting in DOS from this single harddisk-partition C:, we run a loader, WDDOS,
which loads up a real-mode ramdisk driver and copy an img file onto the ramdisk D:.
Let's call this img file rd.img.
WDDOS then maps the harddisk-partition C: as D: and the ramdisk D: as C:
WIN.COM is then run and the system runs into protected mode Win95/98/ME.
With your Grub For DOS, we may perhaps do something like that:
1. Turn the bootable harddisk-partition into a hd.img
2. The hd.img contains boot-sector code, io.sys, command.com, msdos.sys,
config.sys, himem.sys, ifshlp.sys and our WINDRV product files as well as the
rd.img
3. Reformat a brandnew single hard-disk partition into FAT32 and install
Grub For DOS
4. Boot up hd.img as C: and run WINDRV
5. WINDRV loads rd.img in hd.img as ramdisk D:
6. WINDRV swaps C: with D:
7. we issue "Subst D: C:\" to hide the hd.img
8. After issuing WIN.COM, we enter into Windows protected mode
9. I guess Windows 95/98/ME will then recognize the original hd0 as E:
and access it using 32bit protected mode driver. And hd.img will re-appear
on E: as a file.
So we can have a 95.img, mini95.img, 98.img, mini98.img, ME.img, miniME.img
or as many as we could on the hd0.
On start up Grub For DOS, we can let people select which OS of the size and
configuration they want to boot up.
We can back up these img files and this prevent virus attack.
By the way, for computer that can boot up USB hard disk, the only USB hard disk
can be removed also. So only ramdisk Windows is run on a standalone diskless
computer.
How do you think?
Is this workable?