|
Qlin
初级用户
 
积分 131
发帖 11
注册 2005-3-21
状态 离线
|
『楼 主』:
在grub of dos中虚拟二个软驱的问题。
使用 LLM 解释/回答一下
因为一些原因要在grub of dos中虚拟二个软驱 ,过程如下。
map (hd0,0)/boot.flp (fd0)
map (hd0,0)/kern.flp (fd1)
chainloader (hd0,0)/boot.flp
chainloader (hd0,0)/kern.flp
rootnoverify (fd0)
boot
之后好像不行。还是不能读取 kern.flp ,请问要如何解决。。?
PS 。请问windows下有什么软件可以修改软驱镜像文件(*.flp) ?? 谢谢
Because of some reasons, I need to virtualize two floppy drives in grub of DOS. The process is as follows.
map (hd0,0)/boot.flp (fd0)
map (hd0,0)/kern.flp (fd1)
chainloader (hd0,0)/boot.flp
chainloader (hd0,0)/kern.flp
rootnoverify (fd0)
boot
After that, it still doesn't work. Still can't read kern.flp. How to solve it??
PS. What software under Windows can modify floppy disk image files (*.flp)?? Thanks
|
|
2005-3-21 00:00 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
chainloader 命令是决定用哪个引导扇区来引导操作系统,因此,chainloader 命令只能用一次才有效。如果该命令使用多次,则只有最后一次的才起作用,在此之前的那些 chainloader 命令都等于是废的。
对于磁盘仿真而言,这两条命令是正确的:
map (hd0,0)/boot.flp (fd0)
map (hd0,0)/kern.flp (fd1)
如果用 0.4.0 的版本,则可以加上 --mem 参数,来使用内存盘的仿真功能。
注意上述命令仅仅指定仿真的磁盘是 fd0 和 fd1,并未指定由哪个扇区来引导你的操作系统。根据你的文件名来猜测,你可能是要从 boot.flp 来引导,因此,你应该这样:
chainloader (hd0,0)/boot.flp
rootnoverify (fd0)
boot
这就应该好了。
The chainloader command determines which boot sector is used to boot the operating system, so the chainloader command is only effective if used once. If this command is used multiple times, only the last one will take effect, and those chainloader commands before it are all useless.
For disk emulation, these two commands are correct:
map (hd0,0)/boot.flp (fd0)
map (hd0,0)/kern.flp (fd1)
If using version 0.4.0, you can add the --mem parameter to use the emulation function of the memory disk.
Note that the above commands only specify that the emulated disks are fd0 and fd1, and do not specify which sector is used to boot your operating system. Guessing from your file names, you may want to boot from boot.flp, so you should do this:
chainloader (hd0,0)/boot.flp
rootnoverify (fd0)
boot
This should be fine.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2005-3-21 00:00 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
不过还是要补充一点,在 版本 0.4.0 中,我们已经增加了两个非常重要的 map 命令参数:
map --floppies=M
map --harddrives=N
这两条命令指定 BIOS 所识别的软盘驱动器数目和硬盘驱动器的数目。对于你的情况,应当这样:
map (hd0,0)/boot.flp (fd0)
map (hd0,0)/kern.flp (fd1)
map --floppies=2
chainloader (hd0,0)/boot.flp
rootnoverify (fd0)
boot
其中 map --floppies=2 只要在 boot 之前即可,除此之外,没有其它要求,它可以放在最前面,也可以放在最后,这都没有错的。
But still need to add one point. In version 0.4.0, we have added two very important map command parameters:
map --floppies=M
map --harddrives=N
These two commands specify the number of floppy drives and the number of hard drives recognized by the BIOS. For your situation, it should be like this:
map (hd0,0)/boot.flp (fd0)
map (hd0,0)/kern.flp (fd1)
map --floppies=2
chainloader (hd0,0)/boot.flp
rootnoverify (fd0)
boot
Among them, map --floppies=2 is only needed before boot. Besides, there are no other requirements. It can be placed at the front or at the end, which is all right.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2005-3-21 00:00 |
|
|
Qlin
初级用户
 
积分 131
发帖 11
注册 2005-3-21
状态 离线
|
|
2005-3-21 00:00 |
|
|
Qlin
初级用户
 
积分 131
发帖 11
注册 2005-3-21
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
请问关于
map --floppies=M
map --harddrives=N
这两条命令指定 BIOS 所识别的软盘驱动器数目和硬盘驱动器的数目。
有没有数目的限制。。? 比如说不能多于二个之类的。。? 谢谢。
Is there any limit to the number specified by the commands `map --floppies=M` and `map --harddrives=N` that indicate the number of floppy drives and hard drives recognized by the BIOS? For example, is there a limit like not exceeding two? Thanks.
|
|
2005-3-21 00:00 |
|
|
Qlin
初级用户
 
积分 131
发帖 11
注册 2005-3-21
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
不点兄。。跟据你的提示。我进行了如下操作。
map (hd0,0)/boot.flp (fd0)
map (hd0,0)/kern.flp (fd1)
chainloader (hd0,0)/boot.flp
rootnoverify (fd0)
boot
但好像还是不行。。不知是什么原因。。?? 谢谢。
Brother Budian. According to your prompt, I carried out the following operations.
map (hd0,0)/boot.flp (fd0)
map (hd0,0)/kern.flp (fd1)
chainloader (hd0,0)/boot.flp
rootnoverify (fd0)
boot
But it still doesn't seem to work. I wonder what the reason is.?? Thanks.
|
|
2005-3-21 00:00 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
指定的软盘数目不可以超过2, 指定的硬盘数目不可以超过(我有点忘记了,大概是) 100 吧。
> 但好像还是不行。。不知是什么原因。。?? 谢谢。
“不行” 在哪个方面呢?是不能启动?还是什么别的毛病,你没有描述详细。
只要 boot 之后能够把控制权顺利交给 boot.flp 的引导代码,这就算是 GRUB for DOS的成功。至于说以后你引导的操作系统是 linux 或者 BSD 等,由于这些操作系统从 CPU实模式切换到保护模式,在此之后,这些操作系统就不再使用仿真了,因为它们不再使用 int13。
也就是说,一旦这类操作系统被引导成功,你就不再能访问我们的虚拟软盘了。只是在操作系统的引导过程中,也就是在操作系统获得控制之前的这段时间,我们的仿真还是起作用的。
The specified number of floppy disks cannot exceed 2, and the specified number of hard disks cannot exceed (I kind of forgot, probably) 100 or so.
> But it still doesn't seem to work. I don't know what the reason is..?? Thanks.
"Inoperable" in which aspect? Is it unable to boot? Or some other problem, you didn't describe in detail.
As long as after booting, the control can be smoothly handed over to the boot code of boot.flp, this is the success of GRUB for DOS. As for the operating system you boot later, such as linux or BSD, etc., since these operating systems switch from real mode of CPU to protected mode, after that, these operating systems no longer use simulation, because they no longer use int13.
That is to say, once such an operating system is successfully booted, you can no longer access our virtual floppy disk. Only during the boot process of the operating system, that is, during the period before the operating system gains control, our simulation still works.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2005-3-21 00:00 |
|
|
Qlin
初级用户
 
积分 131
发帖 11
注册 2005-3-21
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
谢谢 不点 兄。
原来是这个样子啊。
我的理想情况是。 先从A 盘引导,然后再读取B盘的kern .
看来是不行了呢。。
Thanks, Brother Budian.
So that's how it is.
My ideal situation is. First boot from drive A, then read the kern from drive B.
It seems it's not possible, though.
|
|
2005-3-21 00:00 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
老兄用的可能是 BSD 吧。不管 LINUX 还是 BSD,目前都不支持实模式的 BIOS中断调用。但是,另一方面,保护模式确实是完全有可能支持实模式的中断调用的,这可以叫做“实模式兼容层”,win98 就有这种兼容层,因此win98 就可以顺利地访问到我们通过 int13 映射而得到的内存盘。注意 win98也是保护模式的操作系统。winNT/2K/XP/2003 同样都是保护模式的操作系统,所不同的是,它们去掉了实模式兼容层,也就是某个 DLL实模式兼容性驱动程序文件。假定有某个公司为 winNT/2K/XP/2003 写一个这样的驱动程序,那么 winNT/2K/XP/2003也能支持实模式的所有概念,包括从 winNT/2K/XP/2003 内部不用重启动 Windows 即可像 win98 那样进入 realmode DOS。只是由于微软故意不做,其它公司也不愿意费这个牛劲替它做罢了。
LINUX 和 BSD 的道理完全一样,在这些操作系统中本来不存在实模式兼容驱动,但是,完全可以为它们增加一个,当然了,这都是系统底层操作,会麻烦一些,然而这不存在实质的困难。
===============
在目前的情况下,也许你稍作变通就可以躲过以上限制。比如说,你的全部文件都放在 A:盘上,A:盘本身做得很大,比如 2.88M,或者,如果不够用的话,干脆做 50M 或 1000M。经过 GRUB4DOS 仿真之后,A:盘的引导程序获得控制,这段引导程序把A:盘上的内核和initrd 都装入内存,这样,当内核获得控制时,根本不需要再读软盘了,因为软盘的全部数据(除了内核之外)都在 initrd中,这已经都在内存中了。BSD我没用过,但是我很清楚这个办法对 LINUX 是成功的。
Dude, you might be using BSD. Whether it's LINUX or BSD, neither currently supports real-mode BIOS interrupt calls. But on the other hand, protected mode can definitely support real-mode interrupt calls, which can be called a "real-mode compatibility layer." Windows 98 has such a compatibility layer, so Windows 98 can smoothly access the RAM disk we mapped through int13. Note that Windows 98 is also a protected-mode operating system. Windows NT/2K/XP/2003 are all protected-mode operating systems as well. The difference is that they removed the real-mode compatibility layer, that is, a certain DLL real-mode compatibility driver file. Suppose a company writes such a driver for Windows NT/2K/XP/2003, then Windows NT/2K/XP/2003 can also support all the concepts of real mode, including entering real-mode DOS like Windows 98 from within Windows NT/2K/XP/2003 without restarting Windows. It's just that Microsoft deliberately doesn't do it, and other companies don't want to go to the trouble to do it for it.
The same logic applies to LINUX and BSD. There are no real-mode compatibility drivers in these operating systems originally, but a compatibility layer can definitely be added to them. Of course, this is all low-level system operation, which will be more troublesome, but there are no substantial difficulties.
===============
Under the current circumstances, maybe you can get around the above restrictions with a little workaround. For example, put all your files on drive A: and make drive A: itself very large, say 2.88M. Or, if it's not enough, just make it 50M or 1000M. After being emulated by GRUB4DOS, the boot program of drive A: gains control. This boot program loads the kernel and initrd on drive A: into memory. When the kernel gains control, there's no need to read the floppy disk anymore because all the data of the floppy disk (except the kernel) is in initrd, which is already in memory. I haven't used BSD, but I'm very clear that this method works for LINUX.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2005-3-22 00:00 |
|
|
Qlin
初级用户
 
积分 131
发帖 11
注册 2005-3-21
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
根据如上,我进行了下面的尝试。。
系统情况是。硬盘分有二个主分区,在grub中显示 第一个为 hd0, 0 第二个为 hd0,2
我把freebsd 的iso 文件解压到 第二个主分区(hd0,2)
我的相法是把第二个主分区虚拟成A盘,然后再从At盘启动,
然后进行了如下操作:
map (hd0,2)+1 (fd0)
chainloader (fd0)+1
rootnoverify (fd0)
boot
但是运行 chainloader (fd0)+1 后电脑会长鸣, 然后死机 。
请问我这样的做法是否有错。? 为什么不能成功。。? 谢谢。。
According to the above, I made the following attempts..
The system situation is. There are two primary partitions on the hard drive, and in grub it is shown that the first one is hd0, 0 and the second one is hd0, 2.
I extracted the freebsd iso file to the second primary partition (hd0, 2).
My idea is to virtualize the second primary partition as drive A, and then boot from drive A.
Then the following operations were carried out:
map (hd0,2)+1 (fd0)
chainloader (fd0)+1
rootnoverify (fd0)
boot
But after running chainloader (fd0)+1, the computer will beep continuously and then crash.
Is there any mistake in my approach like this? Why can't it succeed..? Thanks.
|
|
2005-3-22 00:00 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
你的分区的文件系统,如果不是 FAT/NTFS 这类微软格式的,是不能用你所用的分区仿真功能的。
你可以改为文件仿真功能:
map (hd0,2)+xxxxxxxx (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
boot
当 xxxxxxxx 为 1 时,是调用分区仿真功能,而当 xxxxxxxx 等于分区中的扇区总数时,则调用的是文件仿真功能。
另外你少掉了一条很重要的 map ---hook 命令。
The file system of your partition, if it is not a Microsoft format like FAT/NTFS, the partition emulation function you are using cannot be used.
You can change to the file emulation function:
map (hd0,2)+xxxxxxxx (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
boot
When xxxxxxxx is 1, it is to call the partition emulation function, and when xxxxxxxx is equal to the total number of sectors in the partition, it is to call the file emulation function.
In addition, you are missing an important map --hook command.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2005-3-22 00:00 |
|
|
Qlin
初级用户
 
积分 131
发帖 11
注册 2005-3-21
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
谢谢 不点 兄....问题解决了。。哈哈。。
Thank you, not click brother.... The problem is solved. Ha ha..
|
|
2005-3-23 00:00 |
|
|