old-www/HOWTO/Bootdisk-HOWTO/cd-roms.html

373 lines
7.7 KiB
HTML

<HTML
><HEAD
><TITLE
>Creating bootable CD-ROMs</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.63
"><LINK
REL="HOME"
TITLE="The Linux Bootdisk HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="How the pros do it"
HREF="pros.html"><LINK
REL="NEXT"
TITLE="Frequently Asked Question (FAQ) list"
HREF="x1143.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Linux Bootdisk HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="pros.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x1143.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="CD-ROMS"
>11. Creating bootable CD-ROMs</A
></H1
><DIV
CLASS="NOTE"
><P
></P
><TABLE
CLASS="NOTE"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>This section was contributed by Rizwan Mohammed Darwe
(<TT
CLASS="LITERAL"
>rizwan AT clovertechnologies dot com</TT
>)
</P
></TD
></TR
></TABLE
></DIV
><P
>This section assumes that you are familiar with the process and workings of
writing CDs in linux. Consider this to be a quick reference to include the
ability to boot the CD which you will burn. The CD-Writing-HOWTO should give you
an in-depth reference.</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN1106"
>11.1. What is El Torito?</A
></H2
><P
>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.</P
><P
> The "El Torito" spec says that <EM
>any</EM
> cdrom drive
should work (SCSI or EIDE) as long as the BIOS supports El Torito. So far
this has only been tested with EIDE drives because none of the SCSI
controllers that has been tested so far appears to support El Torito. The
motherboard definately has to support El Torito. How do you know if your
motherboard supports "El Torito"? Well, the ones that support it let you
choose booting from hard disk, Floppy, Network or CDROM. </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN1111"
>11.2. How it Works</A
></H2
><P
> The El Torito standard works by making the CD drive appear, through
BIOS calls, to be a normal floppy drive. This way you simply put any floppy
size image (exactly 1440k for a 1.44 meg floppy) somewhere in the ISO
filesystem. 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 as
if it were booting from the floppy drive. This allows a working LILO boot
disk, for example, to simply be used as is. </P
><P
>Roughly speaking, the first 1.44 (or 2.88 if supported) Mbytes of the
CD-ROM contains a floppy-disk image supplied by you. This image is treated
like a floppy by the BIOS and booted from. (As a consequence, while booting
from this virtual floppy, your original drive A:
(<TT
CLASS="FILENAME"
>/dev/fd0</TT
>) may not be accessible, but you can try with
<TT
CLASS="FILENAME"
>/dev/fd1</TT
>). </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN1117"
>11.3. How to make it work</A
></H2
><P
>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
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
> dd if=/dev/fd0 of=boot.img bs=10k count=144</PRE
></FONT
></TD
></TR
></TABLE
>
assuming the floppy is in the A: drive.</P
><P
>Place this image somewhere in the hierarchy which will be the source
for the iso9660 filesystem. It is a good idea to put all boot related
files in their own directory ("boot/" under the root of the iso9660 fs,
for example).</P
><P
>One caveat -- Your boot floppy <EM
>must</EM
> load any initial
ramdisk via LILO, not the kernel ramdisk driver! This is because once the
linux kernel starts up, the BIOS emulation of the CD as a floppy disk is
circumvented and will fail. LILO will load the initial ramdisk using BIOS
disk calls, so the emulation works as designed.</P
><P
>
The El Torito specification requires a "boot catalog" to be created as
well. 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 automatically
create the boot catalog, but you must specify where the boot catalog will go
in the iso9660 filesystem. Usually it is a good idea to put it in the same
place as the boot image, and a name like <TT
CLASS="FILENAME"
>boot.catalog</TT
>
seems appropriate.</P
><P
>So we have our boot image in the file <TT
CLASS="FILENAME"
>boot.img</TT
>,
and we are going to put it in the directory <TT
CLASS="FILENAME"
>boot/</TT
> under the root of the iso9660 filesystem.
We will have the boot catalog go in the same directory with the name
<TT
CLASS="FILENAME"
>boot.catalog</TT
>. The command to create the iso9660 fs in
the file <TT
CLASS="FILENAME"
>bootcd.iso</TT
> is then:
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>mkisofs -r -b boot/boot.img -c boot/boot.catalog -o bootcd.iso .</PRE
></FONT
></TD
></TR
></TABLE
>
The <TT
CLASS="OPTION"
>-b</TT
> option specifies the boot image to be used (note the
path is relative to the root of the iso9660 disk), and the <TT
CLASS="OPTION"
>-c</TT
>
option is for the boot catalog file. The <TT
CLASS="OPTION"
>-r</TT
> option will make
approptiate file ownerships and modes (see the <TT
CLASS="FILENAME"
>mkisofs</TT
>
manpage). The "." in the end says to take the source from the current
directory. </P
><P
>Now burn the CD with the usual cdrecord command and it is ready to boot.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN1137"
>11.4. Create Win9x Bootable CD-Roms</A
></H2
><P
>The first step is to get hold of the bootable image used by the source
CD. But you cannot simply mount the CD under linux and dd the first 1440k to
a floppy disk or to a file like <TT
CLASS="FILENAME"
>boot.img</TT
>. Instead you
simply boot with the source CD-ROM. </P
><P
>When you boot the Win98 CD you are dropped to A: prompt which is the
actual ramdisk. And D: or Z: is where all the installables are residing. By
using the diskcopy command of dos copy the A: image into the actual floppy
drive which is now B: The command below will do this.
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>diskcopy A: B: </PRE
></FONT
></TD
></TR
></TABLE
>
It works just like dd. You can try booting from this newly created disk to
test if the booting process is similar to that of the source CD. Then the
usual dd of this floppy to a file like boot.img and then rest is as usual.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="pros.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x1143.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>How the pros do it</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Frequently Asked Question (FAQ) list</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>