linux中制作可启动的ISO

links:http://www.linux.org/docs/ldp/howto/Bootdisk-HOWTO/cd-roms.html 11. Creating bootable CD-ROMs This section was contributed by Rizwan Mohammed Darwe (rizwan AT clovertechnologies dot com) This section assumes that you are familiar with the process and workings ofwriting CDs in linux. Consider this to be a quick reference to include theability to boot the CD which you will burn. The CD-Writing-HOWTO should give youan in-depth reference. 11.1. What is El Torito? For the x86 platform, many BIOS's have begun to support bootable CDs.The patches for mkisofs is based on the standard called "El Torito".Simply put, El Torito is a specification that says how a cdrom should be formatted such that you can directly boot from it. The "El Torito" spec says that any cdrom driveshould work (SCSI or EIDE) as long as the BIOS supports El Torito. So farthis has only been tested with EIDE drives because none of the SCSIcontrollers that has been tested so far appears to support El Torito. Themotherboard definately has to support El Torito. How do you know if yourmotherboard supports "El Torito"? Well, the ones that support it let youchoose booting from hard disk, Floppy, Network or CDROM. 11.2. How it Works  The El Torito standard works by making the CD drive appear, throughBIOS calls, to be a normal floppy drive. This way you simply put any floppysize image (exactly 1440k for a 1.44 meg floppy) somewhere in the ISOfilesystem. In the headers of the ISO fs you place a pointer to this image.The BIOS will then grab this image from the CD and for all purposes it acts asif it were booting from the floppy drive. This allows a working LILO bootdisk, for example, to simply be used as is. Roughly speaking, the first 1.44 (or 2.88 if supported) Mbytes of theCD-ROM contains a floppy-disk image supplied by you. This image is treatedlike a floppy by the BIOS and booted from. (As a consequence, while bootingfrom this virtual floppy, your original drive A:(/dev/fd0) may not be accessible, but you can try with/dev/fd1). 11.3. How to make it work First create a file, say "boot.img", which is an exact image of the bootable floppy-disk which you want to boot via the CD-ROM. This must be an 1.44 MB bootable floppy-disk. The command below will do this dd if=/dev/fd0 of=boot.img bs=10k count=144assuming the floppy is in the A: drive.Place this image somewhere in the hierarchy which will be the sourcefor the iso9660 filesystem. It is a good idea to put all boot relatedfiles in their own directory ("boot/" under the root of the iso9660 fs,for example).One caveat -- Your boot floppy must load any initialramdisk via LILO, not the kernel ramdisk driver! This is because once thelinux kernel starts up, the BIOS emulation of the CD as a floppy disk iscircumvented and will fail. LILO will load the initial ramdisk using BIOSdisk calls, so the emulation works as designed. The El Torito specification requires a "boot catalog" to be created aswell. This is a 2048 byte file which is of no interest except it is required.The patchwork done by the author of mkisofs will cause it to automaticallycreate the boot catalog, but you must specify where the boot catalog will goin the iso9660 filesystem. Usually it is a good idea to put it in the sameplace as the boot image, and a name like boot.catalogseems appropriate.So we have our boot image in the file boot.img,and we are going to put it in the directory boot/ under the root of the iso9660 filesystem.We will have the boot catalog go in the same directory with the nameboot.catalog. The command to create the iso9660 fs inthe file bootcd.iso is then:mkisofs -r -b boot/boot.img -c boot/boot.catalog -o bootcd.iso .The -b option specifies the boot image to be used (note thepath is relative to the root of the iso9660 disk), and the -coption is for the boot catalog file. The -r option will makeapproptiate file ownerships and modes (see the mkisofsmanpage). The "." in the end says to take the source from the currentdirectory. Now burn the CD with the usual cdrecord command and it is ready to boot. 11.4. Create Win9x Bootable CD-Roms The first step is to get hold of the bootable image used by the sourceCD. But you cannot simply mount the CD under linux and dd the first 1440k toa floppy disk or to a file like boot.img. Instead yousimply boot with the source CD-ROM. When you boot the Win98 CD you are dropped to A: prompt which is theactual ramdisk. And D: or Z: is where all the installables are residing. Byusing the diskcopy command of dos copy the A: image into the actual floppydrive which is now B: The command below will do this.diskcopy A: B: It works just like dd. You can try booting from this newly created disk totest if the booting process is similar to that of the source CD. Then theusual dd of this floppy to a file like boot.img and then rest is as usual.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值