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-07-24 00:18
中国DOS联盟论坛 » DOS启动盘 & LOGO技术 (启动盘室) » Can booting from something other than C: be done? View 2,096 Replies 16
Original Poster Posted 2004-01-01 00:00 ·  中国 浙江 台州 电信
初级用户
Credits 111
Posts 2
Joined 2004-01-01 00:00
22-year member
UID 14743
Gender Male
Status Offline
For example, put the DOS system on D: and make it dual-boot?
Floor 2 Posted 2004-01-01 00:00 ·  中国 广东 佛山 三水区 电信
元老会员
★★★★
Credits 5,170
Posts 1,637
Joined 2002-10-16 00:00
23-year member
UID 8
Gender Male
From 广东佛山
Status Offline
You can do it with SPFDISK, but in fact it uses the method of hiding partitions, and in the end it still boots from C:. If you want dual boot, just install DOS or WIN98 on C:, and WIN2000/XP on D:.
我的网志
http://hzmys.blog.163.com/
我的网盘
firststep.qjwm.com
fsmys.ys168.com
ssmys.ys168.com
www.brsbox.com/fsmys
www.brsbox.com/ssmys
www.brsbox.com/ccdos
Floor 3 Posted 2004-01-01 00:00 ·  中国 浙江 台州 电信
初级用户
Credits 111
Posts 2
Joined 2004-01-01 00:00
22-year member
UID 14743
Gender Male
Status Offline
The other way around—XP on C:, DOS/9x on D:—won't work?
Floor 4 Posted 2004-01-01 00:00 ·  中国 湖北 武汉 联通
银牌会员
★★★
Credits 1,681
Posts 512
Joined 2003-08-02 00:00
22-year member
UID 7953
Gender Male
Status Offline
In theory yes, in practice... I’ve never succeeded.
Somehow somewhere I've got to choose.
No matter if it is win or lose.
Floor 5 Posted 2004-01-02 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
With grub you can swap the BIOS hard disk numbers, thus achieving booting from the second hard disk.

For details, please see grub's documentation. This refers to GNU GRUB.

If you don't want to download GNU GRUB, you can also download grub for dos. After downloading and extracting it, take a look at the menu.lst file inside. Some command lines in that file are used to boot win98 from the second or third hard disk.

If you only have one hard disk, (and D: is a logical partition), then you cannot use the method just mentioned. In that case, if you only want to boot the DOS on D:, there is still a way, which is to use the hard disk emulation feature of grub for dos 0.2.0 to emulate D: as C:. If you use this method to boot the windows on D:, I'm afraid it may be dangerous (so try not to boot windows).

A test version of grub for dos 0.2.0 is currently available for download. The official version will probably be released within about two months.

Information on grub for dos 0.2.0 can be found here:
http://www.linuxeden.com/edu/doctext.php?docid=3006
因为我们亲手创建,这个世界更加美丽。
Floor 6 Posted 2004-01-02 00:00 ·  中国 重庆 电信
银牌会员
★★★
Credits 2,202
Posts 499
Joined 2003-06-12 00:00
23-year member
UID 4876
Gender Male
Status Offline
I used Grubt11 to boot hda6 and failed. Under win98, this logical partition is E: (DOS software, sys'ed over). I used map (hd0,6)+1 (hd0) and then --hook, and there was no error message at all, but chainloader (hd0,0)+1 gave: Error 18 Selected cylincler exceeds maximum supported by bios ; where is the mistake? I only have 1 primary partition, so Hd0,6 being E: is not wrong, right? Or should it be Chainloader (hd0,5)+1 instead? But that is definitely not right either, because I tried it. Could Brother Budian please help take a look and see where the mistake is... Thanks!
Also, after I do map --unhook and then chainloader the original Hd0 again, it hangs completely at boot...


一年四季,枫叶红了又红;人生四季,失去的,还能再来吗?—— !
Floor 7 Posted 2004-01-03 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
Brother xiaojun, I’m really sorry, the documentation for grub for dos 0.2.0 was not written in enough detail or comprehensively enough.

1。The hard disk emulation feature of grub for dos 0.2.0 can be used to emulate the “container” of an extended partition, but it cannot emulate a specific “extended partition” inside that “container.” I’m now trying to explain this concept clearly, but it really isn’t easy to explain clearly. Why? Because in DOS and Windows, “extended partition” is a very vague concept; at least, I myself feel it is very vague. When we use DOS FDISK to create an extended partition, what we first create is a framework for the extended partition (or for now, let’s call it the “container” of the extended partition), not the extended partition itself directly. This “container” contains a partition table, so it can be emulated as a virtual hard disk. Otherwise, if it were like an ordinary partition and had no partition table, then it could only be emulated as a virtual floppy disk (because a floppy image and a partition image are the same, both starting with a DOS boot record and containing a BPB table).

For example, we usually create a primary partition (hd0,0) on the hard disk 【that is, logical drive C:】, and then create something called (hd0,1) as a “container.” Inside this “container,” we then create some specific extended partition 【for example (hd0,4), that is logical drive D:】. Only (hd0,1) can be used to emulate a virtual hard disk. Both (hd0,0) and (hd0,4) can only be used to emulate a floppy disk.

Note that here, (hd0,1) is similar to the hard disk master partition table (hd0), equivalent to a complete hard disk structure, so it can be emulated as a hard disk. Specific partitions such as (hd0,0) and (hd0,4), however, do not have a partition table structure; they only have the DOS BPB structure, and therefore cannot be emulated as hard disks.

What was discussed above is using existing partitions to emulate floppies, and using existing “containers” to emulate hard disks. When an img file is used, all of the above limitations no longer apply. That is, when using an img file on the hard disk to emulate either a hard disk or a floppy disk, there are none of the limitations mentioned above. Because when you create this img file, you have already put a partition table into it 【because what you are emulating is a hard disk; as for a floppy image, of course there is no partition table】.

Using existing partitions and “containers” has two advantages: first, you do not need to create an additional img file; second, when you are not using emulation, you can still access the files in these partitions (and “containers”).

Correspondingly, using an img file for emulation has two disadvantages: first, you need to create a contiguous img file on the hard disk; second, when you are no longer using the emulation, the files in that img image cannot be directly accessed by DOS/Win98, and you must rely on utility software such as WinImage.

The above is an attempt to explain some of the technical issues encountered here, but I don’t know whether I’ve explained them clearly enough.

2。Next, let me explain the second problem you ran into:

Linux hda is (hd0) in grub
Linux hdb is (hd1) in grub
Linux hdc is (hd2) in grub
Linux hdd is (hd3) in grub

Linux hda1 is (hd0,0) in grub
Linux hda2 is (hd0,1) in grub
Linux hda3 is (hd0,2) in grub
Linux hda4 is (hd0,3) in grub
Linux hda5 is (hd0,4) in grub
Linux hda6 is (hd0,5) in grub

Linux hdb1 is (hd1,0) in grub
and so on.

Note that (hd0,0), (hd0,1), (hd0,2), and (hd0,3) are the four primary partitions on hard disk hda 【that is, grub’s (hd0)】. Among them, (hd0,1) is usually a “container,” and partitions from (hd0,4), (hd0,5), and so on are all included within this “container.”

hda 【that is, grub’s (hd0)】 itself is also a “container”; it contains the four partition table entries (hd0,0), (hd0,1), (hd0,2), (hd0,3).

You cannot emulate hard disk hda as a floppy disk, because hard disk hda contains a partition table, while a floppy disk does not. By the same reasoning, you cannot emulate the container (hd0,1) as a floppy disk either; it can only be emulated as a hard disk.

You cannot emulate partitions such as (hd0,0), (hd0,4), (hd0,5), and so on as hard disks, because they do not have partition tables; they can only be emulated as floppy disks.

Therefore, your hda5 or hda6 is destined to be emulated only as a floppy disk. If you want to emulate a hard disk, you must use (hd0,1), or in other words Linux hda2.

DOS/Win98 generally uses (hd0,1) as the “container.” But some other companies’ software may perhaps set the “container” differently, for example as (hd0,0), (hd0,2), or (hd0,3).

Only a primary partition can serve as a “container,” so on hard disk (hd0), the only possible partition table entries that can serve as a “container” are the following four:

(hd0,0)
(hd0,1)
(hd0,2)
(hd0,3)

Similarly, on hard disk (hd1), the only possible partition table entries that can serve as a “container” are also the following four:

(hd1,0)
(hd1,1)
(hd1,2)
(hd1,3)

All this may look very complicated, but it is not all that complicated. I hope this can help you solve the problem you ran into.
因为我们亲手创建,这个世界更加美丽。
Floor 8 Posted 2004-01-03 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 xiaojun's post at 2004-1-2 23:39:44:
Also, after I do map --unhook and then chainloader the original hd0 again, it hangs completely at boot...


Sorry, I missed your other question.

The function of the map --unhook command is only that emulation is no longer used at the grub command line. Once you boot, grub will hook it up again automatically, so using map --unhook cannot achieve your purpose .

If you want grub to stop hooking int13, there is only one way, which is to cancel all emulation commands.

You can use map --status to see all emulation items. When it cannot list any items, that means all emulation commands have been canceled.

If you have emulated floppy (fd0), then use

map (fd0) (fd0)

to cancel the emulation of (fd0). When something is emulated as itself, the system automatically removes the emulation for that disk. Similarly, use

map (hd0) (hd0)

map (hd1) (hd1)

to cancel the emulation of (hd0) and (hd1) respectively.

After all emulated disks have been canceled, using the boot command again will no longer involve emulation.
因为我们亲手创建,这个世界更加美丽。
Floor 9 Posted 2004-01-03 00:00 ·  中国 重庆 电信
银牌会员
★★★
Credits 2,202
Posts 499
Joined 2003-06-12 00:00
23-year member
UID 4876
Gender Male
Status Offline
Brother Budian, you are too polite. So what you mean is that after I MAP (hd0,x), if I want to cancel the hd0 emulated with (hd0,x), I cannot simply use --unhook; I must use map (hd0,x) (hd0). And since I only have one primary partition hd0,0, and there is no hd0,1, hd0,2, or hd0,3 that can emulate a hard disk, then my hd0,6 is an extended logical partition and can only emulate a floppy, not a hard disk. Is that understanding correct? Thanks!
In other words: the ones that can emulate a hard disk are 3 of those 4 primary partitions, namely 1, 2, and 3, right?


一年四季,枫叶红了又红;人生四季,失去的,还能再来吗?—— !
Floor 10 Posted 2004-01-05 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 xiaojun's post at 2004-1-3 21:14:48:
Brother Budian, you are too polite. So what you mean is that after I MAP (hd0,x), if I want to cancel the hd0 emulated with (hd0,x), I cannot simply use --unhook; I must use map (hd0,x) (hd0). And since I only have one primary partition hd0,0, and there is no hd0,1, hd0,2, or hd0,3 that can emulate a hard disk, then my hd0,6 is an extended logical partition and can only emulate a floppy, not a hard disk. Is that understanding correct? Thanks!
In other words: the ones that can emulate a hard disk are 3 of those 4 primary partitions, namely 1, 2, and 3, right?




I was away on a long trip these past two days, so I couldn't come here.

Your original words:
------------------
After I MAP (hd0,x), if I want to cancel the hd0 emulated with (hd0,x), I cannot simply use --unhook; I must use map (hd0,x) (hd0)
------------------

There is a slight error. The second half should be map (hd0) (hd0), or it might be map (hd1) (hd1), depending on which hard disk was actually emulated.

Actually there is also an error in the first half. "After I MAP (hd0,x)" is incomplete; it should be "after MAPping (hd0,x) as (hd0)" or "after MAPping (hd0,x) as (hd1)," and only then is it complete. For the former, the command to cancel the map is map (hd0) (hd0), while for the latter, the command to cancel the map is map (hd1) (hd1)

Your original words:
------------------
Since I only have one primary partition hd0,0, and there is no hd0,1, hd0,2, or hd0,3 that can emulate a hard disk, then my hd0,6 is an extended logical partition and can only emulate a floppy, not a hard disk. Is that understanding correct? Thanks!
In other words: the ones that can emulate a hard disk are 3 of those 4 primary partitions, namely 1, 2, and 3, right?
------------------

The following assumes your partitioning tool is only Microsoft's Fdisk, with no other third-party tools.

Since you already have the (hd0,6) extended logical partition, then you must also have a (hd0,1) serving as the "container"; if it is not (hd0,1), then it should be (hd0,2) or (hd0,3).

That is to say, as long as you have a partition (hd0,n) where n > 3, then there must exist a "container" (hd0,m), where m = 0, 1, 2, 3. Generally speaking, m=1, that is, hda2 is that "container."

For grub for dos 0.2.0, you really can use (hd0,1)+1 to emulate a hard disk. However, only (hd0,4) can become the C: drive after emulation.

To explain further, inside the "container" (hd0,1), only (hd0,4) can be accessed, and the other (hd0,x) cannot be accessed, where x > 4

Note that (hd0,4) is hda5, namely your logical D: drive. If DOS is placed on E:, F:, and so on, that will not succeed. DOS should be placed on D:, namely (hd0,4), and then use

map (hd0,1)+1 (hd0)
map --hook
chainloader (hd0,0)+1
boot

and then you can boot the dos on your D: drive. Of course, after this emulation, your D: drive has now become C:.

Your E:, F:, and so on are inaccessible under this emulation. I cannot explain this in detail now; if there is a chance later, I will explain it then.

==============

Also, the question raised by the OP is very meaningful. His question is not asking us to use emulation, but to boot DOS directly from D:, E:, and so on.

I think this should also be achievable. With open-source software such as FreeDOS, plus the necessary modifications, it should be possible.

Even Microsoft's dos, after Hack modification, should also be possible (of course, someone would have to do it).
因为我们亲手创建,这个世界更加美丽。
Floor 11 Posted 2004-01-05 00:00 ·  中国 重庆 电信
银牌会员
★★★
Credits 2,202
Posts 499
Joined 2003-06-12 00:00
23-year member
UID 4876
Gender Male
Status Offline
Hehe, Brother Budian, forgive me for being too lazy, saving effort whenever possible, typing as little as possible. I’ll correct it...! I really am stupid, please excuse me here... So that means only the first logical partition after the primary partition can emulate a hard disk, and the others can only emulate floppies, right? And to cancel it, it has to emulate itself, and after emulating a hard disk, the later partitions can no longer be accessed.
Whether correct or not, I still have to thank the moderator for the patient help, thanks... bow...!
一年四季,枫叶红了又红;人生四季,失去的,还能再来吗?—— !
Floor 12 Posted 2004-01-06 00:00 ·  中国 河南 南阳 内乡县 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
I should thank you too! Your last few questions made me discover some more problems. I think maybe there may be a way for those logical partitions to be emulated as hard disks too (of course, current grub_t11 does not support emulating them as hard disks). The next version may possibly add this feature.

Yes, at present only the first logical partition after the primary partition can be emulated as a hard disk; the other logical partitions can only be emulated as floppies.

To cancel emulation is to emulate itself as itself.

After emulating a hard disk, the remaining logical partitions are disabled.
因为我们亲手创建,这个世界更加美丽。
Floor 13 Posted 2004-01-07 00:00 ·  中国 辽宁 沈阳 联通
初级用户
★★
Credits 672
Posts 216
Joined 2003-06-12 00:00
23-year member
UID 4976
Gender Female
Status Offline
At present, the boot process of most boot systems is bios---mbr--the boot record of the first partition on the hard disk
Most multi-system boot loaders achieve their function by modifying the mbr. I think your problem should also be solved this way. Because first, the bios is not easy to modify, and second, the boot record of the first partition on the hard disk is closely related to the operating system.
The only thing that can be done is to modify the mbr so that before the computer boots into the operating system, it points the operating system boot to another partition.
我是女孩,我怕谁?
Floor 14 Posted 2004-01-08 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
dos时代菜鸟 said it very well. Let me add a little.

With GRUB, the MBR issue is not such a serious one anymore. GRUB can point the operating system boot to another partition before the computer boots into the operating system. So GRUB is one of the things that Brother dos时代菜鸟 was talking about.

Now the focus of the problem is on the "partition boot record" and the boot process after that, or in other words, the DOS boot record and the boot process after it.

The DOS boot record is very short, only one sector (win98 seems to have three boot sectors), so it should be easy to inspect and modify. But the MS-DOS IO.sys file is very large and not easy to modify; this is a difficult point.

If FreeDOS is used, it will probably be easier.
因为我们亲手创建,这个世界更加美丽。
Floor 15 Posted 2004-01-08 00:00 ·  加拿大 安大略省 多伦多
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Win98 has three boot sectors? I don't think so. Win98 can only be booted from DOS, and that DOS also has only one boot record (occupying one sector).
Wengier - 新DOS时代

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

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

Forum Jump: