下载:http://grub4dos.sourceforge.net/tools/grub4dos_sp.tar.gz
这是在不点 GRUB4DOS 的基础上,加上一些补丁后的版本,功能包括:
1、grub4dos pre13
此版本基于最新的 grub4dos pre13
2、Etherboot 5.3.8
更新了一些网卡驱动模块。此增强版本编译了的网卡有3c50x, eepro100, rtl8159 和 ns8390。前面三个大家应该比较熟悉,最后一个是NE2000的驱动,这意味着你可以在qemu下测试网络的功能。
3、env 补丁
这是我加上的设置环境变量的补丁。用法有:
set value=name or set -o
设置变量或开关
show
显示变量值
这补丁使得用户可以在grub中设置变量或开关。目前仅有FreeBSD补丁使用了这部分功能。
3、FreeBSD module 补丁
这补丁是我根据FreeBSD的loader(8)的代码而增加的,它使得在grub下可以直接装载FreeBSD模块。FreeBSD的模块不止可以是核心代码,也可以是数据,比如是用户的配置文件(user_config),开机画面(spash_image),虚拟盘(mfs_root),等。另外,我也修改了initrd函数,使得FreeBSD可以像Linux那样装载初始化的ramdisk。
FreeBSD补丁使用了以上提到的env功能。在变量方面,所有以 “FreeBSD.“ 开始的变量均会被复制到内核空间。在开关方面,用到了 -a ,当打开时,模块在装载时按页面边界对齐。
例子:
kernel (hd0,0)/kernel - 装载内核
module (hd0,0)/msdos.ko - 装载模块
module (hd0,0)/cfg --type=user_config - 装载数据模块(类型是user_config)
initrd (hd0,0)/memdisk.gz - 装载初始化ramdisk。着其实等价于 module (hd0,0)/memdisk.gz --type=mfs_root
initrd (hd0,0)/disk2.gz - 不同于linux,FreeBSD允许装载多个初始化ramdisk。
lsmod - 显示当前装载的模块
set FreeBSD.vfs.root.mountfrom=ufs:/dev/md0c - 这显示了如何设置FreeBSD的核心变量。这句的意思是告诉核心从第一只初始化ramdisk中启动。如果要选择从第二只初始化ramdisk启动,使用md1c,从硬盘启动,使用ad0s1a,从软盘启动,使用fd0a,等等。
4、TAGIMAGE 补丁 (NBI补丁)
这使得grub可以装载由mknbi所创建的 NBI 文件。一种有趣的用法是 mknbi-dos 所创建的映像文件。当装载时,它会生成内存中的虚拟软盘。这与memdisk.gz生成的软盘有点相似。但它还有一个附加的功能,那就是可以用工具rmrd删除生成的软盘,这在memdisk.gz中暂时还不可以。
生成nbi文件:
mknbi-dos flop.img > flop.nb
装载nbi文件:
kernel (hd0,0)/flop.nb
装载网络中nbi文件:(这其实就是etherboot/netboot所实现功能)
ifconfig --address=my_ip --server=server_ip
kernel (nd)/flop.nb
另一个更有趣的用法是用它来装载另一个grub。nbgrub其实就是一个以NBI格式所包装的grub。现在有了这补丁,用kernel 就直接可以装载另一个版本的nbgrub文件。
5、GRUB IMAGE 补丁
这是以上的nbgrub观念的扩展。加了该补丁,grub 可以直接装载grldr或grldr,而无需间接通过nbgrub了。那说明,以下的三种方式都可以用来装载另一个版本的grub:
kernel (hd0,0)/nbgrub
kernel (hd0,0)/stage2
kernel (hd0,0)/grldr
注意一下,该补丁暂时还不支持其它形式的grub映像,如 pxegrub, grub4lin 和 grub.exe。
6、128 字节的presetmenu空间
这版本没有设定presetmenu,这意味着它不会自动搜索menu.lst的位置。但它里面预留了128字节的presetmenu空间,你可以自己设定所需的presetmenu。例如:
硬盘中寻找menu.lst:
find --set-root /boot/grub/menu.lst
configfile /boot/grub/menu.lst
使用bootp的网络启动
bootp
configfile (nd)/menu.lst
手动设置参数的网络启动
ifconfig --address=192.168.2.100 --server=192.168.2.1
kernel (nd)/flop.nb
修改presetmenu可用 WinGrub 或 GRUB4DOS Unix Tools (http://grub4dos.sourceforge.net/tools/grub_utools.tar.gz).
Download: http://grub4dos.sourceforge.net/tools/grub4dos_sp.tar.gz
This is a version with some patches added without the basis of GRUB4DOS. The functions include:
1. grub4dos pre13
This version is based on the latest grub4dos pre13
2. Etherboot 5.3.8
Some network card driver modules are updated. The network cards compiled in this enhanced version are 3c50x, eepro100, rtl8159 and ns8390. The first three are relatively familiar to everyone, and the last one is the driver of NE2000, which means you can test the network function under qemu.
3. env patch
This is a patch for setting environment variables added by me. The usage is:
set value=name or set -o
Set variables or switches
show
Display variable value
This patch enables users to set variables or switches in grub. Currently, only the FreeBSD patch uses this part of the function.
3. FreeBSD module patch
This patch is added according to the code of FreeBSD's loader(8), which enables FreeBSD modules to be directly loaded under grub. FreeBSD modules can be not only core code but also data, such as user configuration files (user_config), boot screen (spash_image), virtual disk (mfs_root), etc. In addition, I also modified the initrd function, so that FreeBSD can load the initialized ramdisk like Linux.
The FreeBSD patch uses the above-mentioned env function. In terms of variables, all variables starting with "FreeBSD." will be copied to the kernel space. In terms of switches, -a is used. When turned on, the module is aligned according to the page boundary when loaded.
Example:
kernel (hd0,0)/kernel - load kernel
module (hd0,0)/msdos.ko - load module
module (hd0,0)/cfg --type=user_config - load data module (type is user_config)
initrd (hd0,0)/memdisk.gz - load initialized ramdisk. This is actually equivalent to module (hd0,0)/memdisk.gz --type=mfs_root
initrd (hd0,0)/disk2.gz - Unlike Linux, FreeBSD allows loading multiple initialized ramdisks.
lsmod - display currently loaded modules
set FreeBSD.vfs.root.mountfrom=ufs:/dev/md0c - This shows how to set the core variables of FreeBSD. This sentence means to tell the core to start from the first initialized ramdisk. If you want to choose to start from the second initialized ramdisk, use md1c, start from the hard disk, use ad0s1a, start from the floppy disk, use fd0a, etc.
4. TAGIMAGE patch (NBI patch)
This enables grub to load NBI files created by mknbi. An interesting usage is the image file created by mknbi-dos. When loaded, it will generate a virtual floppy disk in memory. This is a bit similar to the floppy disk generated by memdisk.gz. But it also has an additional function, that is, the generated floppy disk can be deleted with the tool rmrd, which is not possible in memdisk.gz for the time being.
Generate nbi file:
mknbi-dos flop.img > flop.nb
Load nbi file:
kernel (hd0,0)/flop.nb
Load nbi file in network: (this is actually the function implemented by etherboot/netboot)
ifconfig --address=my_ip --server=server_ip
kernel (nd)/flop.nb
Another more interesting usage is to use it to load another grub. nbgrub is actually a grub packaged in NBI format. Now with this patch, you can directly use kernel to load another version of the nbgrub file.
5. GRUB IMAGE patch
This is an extension of the above nbgrub concept. With this patch added, grub can directly load grldr or grldr without going through nbgrub indirectly. That is to say, the following three methods can be used to load another version of grub:
kernel (hd0,0)/nbgrub
kernel (hd0,0)/stage2
kernel (hd0,0)/grldr
Note that this patch does not currently support other forms of grub images, such as pxegrub, grub4lin and grub.exe.
6. 128-byte presetmenu space
This version does not set presetmenu, which means it will not automatically search for the location of menu.lst. But it reserves 128 bytes of presetmenu space, and you can set the required presetmenu yourself. For example:
Find menu.lst on the hard disk:
find --set-root /boot/grub/menu.lst
configfile /boot/grub/menu.lst
Network boot using bootp
bootp
configfile (nd)/menu.lst
Network boot with manual setting of parameters
ifconfig --address=192.168.2.100 --server=192.168.2.1
kernel (nd)/flop.nb
You can modify presetmenu with WinGrub or GRUB4DOS Unix Tools (http://grub4dos.sourceforge.net/tools/grub_utools.tar.gz).