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-25 01:27
中国DOS联盟论坛 » GRUB4DOS、SYSLINUX及其它启动管理软件讨论专区 » (Report) Booting Vista and Other OSes Multiboot with GRUB View 2,267 Replies 9
Original Poster Posted 2007-04-04 22:39 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
多系统启动多个版本的Vista和其他操作系统与Grub菜单,这里有一些背景信息以及针对Grub用户的说明

http://www.msfn.org/board/index.php?showtopic=95537
因为我们亲手创建,这个世界更加美丽。
Floor 2 Posted 2007-04-05 08:16 ·  中国 浙江 台州 玉环市 电信
管理员
★★★★
DOS非常爱好者
Credits 6,215
Posts 2,601
Joined 2006-01-20 13:00
20-year member
UID 49256
Status Offline
Floor 3 Posted 2007-04-05 09:13 ·  中国 上海 联通
新手上路
Credits 2
Posts 1
Joined 2007-04-05 08:52
19-year member
UID 84031
Gender Male
Status Offline
I can run the media-upmarket成英语是I can run the media-upmarket?这似乎不太对,原句“我的电脑分区找不到”准确的英语翻译是My computer's partitions cannot be found
Floor 4 Posted 2007-04-06 00:12 ·  中国 河北 秦皇岛 联通
新手上路
Credits 2
Posts 1
Joined 2007-03-15 06:17
19-year member
UID 81795
Gender Male
Status Offline
Let me take a look
Floor 5 Posted 2007-04-09 22:45 ·  中国 安徽 宿州 电信
银牌会员
★★★
Credits 1,339
Posts 595
Joined 2004-05-26 00:00
22-year member
UID 25306
Gender Male
From 安徽 宿州
Status Offline
The function of Grub is getting stronger and stronger. Up!
Floor 6 Posted 2007-04-10 05:50 ·  中国 山东 菏泽 联通
银牌会员
★★★
Credits 1,246
Posts 488
Joined 2003-11-11 00:00
22-year member
UID 12699
Gender Male
Status Offline
Originally posted by 雨露 at 2007-4-5 08:16 AM:
Unable to display the web page


I transferred a few posts:

1F

Humble request for Mods to pin if you think it's worthy.

Good news for people who use Grub loader for multi-booting to various Microsoft OSes, including the new Windows Vista, and Linux. I’ve modified an old trick I’ve used to load Grub on system startup with Windows XP as the main OS. See the post at 911cd.net Multi-boot WinXP and other OSes with Grub for this method.

Background

For those of you not familiar with Grub, here’s some background information on its benefits. Why use Grub instead of Windows XP boot menu or Vista boot menu? There are several reasons.
First, you can’t boot non-Microsoft OSes with XP/Vista boot menu. Grub loads Vista, XP, 2000, 98, Linux, BartPE on HDD or CD etc. I’m guessing you can also load WinPE 2.0 from HDD but haven’t tried it yet.
Second, you can’t boot other devices, namely floppy and CD/DVD drive, from XP or Vista menu. Grub can boot floppy, bootable CD/DVD (even if your BIOS does not support it), and floppy images from its menu.
Third, it’s backward compatible but not forward compatible; meaning, XP can load Windows 2000, 98, and other legacy OSes but not Vista. Vista can load previous ones but not future ones.
Fourth, Grub does not modify the MBR or PBR. It requires no patching or hex-editing. It simply requires renaming a couple of files, which I’ll explain next why renaming is required.


Why Rename?

My objective was to load Grub loader first—before XP boot menu (and now before Vista boot menu). In order to fulfill this objective, renaming two files is necessary.

You can add Grub loader to boot.ini so that you can get an option to load Grub in the XP boot menu. However, if you want Grub to load before XP boot menu, you’ll have to rename two files. First, you have to rename ntldr (the XP loader) as ntldrxp and grldr (Grub loader) as ntldr. Basically, you are disguising Grub loader as the XP loader. So, the system thinks it is loading XP but it is loading Grub. Then, you can create an entry in menu.lst to load XP with the following lines:

CODEtitle Microsoft Windows XP SP2 Pro (Find and Load)
find --set-root /ntldrxp
chainloader /ntldrxp

If you had edited boot.ini to load Grub from there, and then made Grub load automatically, then you would not be able to boot XP because of a circular reference. Why the circular reference? Because system loads ntldr, which reads boot.ini and loads grldr automatically (without an XP menu). Then, from Grub, you would choose to boot XP. However, ntldr will look for boot.ini and load Grub again automatically. It doesn’t matter if you rename ntldr to ntldrxp. Ntldrxp will also look for boot.ini and you get a circular reference. Therefore, renaming both ntldr and grldr files solves the problem.

Booting Vista with Grub

So, with Windows Vista, is it still possible to get Grub to load before Vista boot menu? And can you boot Vista with a Grub entry? Both are yes!!

I thought since Vista’s boot process had been modified, it would not be possible. But the same trick works with Vista as with XP. Let’s look at the differences between Vista and XP boot process before I explain how to get a Grub menu before the Vista menu.

For XP, the MBR looks for and loads ntldr. Ntldr then read from boot.ini. If it finds two or more entries in boot.ini, then it will present a menu option for the entries (unless you set to boot an item automatically). That’s the process. (I’ve read that ntldr serves two functions: bootmanager and bootloader. As bootmanager, it presents a menu for XP and other OSes. As bootloader it itself can boot XP.)

For Vista, the MBR looks for and loads bootmgr. You can say bootmgr has replaced ntldr. However, bootmgr serves only one function—as a bootmanager. Bootmgr refers to a file called bcd (probably short for boot configuration data). You can say bcd is like boot.ini. It contains the menu entries for Vista’s boot menu. There’s a third file called winload.exe that actually loads Vista—this is the bootloader for Vista.

So, for our purposes, we need to replace bootmgr with grldr to get a Grub menu before the Vista menu. Then, we need to create an entry in menu.lst for booting Vista, XP, other OSes, and other devices. Finally, now for the instructions.

Requirements
grldr, the file that loads Grub loader. You can find it at http://grub4dos.jot.com/WikiHome. Download the zip file and extract files to get grldr.
WinImage or any other floppy image creator
Floppy drive and a floppy
A system that is currently dual-booting XP and Vista


Backup System

First step is to backup your system with System Restore or Vista’s backup program just in case things go haywire (if you follow directions correctly, it shouldn’t). I don’t use system restore but you may want to. If you are comfortable, you can skip this step. Don’t blame me if things go wrong.

The worst that can happen with these simple instructions is you lose the ability to boot to either Vista or XP. If you create a Vista boot floppy in the next step, then you should be able to recover. If something worse than this happens, you did something beyond these instructions.

Create Vista Boot Floppy

Now, make a Vista boot floppy. Follow the instructions: http://www.msfn.org/board/index.php?showtopic=95092. I advise you not to skip this step. It will not only help you now, but also if in the future you can’t load Vista or XP, it will come in handy.

Note: you can create a Vista-only boot floppy, XP-only boot floppy, or Vista/XP dual-boot floppy by modifying your boot options in Vista. If you want a Vista-only boot floppy, modify your boot options to boot Vista automatically (without a timeout). If XP-only, boot XP automatically. If you want dual-boot, specify a timeout before loading your default choice. The changes you make are reflected in the bcd file. Therefore, all files will be same on these floppies except the bcd file. For the purpose of these instructions, you’re better off creating a Vista/XP dual-boot floppy so you can boot to either one.

Rename bootmgr

After creating a boot floppy, boot into XP. Give yourself permission to modify bootmgr. You may have to take ownership. (I took ownership of the file and then modified permissions. I now realize maybe that was not necessary. Not sure.) Rename bootmgr as bootmgrv.

Rename grldr

Rename grldr as bootmgr. Just like in XP, we’re going to fool the system into thinking it is loading Vista, but it is loading Grub loader. Then, copy bootmgr (grldr in disguise) to where the Vista's real bootmgr was, usually in the root folder of your active primary partition.

Create Vista Entry in Menu.lst

Guess what. Just like how ntldrxp was able to boot XP, bootmgrv can also boot Vista from Grub menu. Create the following entries in menu.lst. The # indicates comments. Take a look at the comments if you are not familiar with menu.lst.

CODE# Sets colors, timeout before default selected and default value
color black/cyan yellow/cyan
timeout 5
default 0

# Boot Vista by finding and loading bootmgrv
title Microsoft Windows Vista
find --set-root /bootmgrv
chainloader /bootmgrv

# Boot XP by finding and loading ntldr
title Microsoft Windows XP
find --set-root /ntldr
chainloader /ntldr

# Boot BartPE by finding setupldr.bin
title BartPE with XPE 1.0.4 (from HDD)
find --set-root /minint/setupldr.bin
chainloader /minint/setupldr.bin

# Boot BartPE from USB HDD by swap method; note your USB HDD number may be
# different. I have two internal HDD’s ((hd0) and (hd1)), making my USB HDD
# (hd2). Therefore, I have to swap (hd0) with (hd2).
title Boot BartPE from USB HDD
map (hd2) (hd0)
map (hd0) (hd2)
chainloader (hd0)+1

# Boot whatever is in CD/DVD drive, even if your BIOS does not support
# booting from CD/DVD drive. You need a file called sbootmgr.dsk.
# It’s a very small SBM disk image. Search for it.
title Boot CD using Smart Boot Manager
find --set-root /sbootmgr.dsk
map --mem /sbootmgr.dsk (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)

# Example of how to boot a floppy image by finding and loading the image file
# This is much faster than booting from the actual floppy.
title Boot Ghost 2003 (ghost.img)
find --set-root /ghost.img
map --mem /ghost.img (fd0)
map --hook
chainloader (fd0)+1

# Boot whatever is in the floppy drive
title Floppy on (fd0)
chainloader (fd0)+1
rootnoverify (fd0)

Note, we do not need to rename ntldr as ntldrxp in this case. You can also add Linux and other OSes supported by Grub. I don’t use Linux. You can search for instruction on the net.

Reboot

Voila! Reboot and you should see Grub menu with your boot menu options!

Please post if you found this useful and worked for you, there are any errors in above, anythings that needs clarification, or discussion points.

Don’t post that your system is screwed up. I warned you to backup. If you did, restore your backup. Otherwise, the only modifications you are making are renaming a couple of files, one of which is a system file, and modifying your menu.lst file; so I don't see how you can really mess up.

This post has been edited by spacesurfer: Mar 31 2007, 11:46 AM



2F


Hi, spacesurfer, long time no see...

...once again good work.

For the record, it appears that BCD appears to be a hive file, i.e. a binary Registry file.

jaclaz


3F
Floor 7 Posted 2007-04-10 05:52 ·  中国 山东 菏泽 联通
银牌会员
★★★
Credits 1,246
Posts 488
Joined 2003-11-11 00:00
22-year member
UID 12699
Gender Male
Status Offline
Jaclaz, I've been around. I see you've been hanging around too.

What else do you know about BCD file? Some has posted here that you can modify the BCD file so it can work with Ghost. I think it break the dependency of BCD on GUID. You know anything else about GUIDs?

Interesting to note that even though the bootmanager is replaced in Vista, the same trick works (replacing bootmgr with grldr). Vista's boot manager somehow checks for the right ntldr because you can't rename grldr to ntldr and load Grub from Vista's boot menu. I get an error. However, replacing Vista's own bootmgr works like a charm.

4F

QUOTE(spacesurfer)
What else do you know about BCD file?


Not much, basically because at the moment I won't touch Vista with anything but a 10 feet pole , but two things might interest you or other members:
1. BCD is a Registry hive:
http://www.911cd.net/forums//index.php?showtopic=19439
2. Nuno Brito is working on a tool to read and write Registry hives:
http://www.boot-land.net/forums/index.php?showtopic=1703
http://www.boot-land.net/forums/index.php?showtopic=1839

I am trying to put together in the first thread every reference I can find on Registry hives, if anyone has some more info/links, he is welcome to join us in the "game".

jaclaz
Floor 8 Posted 2007-04-10 23:15 ·  中国 河北 唐山 联通
版主
★★★
操作系统爱好者
Credits 1,113
Posts 392
Joined 2002-11-11 00:00
23-year member
UID 228
Gender Male
Status Offline
Why change the name? My English is not very good, so please don't explain and analyze.
ntldr -> ntldrxp
bootmgr -> bootmgrxp
DOS之家 http://doshome.com 站长 葛明阳
Floor 9 Posted 2007-04-11 21:52 ·  中国 福建 厦门 电信
中级用户
★★
Credits 480
Posts 197
Joined 2006-09-20 00:40
19-year member
UID 63115
From 黄冈
Status Offline
1. grldr->ntldr
ntldr->ntldrxp

2. grldr->bootmgr
bootmgr->bootmgrv

Rename grldr as bootmgr. Just like in XP, we’re going to fool the system into thinking it is loading Vista, but it is loading Grub loader.

Rename to deceive the system, use GRLDR to replace the default ms bootloader, and load MENU.LST

Not tested, not sure if it works
Floor 10 Posted 2007-04-12 21:46 ·  中国 河北 保定 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
It is certain that it is feasible, but there is no need to be so complicated.

The current grub4dos can directly chainloader /bootmgr. There is no need to make a Vista boot floppy disk.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Forum Jump: