China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-20 23:16
中国DOS联盟论坛 » GRUB4DOS、SYSLINUX及其它启动管理软件讨论专区 » Troublesome problems with GRUB, everyone consult together DigestI View 46,956 Replies 280
Floor 121 Posted 2004-01-28 00:00 ·  美国
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Budian: I just tested it, and it proves that the map method of GRUB for DOS is effective for both DOS and Windows ME. After disabling the second hard disk with the map command, neither DOS nor WinME can see the disabled hard disk. From this it can be seen that Win9x/ME bypassing BIOS for disk access has certain limits; perhaps problems only occur in cases such as disk-image virtualization? Also, everything above refers to the situation when WIN's "32-bit protected-mode disk access" is enabled, not to mention the case when "32-bit protected-mode disk access" is turned off. In any case, by using GRUB's map command to disable a hard disk, I have successfully solved the problem where drive-letter interleaving in a dual-hard-disk setup caused WinME to fail to boot properly, so I no longer need to set it in BIOS. It can be said that this time GRUB for DOS/NTLDR has truly solved a real problem I recently encountered, so thank you very much for your fine work, and I hope it becomes more and more powerful and practical!
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 122 Posted 2004-01-28 00:00 ·  中国 河南 南阳 内乡县 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
Hehe, really not bad! I'm very happy too! It seems good people really do get good rewards—after all the many things you've done for GRUB for DOS/NTLDR, there really ought to be some return.

Your successful test shows that the GRUB for DOS program code is robust enough. This further strengthens my confidence. My heartfelt thanks to you!

As for the situation with "32-bit protected-mode disk access", we still need to study it further. After 0.2.0 I don't plan to continue developing, but we can fully test all kinds of behavior of 0.2.0 under windows and see exactly what new situations appear.
因为我们亲手创建,这个世界更加美丽。
Floor 123 Posted 2004-01-28 00:00 ·  中国 河南 南阳 内乡县 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
The following is quoted from i659's post on 2004-1-28 12:22:26:
我用  blocklist 看了一下:
blocklist (hd0,6)/boot.flp
(hd0,6)13700944+5760

显示这样,应该没有碎片吧(我不是太清楚的说,对这方面我不是太懂的说)


Yes, this is a contiguous file; all 5760 sectors are joined together in one piece, with no fragmentation.

5760 × 512 = 2880 × 1024

That means it is a contiguous 2.88M file.

This file can be used by grub_t14/t15 to emulate a 2.88M floppy.
因为我们亲手创建,这个世界更加美丽。
Floor 124 Posted 2004-01-28 00:00 ·  中国 河南 南阳 内乡县 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
The following is quoted from i659's post on 2004-1-28 13:47:31:
或许是程序的问题,在dos下我用的是  grub for dos 0.1.4  (下载地址  

http://newdos.yginfo.net/dosware/grub/grub014.zip )
版本就出现上面的贴子中出现的问题,找不到kernel
刚换了一下最新的测试版 grub_t14.exe 
( ftp://211.100.7.71/incoming/grub_t14.exe  &nbsp
 就解决问题了,但还是出现在用ntloader 中出现的提示:
Autodetect number-of-heads failed.  Use default value 2
Autodetect sectors-per-track failed.  Use default value 36     

跟在windows xp中一样,后面步骤能够继续


The disk-emulation core in grub_t14/15.exe and grub_for_ntldr-test??? is the latest one. So their effect is the same.


Autodetect number-of-heads failed. Use default value 2
Autodetect sectors-per-track failed. Use default value 36

These two messages are not errors. When the first sector of the floppy does not have a DOS BPB structure, this message will appear. Because automatic detection of the DOS BPB structure fails, the default of 2 sides 【that is, two heads】 and 36 sectors per track is used for emulation. For a 2.88M disk, this is correct.

You can continue. As far as floppy emulation is concerned, there is no danger.
因为我们亲手创建,这个世界更加美丽。
Floor 125 Posted 2004-01-30 00:00 ·  中国 香港 环球全域电讯国际互联节点
中级用户
★★
Credits 385
Posts 118
Joined 2003-11-11 00:00
22-year member
UID 12678
Gender Male
Status Offline
Hi TinyBit,

Your previous message says:

******
GRUB for DOS 0.1.x generally does not support 2.88M floppies. GRUB for DOS 0.2.0 supports floppy images of any size, and also supports emulation of hard disk images of any size. Although the official version of GRUB for DOS 0.2.0 has not yet been released, the current test version is almost equivalent to the official version.
******

in which: also supports emulation of hard disk images of any size

I want to know:

1. What are the exact commands for doing that? Could you give some examples?

2. After issuing such commands and booting the harddisk image file into real DOS mode, is there any way or real DOS mode programme that we can use to unmap/hide/delete such mapping? Could we use DOS Subst command?

Thanks a lot!
Floor 126 Posted 2004-01-30 00:00 ·  中国 河南 南阳 内乡县 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
Reply to brother windrv:

1. What are the exact commands for doing that? Could you give some examples?

Example 1: use an img file to emulate BIOS hard disk 0x80 【the img file must not be fragmented on disk】:
map (hd0,0)/hd.img (hd0)

Example 2: use DOS partition (hd0,4)+1 to emulate BIOS hard disk 0x80:
map (hd0,4)+1 (hd0)

As for hard disk emulation, there are security issues to pay attention to. Try not to boot windows while a hard disk is being emulated. There is a detailed explanation at the end of the following webpage:
http://www.linuxeden.com/edu/doctext.php?docid=3006

2. After issuing such commands and booting the harddisk image file into real DOS mode, is there any way or real DOS mode programme that we can use to unmap/hide/delete such mapping? Could we use DOS Subst command?

After emulating a disk and entering an operating system, the emulation should not be removed at that point, otherwise the operating system will become confused. This is because the operating system has already accepted the emulation that has been put into effect. If that emulation is suddenly removed, the system will not be able to find the files it needs. For example, if drive C: is emulated and contains command.com, then if the emulation is removed, the system will no longer be able to find command.com. This is only an example; in fact, after removing the emulation, even more complicated situations can occur. Programs that read and write by sector would bring disaster and damage the data on the real hard disk. Therefore, GRUB does not provide a DOS command or similar method to remove emulation.

However, if you run GRUB.exe again under DOS, the previous emulation will be completely canceled. If you do not use the map command again, no emulation will continue to take effect. This is safe, because after running GRUB.exe, it means the original DOS environment no longer exists.
因为我们亲手创建,这个世界更加美丽。
Floor 127 Posted 2004-01-30 00:00 ·  中国 香港 环球全域电讯国际互联节点
中级用户
★★
Credits 385
Posts 118
Joined 2003-11-11 00:00
22-year member
UID 12678
Gender Male
Status Offline
The following is quoted from Budian's post on 2004-1-30 13:27:03:
回 windrv 兄:

1. What are the exact commands for doing that? Could you give some examples?

例子1:用某个 img 文件仿真 0x80 号的 BIOS 硬盘【要求 img 文件在磁盘上没有碎块】:
map (hd0,0)/hd.img (hd0)

例子2:用 DOS 分区(hd0,4)+1 仿真 BIOS 的 0x80 号硬盘:
map (hd0,4)+1 (hd0)

关于硬盘仿真,有安全问题,需要注意,尽量不要在仿真硬盘的情况下启动windows。在以下网页的尾部有详细说明:
http://www.linuxeden.com/edu/doctext.php?docid=3006

2. After issuing such commands and booting the harddisk image file into real DOS mode, is there any way or real DOS mode programme  that we can use to unmap/hide/delete such mapping? Could we use DOS Subst command?

仿真一个磁盘,进入某个操作系统之后,这时候不应当撤掉仿真,否则操作系统会混乱。因为操作系统已经认可了已经实施的仿真,假如突然撤掉这个仿真,则系统将找不到所需要的文件。例如,当 C: 盘是仿真的,里面有 command.com 文件,这时,如果撤掉仿真,则系统将无法找到 command.com 文件。这仅仅是举例,其实撤掉仿真之后还有更复杂的情况会发生,按照扇区读写的程序将会带来灾难,破坏掉真实硬盘上的资料。所以,GRUB 不提供撤掉仿真的 DOS 命令或者类似的方法。

但是,如果在 DOS 下再次运行 GRUB.exe 命令,则以前的仿真即被完全撤销。如果不再次使用 map 命令,将不会有任何仿真继续起作用了。这是安全的,因为运行 GRUB.exe 之后,就意味着原来的 DOS 环境不复存在了。






Dear TinyBit,

Thank you very much!

I however wish you could clarify what would happen if I do the following:

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?
and
Does the only partition in the hard disk appear as D:?

So if could I issue DOS Subst command as:

Subst C: D:\

and I could use DOS normally and have the partition appear as both C: & D:?
Floor 128 Posted 2004-01-30 00:00 ·  中国 河南 南阳 内乡县 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
Brother windrv:

Thank you for your question. Your question is very thought-provoking.

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?

Yes. Since hd.img becomes the first BIOS hard disk, one of its partitions will become drive C:. Note that it may contain multiple logical partitions; if they exist, they will become D:, E:, and so on.

Does the only partition in the hard disk appear as D:?

No. GRUB for DOS does not increase the number of disks in the system. GRUB for DOS merely redirects reads and writes to (hd0) to the file (hd0,0)/hd.img. If there is no other hard disk (hd1) in the system, then GRUB for DOS will not add another hard disk (hd1) either. However, if a real (hd1) does exist in the system, then you can use these two commands together:

map (hd0,0)/hd.img (hd0)
map (hd0) (hd1)

to define your disk map. This way, when BIOS accesses hard disk 0x80, it goes to hd.img, and when it accesses 0x81, it goes to the real 0x80 hard disk. In this case, the partition on the real 0x80 hard disk will be accessed, that is, it will become drive D:. And the real 0x81 disk will become inaccessible—in other words, it will be hidden.

As discussed earlier with wengier, our GRUB for DOS does not increase the total number of disks, nor does it decrease it. To increase or decrease the total number of disks, the bytes in the BIOS data area for the number of hard disks and floppy drives must also be modified. We have not implemented that 【nor do we plan to, but if many people ask for it, I can consider adding this function】.

If there is a real (hd1) hard disk and you want to make C: == D:, you do not need DOS's subst command. We can do it like this:

map (hd0) (hd1)

This command causes reads and writes to 0x81 to be redirected to 0x80. So drive D: will be exactly the same as drive C:. And the real 0x81 hard disk will become inaccessible.

For comparison, the following commands will swap 0x80 and 0x81:

map (hd0) (hd1)
map (hd1) (hd0)

Both hard disks can be accessed, but the real C: becomes the virtual D:, and the real D: becomes the virtual C:.
----------------

Everything above assumes you are running only DOS, not windows.
因为我们亲手创建,这个世界更加美丽。
Floor 129 Posted 2004-01-30 00:00 ·  中国 香港 环球全域电讯国际互联节点
中级用户
★★
Credits 385
Posts 118
Joined 2003-11-11 00:00
22-year member
UID 12678
Gender Male
Status Offline
The following is quoted from Budian's post on 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?
Floor 130 Posted 2004-01-30 00:00 ·  中国 河南 南阳 内乡县 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
Reply to brother windrv:

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?

Yes. And this fact has nothing to do with "having only one partition". You may have more than one partition, as long as there is only one hard disk. More than that, this actually has nothing to do with the number of hard disks either. The single command "map (....)/somewhere/some_img_file (hd0)" always hides the real hard disk 0x80 and treats (....)/somewhere/some_img_file as the virtual hard disk 0x80.

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
A correction in wording. It should be Turn the bootable harddisk into a hd.img. The file hd.img should include the MBR, that is, the master boot sector; otherwise it cannot be used to emulate a hard disk, and can only be used to emulate a floppy.

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

As said above, the file hd.img includes the MBR, as well as DOS boot-sector code, io.sys, and so on.

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
Yes, this step should succeed.

5. WINDRV loads rd.img in hd.img as ramdisk D:
6. WINDRV swaps C: with D:
These two steps are your company's own special skill; you yourselves know how it works.

7. we issue "Subst D: C:\" to hide the hd.img
Usually this step is also valid. Your company knows how it works.

8. After issuing WIN.COM, we enter into Windows protected mode
Since you only used hd.img as the emulated disk, and the subst command hides it, then under normal circumstances windows should no longer be able to find it. In other words, windows should be able to start.

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.
Yes, if windows can start, it can usually find the real hard disk.

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?

I don't see anything inappropriate about it. It seems like a very good idea.
因为我们亲手创建,这个世界更加美丽。
Floor 131 Posted 2004-01-31 00:00 ·  中国 广东 广州 天河区 电信
中级用户
★★
Credits 385
Posts 118
Joined 2003-11-11 00:00
22-year member
UID 12678
Gender Male
Status Offline
Floor 132 Posted 2004-02-01 00:00 ·  中国 河南 南阳 内乡县 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
The test version of GRUB for DOS is being kept together with GRUB for NTLDR for the time being. The latest test version uses GNU GRUB 0.94.

Info page:
http://www.linuxeden.com/download/softdetail.php?softid=1026

Download:
ftp://211.100.7.71/incoming/grub_for_ntldr-test005.tar.gz
因为我们亲手创建,这个世界更加美丽。
Floor 133 Posted 2004-02-03 00:00 ·  中国 广东 深圳 教育网
初级用户
Credits 150
Posts 18
Joined 2003-10-13 00:00
22-year member
UID 11178
Gender Male
Status Offline
Hehe, grub for dos is getting more and more complete. But is there an updated version that can be installed into the MBR (that is, the stage2 file you gave me last time) ^_^
Floor 134 Posted 2004-02-03 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
Next time together.

Considering that the current test stage is about to be completed, the next test version of GRUB FOR NTLDR will include all those STAGE files.

Just wait a few more days.

Thank you for your continued follow-up and support.
因为我们亲手创建,这个世界更加美丽。
Floor 135 Posted 2004-02-03 00:00 ·  中国 广东 深圳 教育网
初级用户
Credits 150
Posts 18
Joined 2003-10-13 00:00
22-year member
UID 11178
Gender Male
Status Offline
Hehe, I can't help much, so I can only be a lurker , but watching grub for dos getting better and better is still very exciting.
‹ Prev 1 7 8 9 10 11 19 Next ›
Forum Jump: