+ -
当前位置:首页 → 问答吧 → GRUB2的新特性

GRUB2的新特性

时间:2005-03-17

来源:互联网

作为取替Grub的下一代启动加载器GRUB2,正在开发中。

引用:
GRUB 2, which is a rewrite of GRUB, is alive and under development. GRUB 2 aims at merging sources from PUPA in order to create the next generation of GNU GRUB. A mailing list and a wiki have been setup for discussing the development of GRUB 2.

GRUB 2 has the following tasks:

* Create a compact core image. This will make Stage 1.5 unnecessary.
* Add support for dynamic loading to the core image, so that it can extend itself at the run time rather than at the build time.
* Add real memory management, to make GNU GRUB more extensible.
* Add a more object-oriented framework for file systems, files, devices, drives, terminals, commands, and OS loaders.
* Add support for internationalization. This includes support for non-ASCII character code, message catalogs like gettext, fonts, graphics console, and so on.
* Add an actual localization, based on the above internationalization support. We will target on Japanese as the first step.
* Segregate code specific to i386-pc from generic code, to make GNU GRUB portable.
* Add support for cross-platform installation.
* Develop additional software packages which will help our project and hopefully other projects.
从官方的说明可以看到,与Grub相比,最大的差异在于GRUB2将stage1.5以及stage2的功能归并为GRUB2的kernel(源码放在GRUB2源码目录下的kern),并提高了压缩性能;我测试过,使用CVS版本来编译生成的kernel──core.img只有24KB左右,即使对于最普遍的chs读写模式所支持的0面0道的64个扇区(折合32K左右)而言,空间是足够放置GRUB2的kernel的,要知道,Grub的每个stage1.5都至少在11K左右,而stage2则为110K左右,这种体积上的跃变,是很厉害的一件事!

而stage1则对应了GRUB2中的boot.S,start则对应了GRUB2中的startup.S,这两个扇区在GRUB2中发挥的作用差不多,都调用了BIOS的INT 13H扩展例程来加载后续扇区,唯一不同的是,startup.S加载的不是stage1.5或者stage2,而是GRUB2的kernel。

提到kernel,很自然想象到module,没错,GRUB的kernel也使用了模块机制。
代码:
/* The main routine. */
void
grub_main (void)
{
 /* First of all, initialize the machine. */
 grub_machine_init ();

 /* Hello. */
 grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
 grub_printf ("Welcome to GRUB!\n\n");
 grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);

 /* It is better to set the root device as soon as possible,
 for convenience. */
 grub_set_root_dev ();

 /* Load pre-loaded modules and free the space. */
 grub_register_exported_symbols ();
 grub_load_modules ();

 /* Load the normal mode module. */
 grub_load_normal_mode ();
 
 /* Enter the rescue mode. */
 grub_enter_rescue_mode ();
}
从kernel的main函数可以看到,它调用grub_load_modules()来加载所有的模块,这就是GRUB2扩展性能的体现之一。

另外,GRUB2支持多国语言的显示,主要在configfile注释、命令输出、标题等处。目前的CVS版本仅支持日文。

一个优秀的Boot Loader──GRUB2,正如一个mini OS。它展现了内核之外的另一道风景线。

在RMS所提倡的freebios面世之前,GRUB2是自由之歌最好的前奏了。
我认为,"Freebios + GRUB2 + linux/Hurd"将会成为GNU最坚厚的基石,到了那时,除了硬件不开源以外,所有的软件甚至包括各种固件都会走向GNU自由开源的道路,呵呵。

作者: home_king   发布时间: 2005-03-17

最后一句话说得很有气势啊

作者: goldeagle   发布时间: 2005-03-17

还需要补充一点,那就是FreeBIOS目前还只应用于集群服务器或者嵌入式板。

作者: home_king   发布时间: 2005-03-18

好,希望早日看到中文的启动菜单。

p.s.很多硬件已经开源了,比如风扇,散热片,机箱等

作者: lexrus   发布时间: 2005-03-18

引用:
作者: lexrus
好,希望早日看到中文的启动菜单。

p.s.很多硬件已经开源了,比如风扇,散热片,机箱等
呵呵,那些是水货或者盗版,不能算是开源。

作者: home_king   发布时间: 2005-03-18

给出GRUB2的截图,编译了CVS版本中所有的模块。
上传的图像
Snap1.jpg (40.3 KB, 566 次查看)

作者: home_king   发布时间: 2005-03-23

apt-get install grub2后怎么/boot/grub下面没什么变化?

作者: utstar   发布时间: 2005-03-26

很感兴趣。如果能和isolinux结合起来,可以在启动光盘上使用,那就好了。再如果能允许附加插件实现一些功能,例如编辑文件(大家知道,Grub是需要编辑配置文件的,实际上任何Boot loader都需要),那就Perfect了!!!

作者: 地球发动机   发布时间: 2005-03-28

我机器里面装的就是中文的,不过我改了一些东西。

作者: LF.Andy   发布时间: 2006-03-24

现在才是1.92版本,出2.0不知道要什么时候。

作者: 米奇鼠   发布时间: 2006-03-25

看上去很好玩,哪里有源代码下载?

作者: is02bing   发布时间: 2006-03-25

我还以为是第二个GRUB的意思呢?我重装了好几次。所以我以为是我装错了。看来不是。

作者: net_king   发布时间: 2006-04-27

我看了截图,里面有个multiboot file的命令,这个命令是不是可以用来引导可引导的ISO文件?

现在的1G U盘很便宜了,而自己时不时的会装下各种不同的系统,总是刻盘总是麻烦,如果可以把grub2装在U盘上,然后下载ISO文件在U盘中,从U盘引导,这样就很好啊。
不知道grub2具体如何实现,上网搜了搜,没找到什么有用的资料。

-----------------------
google了大半天,终于找到一个链接 http://osdir.com/ml/boot-loaders.gru.../msg00036.html
很遗憾,这似乎是不可能实现的功能。

作者: NetDC   发布时间: 2007-03-29

grub 一年没更新了

作者: nblhj   发布时间: 2007-10-09

能支持 xfs吗??

作者: ttand   发布时间: 2007-10-18

好现grub 1.0的还没发布吧。
BTW:个人觉得引导程序支持多国语言费力而不讨好。

作者: wsw   发布时间: 2007-10-29

grub之所以没有竞争对手,很大原因是因为微软故意不开发通用的系统引导程序。

作者: linunixer   发布时间: 2008-05-19

啥时候支持EFI呀

作者: jiangpeng   发布时间: 2009-06-10

原来的kernel命令变为linux命令了,那FreeBSD呢???FreeDOS-32呢???

作者: defrag   发布时间: 2009-08-30

热门下载

更多