Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1008097
  • 博文数量: 177
  • 博客积分: 3629
  • 博客等级: 中校
  • 技术积分: 1839
  • 用 户 组: 普通用户
  • 注册时间: 2005-02-23 21:21
文章分类

全部博文(177)

文章存档

2021年(1)

2020年(5)

2019年(4)

2018年(7)

2017年(1)

2016年(4)

2014年(1)

2013年(8)

2012年(10)

2011年(50)

2009年(12)

2008年(10)

2006年(56)

2005年(8)

分类: LINUX

2011-03-21 10:11:58

更新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 KB1.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的一个buggrldr.iso可以使用也可以不使用-boot-load-seg 0xHHHH选项来创建。

阅读(3415) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~