更新3:从版本0.4.0开始,DOS下的GRUB支持内存驱动器。示例:
# boot into a floppy
image
map --mem
(hd0,0)/floppy.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
map --floppies=1
boot
Because the image will be copied to a memory area, the image itself can be
non-contiguous and even gzipped.由于镜像将被拷贝到一个内存区域,所以镜像本身可以是非连续存储的,甚至可以是被gzip压缩过的。Another Example:另一个例子:map --mem=-2880
(hd0,0)/floppy.img (fd0)
This memdrive (fd0) will occupy at least 1440 KB of memory. This is useful when
the size of a 1.44M-floppy image is less than 1440 KB.这个内存驱动器(fd0)将占用至少1440 KB的内存。这个用法对那些小于1440 KB的1.44M软盘镜像很有用。One more example:再例如:map --mem --read-only
(hd0,0)/hd.img (hd1)
This memdrive is a hard drive, and read-only. That means you will not be able
to write data to the memdrive (hd1).这个内存驱动器成为了一个硬盘驱动器,并且是只读的。这表示你不能向这个(hd1)中写入数据。You can use many memdrives and many ordinary virtual emulated disk-based drives
at the same time.你可以同时使用多个内存驱动器和多个普通的基于磁盘虚拟的仿真驱动器。If the BIOS does not support int15/EAX=e820h, you will not be able to use any memdrives.如果BIOS不支持中断int15/EAX=e820h,你将不能使用任何内存驱动器。Update 4: For memdrive emulation, a single-partition image
can be used instead of a whole-harddrive image. Example:更新4:对于内存驱动器仿真,一个单一的分区镜像可以被转换为完整的硬盘镜像来使用。例如:map --mem
(hd0,7)/win98.img (hd0)
map --hook
chainloader (hd0)+1
rootnoverify (hd0)
map --harddrives=1
boot
Here win98.img is a partition image without the leading MBR and partition table
in it. Surely GRUB for DOS will build an MBR and partition table for the
memdrive (hd0).这里的win98.img是一个头部不含主引导记录和分区表的分区镜像。当然,GRUB for DOS在进行仿真操作时会为这个内存驱动器(hd0)建立一个MBR和分区表。Update 5: Now GRLDR can be used as a no-emulation-mode bootable CD-ROM
boot image.
Example for Linux users:更新5:现在GRLDR可以作为一个非模拟模式的可启动光盘的启动映像文件来使用。Linux用户使用示例:mkdir iso_root
cp grldr iso_root
mkisofs -R -b grldr
-no-emul-boot -boot-load-seg 0x1000 -o bootable.iso iso_root
As an alternative, grldr can also be used the same way as stage2_eltorito. The
-boot-info-table option is allowed but you can omit it:另一种选择是,grldr也可以用同样的方法作为stage2_eltorito来使用。你可以使用-boot-info-table选项,但你可以省略它:mkdir iso_root
cp grldr iso_root
mkisofs -R -b grldr
-no-emul-boot -boot-load-size 4 -o grldr.iso iso_root
Also note that the bootable.iso above must be created with the -boot-load-seg
0xHHHH option where HHHH is greater than or equal to 1000(hex). If HHHH <
1000(hex), QEMU will hang. This is a bug in QEMU. The grldr.iso can be created
with or without -boot-load-seg 0xHHHH option.需要注意的是:上面创建bootable.iso镜像时,如果使用了-boot-load-seg 0xHHHH选项,就必须令HHHH大于或者等于1000(十六进制),如果HHHH小于1000(十六进制),虚拟机QEMU会死机,这是QEMU的一个bug。grldr.iso可以使用也可以不使用-boot-load-seg 0xHHHH选项来创建。
博客介绍了从版本0.4.0开始,DOS下GRUB对内存驱动器的支持,包括不同类型镜像的映射示例,如软盘、硬盘镜像等,还提到内存驱动器使用的条件。此外,说明了GRUB for DOS在内存驱动器仿真时对分区镜像的处理,以及GRLDR在Linux下作为非模拟模式可启动光盘启动映像的使用方法和注意事项。
2万+

被折叠的 条评论
为什么被折叠?



