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-24 18:28
中国DOS联盟论坛 » GRUB4DOS、SYSLINUX及其它启动管理软件讨论专区 » The problem of virtualizing two floppy drives in grub of DOS. View 1,741 Replies 11
Original Poster Posted 2005-03-21 00:00 ·  中国 湖北 荆州 松滋市 电信
初级用户
Credits 131
Posts 11
Joined 2005-03-21 00:00
21-year member
UID 37300
Gender Male
Status Offline
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
Floor 2 Posted 2005-03-21 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
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.
因为我们亲手创建,这个世界更加美丽。
Floor 3 Posted 2005-03-21 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
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.
因为我们亲手创建,这个世界更加美丽。
Floor 4 Posted 2005-03-21 00:00 ·  中国 湖北 荆州 电信
初级用户
Credits 131
Posts 11
Joined 2005-03-21 00:00
21-year member
UID 37300
Gender Male
Status Offline
Haha. Thanks, Brother Budian
Floor 5 Posted 2005-03-21 00:00 ·  中国 湖北 荆州 电信
初级用户
Credits 131
Posts 11
Joined 2005-03-21 00:00
21-year member
UID 37300
Gender Male
Status Offline
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.
Floor 6 Posted 2005-03-21 00:00 ·  中国 湖北 荆州 电信
初级用户
Credits 131
Posts 11
Joined 2005-03-21 00:00
21-year member
UID 37300
Gender Male
Status Offline
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.
Floor 7 Posted 2005-03-21 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
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.
因为我们亲手创建,这个世界更加美丽。
Floor 8 Posted 2005-03-21 00:00 ·  中国 湖北 荆州 电信
初级用户
Credits 131
Posts 11
Joined 2005-03-21 00:00
21-year member
UID 37300
Gender Male
Status Offline
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.
Floor 9 Posted 2005-03-22 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
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.
因为我们亲手创建,这个世界更加美丽。
Floor 10 Posted 2005-03-22 00:00 ·  中国 湖北 荆州 电信
初级用户
Credits 131
Posts 11
Joined 2005-03-21 00:00
21-year member
UID 37300
Gender Male
Status Offline
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.
Floor 11 Posted 2005-03-22 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
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.
因为我们亲手创建,这个世界更加美丽。
Floor 12 Posted 2005-03-23 00:00 ·  中国 湖北 荆州 公安县 电信
初级用户
Credits 131
Posts 11
Joined 2005-03-21 00:00
21-year member
UID 37300
Gender Male
Status Offline
Thank you, not click brother.... The problem is solved. Ha ha..
Forum Jump: