GRUB资料大全 (摘)

GRUB for DOS - Bridging DOS/Windows to Unix/Linux
2005-07-21

0.4.1pre20 released at External Link http://sarovar.org/projects/grub4dos/
2005-07-18
Hi, everyone! a new test build is ok for download. The pre19 added ext2 support for GRLDR.

Q: How to test?

A: Copy grldr to the root dir of a ext2 partition(the filename "grldr" must be in lower case letters), then copy grldr to the root dir of the Windows disk C: and rename it to C:\GRLDR1, and then delete all other "grldr" files previously in use(usually they are in the root dirs of FAT or NTFS partitions). Finally, use a boot.ini line of

C:\GRLDR1="grldr test ext2"

to test whether or not it can boot GRUB successfully.

0.4.1pre19 download(The pre19 is for test only, not for normal use. You should download pre12 or pre13 for normal use):

2005-06-29
0.4.1pre13 download(This pre13 release added Chinese support, no other changes):

2005-04-20
0.4.0 final download:

2005-03-25
New grldr can be used with no-emulation-mode bootable CDROM:

At a Linux shell prompt, type these commands:

mkdir iso_root
cp grldr iso_root
mkisofs -R -b grldr -no-emul-boot -boot-load-seg 0x1000 -o grub_bootable_cdrom.iso iso_root

and the created file grub_bootable_cdrom.iso is then a bootable CDROM image.

Download the latest grldr: External Link ftp://ftp.linuxeden.com/tinybit/grldr

2005-03-09
0.4.0pre4 released. Download at External Link http://newdos.yginfo.net/grubdos.htm or External Link ftp://ftp.linuxeden.com/tinybit/

Preset menu now finds menu.lst in the root dir only. The /boot/grub/menu.lst is deprecated.

GRLDR 查找算法的改进:GRLDR 的引导代码负责查找、载入和运行 GRLDR 主体文件,这段引导代码就是位于 GRLDR 文件开头的几个扇区,并且这些扇区可以放在 MBR(以及紧接 MBR 的几个扇区)中。GRLDR 文件必须处于分区的根目录才能让引导代码找到它。先前的 GRLDR 版本只支持查找主分区中的 GRLDR 文件。新的 GRLDR 已经支持查找全部分区(包括扩展分区)。如果第一硬盘上找不到 GRLDR 文件,则继续查找第二硬盘,等等,如果所有的硬盘都找不到,那么再查找软盘。

MBR 之后的第一个扇区(也就是硬盘第二扇区),将用做“前一个可以良好运作的 MBR 引导扇区”的备份。当上述查找都失败后,接着将试图运行这个备份。典型的情况是,这是微软的 FDISK 所建立的那个引导扇区的备份。这给用户一个机会,让用户可以进入以前的操作系统,手动把 GRLDR 文件拷贝到系统中合适的位置,即可再次启动成功,而不是面对死机去寻找急救盘。

由于 GRLDR 引导代码的查找算法是动态的,它不管 GRLDR 文件的物理扇区如何存放,都能找到它。所以,调整分区的大小、移动分区的物理位置、增加或者减少分区的个数、磁盘碎块整理等等这类操作,都不影响 GRLDR 引导代码的查找。

以上功能已经全部实现,可以从 External Link ftp://ftp.linuxeden.com/tinybit/ 下载不断更新的二进制文件 grldr 来测试这一功能。

未来希望 GRLDR 引导代码能够支持查找 Linux 分区下的 GRLDR 文件,从而真正做到“万能启动”和“无忧启动”。

2005-02-13: 将 GRLDR 写入 MBR 的扇区数目由 5 个扇区增加为 16 个扇区,参见下面的说明部分

由于新的 --mem 仿真将 int13 仿真代码增加到 3K 的大小,因此,版本号将升为 0.4.x 系列。在 0.2.0 中仍然包括了 scdrom 和 bioscdrom,但在 0.4.x 中,这些补丁在默认时将不编译(补丁还保留,只是不编译)。建议在 0.4 中调用 sbm.bin 以便获得 CDROM 的启动支持。似乎 sbm.bin 支持所有格式的 cdrom 的启动,兼容性最好,所以直接调用它就行。需要 ISO 仿真功能的朋友可以联系 gandalf ,他对此有专门研究。gandalf 还是中文版的开发者。

用 RAM 内存来仿真磁盘: memdrive
download the binary build(2005-04-25) here:
External Link ftp://ftp.linuxeden.com/tinybit/grub.exe
External Link ftp://ftp.linuxeden.com/tinybit/grldr
External Link ftp://ftp.linuxeden.com/tinybit/grub4lin

Example:

map --mem (...)/.../floppy.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
boot

here the floppy.img can be non-contiguous. It can be gzipped as well.

Limitations:
The BIOS function call int15/EAX=e820h is required, or else the --mem cannot work.

更动pre12-pre13: 引入 grub4lin;支持 DOSBox;修复关于 NTFS 文件连续性检查的 BUG;清理了各个补丁。
pre13 还增加了一条 commandline 命令, 用于从菜单中直接切换到命令行.

更动pre11-pre12: 修复两个 BUG:1,GRLDR 从 1024 柱面之后的分区启动;2,快速检查 img 文件的连续性。

更动pre10-pre11: 将 scdrom 模块分离出来,把它标记为“试验性的”,等待有人提交 scdrom 模块的补丁。

更动pre9-pre10: 把 findroot 的功能集成到 find 里面, 同时去掉了 findroot 命令. 用法举例:

find --set-root /boot/grub/menu.lst

fallback 命令现在可以用在菜单项中了. 举例:

# boot the first partition which contains linux

default 0
timeout 10

title (hd0,0) this is the first primary partition
fallback 1
kernel (hd0,0)/boot/vmlinuz root=/dev/hda1

title (hd0,1) this is the second primary partition
fallback 2
kernel (hd0,1)/boot/vmlinuz root=/dev/hda2

title (hd0,2) this is the third primary partition
fallback 3
kernel (hd0,2)/boot/vmlinuz root=/dev/hda3

title (hd0,3) this is the fourth primary partition
fallback 4
kernel (hd0,3)/boot/vmlinuz root=/dev/hda4

title (hd0,4) this is the first logical drive in the extended partition
fallback 5
kernel (hd0,4)/boot/vmlinuz root=/dev/hda5

# All the above items failed, try (hd0,5) at last
title (hd0,5) this is the second logical drive in the extended partition
kernel (hd0,5)/boot/vmlinuz root=/dev/hda6

GRUB FOR LINUX 的用法

grub4lin 的文件格式其实是一个 linux 的内核,所以,凡是能用 linux 内核的场合,都可以改用 grub4lin 这个文件。

1。在 Linux 下启动 GRUB。举例:

kexec -l grub4lin
kexec -e

你必须首先把你的 Linux 内核打上 kexec 补丁,并且安装 kexec 命令。请在 External Link http://www.google.com/ 搜索 kexec 以获得相关的信息。

2。从 LILO 中启动 GRUB。配置文件 lilo.conf 中的命令行举例:

image=/boot/grub4lin
label="grub4lin"

3。从任何一个 GRUB 版本中启动 GRUB4Linux。举例:

kernel (hd0,0)/grub4lin
boot

如果你有一个启动管理器在使用中,比如 LILO 和 GRUB,而你不想再安装另外一个启动管理器,这时,grub4lin 就管用了。它可以让你在现有的引导管理器中调用另外一个(其实可以是任意多个)功能不同的 GRUB 版本,比如有中文支持的,有磁盘仿真支持的,或者有网络启动支持的,等等。

grub4lin 的一个好处是,你不需要安装它,你只需要知道如何在你现有的引导管理器中如何调用它就行了。它的名字可以取成任意的,不一定要用 grub4lin 这个名字。例如 grub4lin-Chinese 或者 myGRUB 都可以。

grub4lin 的制作非常简单:编译 grub for dos 0.2.0pre13 生成一个叫做 grub4linstart 的文件,你自己的 GRUB 版本中有个 pre_stage2 文件,于是用

cat grub4linstart pre_stage2 > myGrub4Lin

命令将 grub4linstart 和 pre_stage2 连接起来,所生成的 myGrub4Lin 文件就是你自己的一个 grub4lin 版本了。你没有发现 pre_stage2 文件?噢,没关系,你有 stage2 文件也行。把 stage2 文件开头的一个扇区(也就是 512 字节)去掉,就变成 pre_stage2 了。

补充说明:你可能无法用 loadlin 来装入 grub4lin。这是因为 DOS 破坏了 BIOS 中断向量表,而 loadlin 在启动我们的 grub4lin 之前并未正确恢复这些中断向量,因此,当我们的 grub4lin 获得控制之后,仍然找不到正确的 ROM BIOS 中断向量,这通常引起死机。

将 GRUB 安装到软盘有两种方法:

1。用 grub 的 setup 命令:

grub> root (fd0)
grub> setup (fd0)

这种安装方法需要事先在软盘上存在 /boot/grub/ 目录,以及该目录下的那些 stage 文件。

2。用 grldr

将 GRLDR 的第四扇区经过修改之后放置到软盘的第一扇区,然后将 GRLDR 拷贝到软盘根目录。

具体步骤可以这样:
a. 格式化一张FAT格式的软盘,或者用任何一张现有的已经格式化了的FAT格式的软盘。
b. 将软盘第一扇区读入内存区域1,将 GRLDR 第四扇区读入内存区域2。
c. 将 内存区域1 的 0x02 至 0x3d 这 60 个字节复制到 内存区域2 的 0x02 至 0x3d。
d. 将更改后的 内存区域2 写入软盘第一扇区。
e. 把 GRLDR 文件复制到软盘根目录。【这一步任何时候做都行,不在乎先后】。

以上假定软盘是 FAT12 或者 FAT16 的格式。如果软盘是 FAT32 格式,则需要将上述 b,c 两个步骤改写为:

b. 将软盘第一扇区读入内存区域1,将 GRLDR 第三扇区读入内存区域2。
c. 将 内存区域1 的 0x02 至 0x59 这 88 个字节复制到 内存区域2 的 0x02 至 0x59。

将 GRUB 安装到硬盘主引导磁道(MBR 以及紧接 MBR 之后的几个扇区)的方法:

a. 将硬盘第一扇区(MBR)读入内存区域1,将 GRLDR 开头 16 个扇区读入内存区域2。
b. 将 内存区域1 的 0x01be 至 0x01ff 这 66 个字节复制到 内存区域2 的 0x01be 至 0x01ff。(这个区域是硬盘分区表)。
c. 将更改后的 内存区域2(其长度是 16 个扇区)写入硬盘开头的 16 个扇区上(也就是 MBR 以及紧接着它后面的 15 个扇区上)。

重要更正:上述 b. 应当更改为:
b. 将 内存区域1 的 0x01b8 至 0x01ff 这 72 个字节复制到 内存区域2 的 0x01b8 至 0x01ff。(这个区域是Windows 的 disk signature 以及硬盘分区表)。
参见 BUG 报告 External Link http://sourceforge.net/tracker/index.php?func=detail&aid=1062928&group_id=104188&atid=637224

再次更正:0.4.0 的 GRLDR 开头的扇区数要超过 5 个扇区,但今后永远也不会超过 16 扇区。所以上述写入 MBR 的扇区数目已经更改成了 16

补充说明:0.4.0 的 GRLDR,当安装到 MBR 之后,在紧接 MBR 之后的扇区(也就是第一块硬盘的第二扇区),可以放上先前被证明可以良好运作的 MBR 的拷贝。当 MBR 上的 GRLDR 启动代码找不到分区中的 GRLDR 文件时,会尝试启动此处备份的 MBR。

(声明:以上步骤写入 MBR,危险!!操作一定要谨慎,千万避免出现阴差阳错,一定保证不要失误!)

注:GRLDR 只可以按照如上所说安装到软盘引导区或者硬盘的“主引导区”,不可以安装到硬盘上某个“分区”的引导区。

Grub 命令索引

bean123做出的,按字母表列出顺序列出 Grub 中的主要命令(也包括 gandalf 等所作出的许多新的扩展),其中带有用法和基本的描述。
External Link http://grub4dos.sourceforge.net/grubcmd_ch.htm (in Chinese)

Table of GRUB Command Index with brief and detailed usage descriptions(by bean123)
External Link http://grub4dos.sourceforge.net/grubcmd_en.htm (in English, note that many extensions are included)

英文主页: External Link http://newdos.yginfo.net/grubdos.htm
winGRUB 主页: External Link http://grub4dos.sourceforge.net/ External Link http://sourceforge.net/projects/grub4dos/
简体中文化版 的主页: External Link http://sysoft.zdwx.com/grub/

United DOS Forum 英文论坛: External Link http://denbbs.2ya.com/ or External Link http://en.bbs.cn-dos.net/
请尽量在上述英文论坛用英文报告 BUG.(遗憾, 该英文论坛似乎不能访问了, 请用下面的中文论坛)

联合 DOS 论坛中文论坛(启动盘室): External Link http://bbs.cn-dos.net/

GNU GRUB Homepage: External Link http://www.gnu.org/software/grub/

GNU GRUB (BUG GRUB Info Page): External Link http://lists.gnu.org/mailman/listinfo/bug-grub

GNU GRUB (archive of the mailing-list): External Link http://lists.gnu.org/pipermail/bug-grub/

Loadlin home page: External Link http://elserv.ffm.fgan.de/~lermen/

LILO home page: External Link http://lilo.go.dyndns.org/

Kexec home page: External Link http://www.xmission.com/~ebiederm/files/kexec/

Syslinux home page: External Link http://syslinux.zytor.com/

Smart Boot Manager homepage: External Link http://btmgr.sourceforge.net/

sbm.bin download:
1. FTP site: External Link ftp://ftp.mcc.ac.uk/beta/local/teaching_cluster/disks/sbm.bin (only 18KB, recommended)
2. CVS log page: External Link http://cvs.debian.org/debian-cd/data/woody/sbm.bin.gz (click "download" in the cvs log page to get the file, it is a gzipped image of a 1.44M floppy)

Here is one way about how to boot sbm.bin from "GRUB for DOS":

map --mem (?,?)/.../sbm.bin (fd0)
chainloader (?,?)/.../sbm.bin
boot

if the --mem option is not present, then it requires that the file sbm.bin is contiguous.

Success booting CD from a GRUB prompt: External Link http://lists.gnu.org/archive/html/bug-grub/2004-05/msg00099.html

Problems with USB boot
Some buggy BIOSes(e.g., DELL machines) hardcoded C/H/S geometry values(e.g., C=1000, H=4, S=32) of the USB key storage devices. This may cause problems at boot time. You can re-partition/re-format the USB disk and use these hardcoded geometry values to avoid boot failure.

也可以在下面的留言板上写几句话.

Useful pages: 孤立页面, 待建页面, 搜索, 文件上传, 类别索引.

DOCs in Chinese
DOS 下用 GRUB.EXE 修复启动故障: External Link ftp://ftp.linuxeden.com/tinybit/doc_000.html
用 GRUB 来引导软盘映象――节约软盘介质了: External Link ftp://ftp.linuxeden.com/tinybit/doc_001.html
GRUB for DOS 磁盘仿真命令简介: External Link ftp://ftp.linuxeden.com/tinybit/doc_002.html

Useful links in Chinese
GRUB 入门 External Link http://www.linuxsir.org/bbs/showthread.php?s=&threadid=74728&highlight=%D0%C2%C4%DA%BA%CB
GRUB 入门 External Link http://www.linuxsir.com/bbs/showthread.php?s=&threadid=23573
GRUB 入门 External Link http://www.chinaunix.net/jh/4/66853.html
GRUB 入门 External Link http://www.chinaunix.net/forum/viewtopic.php?t=66853
GRUB 入门 External Link http://www.douzhe.com/linux/04__boot/04072.htm
GRUB 入门 External Link http://www.douzhe.com/jh/4/66853.html
GRUB 入门 External Link http://www.linuxfans.org/nuke/modules.php?name=News&file=article&sid=921
GRUB 入门教程 External Link http://dianli98.51.net/rhlinux/show.php?type=soft&id=1020477475
GRUB 使用说明 External Link http://www.chinaunix.net/forum/viewtopic.php?t=16164
GRUB 使用说明 External Link http://www.yesky.com/20020808/1624211.shtml
GRUB 使用说明 External Link http://xch6636.51.net/linux/linux10.php
GRUB 使用详解 External Link http://www.kaijia.net/info_Print.asp?ArticleID=175
多重引导管理器Grub使用详解 External Link http://it.enorth.com.cn/system/2000/12/21/000005000.shtml
多重引导管理器Grub使用详解 External Link http://nalai.net/print/2/2870/html
Grub详解 External Link http://www.gbunix.com/htmldata/2004_07/1/3/article_395_1.html
GRUB 全攻略 External Link http://www.moon-soft.com/program/doc/readelite437365.htm
Grub安装,配置及使用汇总 External Link http://www.suncn.net/linux/2004-07-27/linux0-4-3968.html
Grub配置杂谈 External Link http://new.fengnet.com/Article/OS/Linux/200311/446.html
Grub 菜单编辑器-内置 Grldr/IELDR 安装程序 External Link http://bbs.wwwfox.net/cgi-bin/topic.cgi?forum=34&topic=5778&start=0&show=0
Grub傻瓜教程 External Link http://www.99cq.net/bbs/show.asp?id=6534&bd=5&totable=3&bn=

GRUB多重启动管理器 External Link http://www.linuxts.com/modules.php?name=Sections&op=viewarticle&artid=1336
GRUB多重启动管理器 External Link http://www.mhdn.net/o/2001-04-16/3363.html
GRUB多重启动管理器 External Link http://www.lslnet.com/linux/docs/linux-2975.htm
GNU GRUB启动管理器 External Link http://oldsite.linuxaid.com.cn/training/showtri.jsp?i=190
GNU GRUB FAQ (简体中文版) External Link http://www.linuxts.com/modules.php?name=Sections&op=viewarticle&artid=1344
GRUB 三步通 External Link http://www.linuxts.com/modules.php?name=Sections&op=viewarticle&artid=1347
Linux基础知识 External Link http://developer.ccidnet.com/pub/column/c307.html
Linux在线培训阅读导引 External Link http://oldsite.linuxaid.com.cn/training/showtri.jsp?i=298
Linux版精华帖分类索引 External Link http://bbs.chinaunix.net/forum/4/20030622/97603.html
硬盘分区及GRUB大总结 External Link http://www.wonyen.net/bbs/article.asp?titleid=828&ntypeid=27
强!用U盘启动winPE External Link http://bbs.wwwfox.net/cgi-bin/topic.cgi?forum=34&topic=5986

技术开发资源
webCrazy的《深入探索Windows NT》 External Link http://www.geocities.jp/webcrazyjp/index.htm
ext2 文件系统的硬盘布局 External Link http://www-128.ibm.com/developerworks/cn/linux/filesystem/ext2/

Useful links in English
Install GNU/Linux without any CD, floppy, USB-key, nor any other removable media External Link http://marc.herbert.free.fr/linux/win2linstall.html

Highly Recommended Sites
powerLoad Resource - various boot disks and many more! External Link http://oldfiles.org.uk/powerload/

etc
Int15MemoryOperations
External Link ftp://ftp.linuxeden.com/tinybit/MandrakeISOinstall-10.0.tar

temporary ftp sites

External Link ftp://ftp.cosoft.org.cn/incoming/
External Link ftp://ftp.linuxeden.com/tinybit/

news in English

Reboot Linux Faster Using kexec External Link http://osnews.com/comment.php?news_id=6946

WOW! The Q language, a very high level programming language by Per Bothner

The Q Language(online manual by Per Bothner himself): External Link http://home.pacbell.net/bothner/Qman.html

A Programming-Language Shell(classical article by Per Bothner): External Link http://per.bothner.com/software/Q/Qshell.html

Low Level Virtual Machine (LLVM) 1.3 Released
External Link http://osnews.com/comment.php?news_id=8041
External Link http://developers.slashdot.org/article.pl?sid=04/08/13/2356209

Development Links
Ralf Brown's Interrupt List: It's cool External Link http://www.ctyme.com/rbrown.htm
A Disk Editor View of the NTFS Boot Sector and "Bootstrap Code" External Link http://www.therdcom.com/asm/mbr/NTFSbrHexEd.htm
The Second Extended File System(Internal Layout) External Link http://www.nongnu.org/ext2-doc/ext2.html

Cool Screen Shots
Gambas: External Link http://www.linuxeden.com/news/?newsid=6754
FOX: External Link http://www.linuxeden.com/news/?newsid=6753
E/OS LX: External Link http://www.linuxeden.com/news/?newsid=6729
SRC: External Link http://www.linuxeden.com/news/?newsid=6712

Free Emulators
比 VMware 更强大的开放源码的 CPU 仿真器 QEMU: External Link http://fabrice.bellard.free.fr/qemu/
IA-32 仿真器 BOCHS: External Link http://bochs.sourceforge.net/
DOS 仿真器 DOSBOX: External Link http://dosbox.sourceforge.net/
DOS 仿真器 DOSEMU: External Link http://dosemu.sourceforge.net/
x86 虚拟机 PLEX86: External Link http://plex86.sourceforge.net/

在这里讨论grub_for_dos-0.3.x的相关问题

点击这里可以察看grub中文屏幕抓图
点击这里可以到grub的下载专区
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值