1/* @(#)README.eltorito	1.3 20/05/10 eric, 2000-2020 J. Schilling */
2
3What is El Torito?
4------------------
5Simply put, El Torito is a specification that says how a cdrom should
6be formatted such that you can directly boot from it.
7
8The "El Torito" spec says that ANY cdrom drive should work (scsi/eide)
9as long as the BIOS supports El Torito. So far this has only been
10tested with EIDE drives because none of the scsi controllers that has
11been tested so far appears to support El Torito. The motherboard
12definately has to support El Torito. The ones that do let you choose
13booting from HD, Floppy, Network or CDROM.
14
15How To Make Bootable CDs
16------------------------
17
18For the x86 platform, many BIOS's have begun to support bootable CDs.
19The standard my patches for mkisofs is based on is called "El Torito".
20
21The "El Torito" standard works by making the CD drive appear, through BIOS
22calls, to be a normal floppy drive. This way you simply put an floppy
23size image (exactly 1440k for a 1.44 meg floppy) somewhere in the
24iso fs. In the headers of the iso fs you place a pointer to this image.
25The BIOS will then grab this image from the CD and for all purposes it
26acts as if it were booting from the floppy drive. This allows a working
27LILO boot disk, for example, to simply be used as is.
28
29It is simple then to make a bootable CD. First create a file, say "boot.img"
30which is an exact image of the boot floppu currently in use. There is
31at least one HOWTO on making bootable floppies. If you have a bootable
32floppy handy, you can make a boot image with the command
33
34dd if=/dev/fd0 of=boot.img bs=10k count=144
35
36assuming the floppy is in the A: drive.
37
38Place this image somewhere in the hierarchy which will be the source
39for the iso9660 filesystem. It is a good idea to put all boot related
40files in their own directory ("boot/" under the root of the iso9660 fs,
41for example), but this is not necessary.
42
43One caveat - Your boot floppy MUST load any initial ramdisk via LILO,
44not the kernel ramdisk driver! This is because once the linux kernel
45starts up, the BIOS emulation of the CD as a floppy disk is circumvented
46and will fail miserably. LILO will load the initial ramdisk using BIOS
47disk calls, so the emulation works as designed.
48
49The "El Torito" specification requires a "boot catalog" to be created as
50ll.
51This is a 2048 byte file which is of no interest except it is required.
52My patches to mkisofs will cause it to automatically create the
53boot catalog. You must specify where the boot catalog will go in the
54iso9660 filesystem. Usually it is a good idea to put it the same place
55as the boot image, and a name like "boot.catalog" seems appropriate.
56
57
58So we have our boot image in the file "boot.image", and we are going to
59put it in the directory "boot/" under the root of the iso9660 filesystem.
60We will have the boot catalog go in the same directory with the name
61"boot.catalog". The command to create the iso9660 fs in the file
62bootcd.iso is then
63
64mkisofs -b boot/boot.img -c boot/boot.catalog -o bootcd.iso .
65
66The -b option specifies the boot image to be used (note the path is
67relative to the root of the iso9660 disc), and the -c option is
68for the boot catalog file.
69
70Since many BIOS implementations now have problems with larger boot images,
71modern boot implementations use the no emulation boot and load the rest
72of the boot image after Eltorito did load a single 2048 byte sector. Use
73a command line like this to create a modern boot:
74
75mkisofs -V MYVOL -iso-level 4 -R -b boot/grub/stage2_eltorito -no-emul-boot \
76	-boot-load-size 4 -boot-info-table -o myvol.iso thisdir
77
78or even a modern boot and EFI boot support at the same time:
79
80mkisofs -V MYVOL -iso-level 4 -R -b boot/grub/stage2_eltorito -no-emul-boot \
81	-boot-load-size 4 -boot-info-table \
82	-eltorito-alt-boot -eltorito-platform efi -b boot/grub/boot.efi \
83	-no-emul-boot
84	-o myvol.iso thisdir
85
86Depending on the BIOS and on the EFI boot code, the -boot-load-size option
87may also be needed for the EFI boot.
88
89Now burn the CD and its ready to boot!
90
91CAVEATS
92-------
93
94I don't think this will work with multisession CDs.
95
96If your bootable floppy image needs to access the boot floppy, it has
97to do so through BIOS calls. This is because if your O/S tries to talk to
98the floppy directly it will bypass the "floppy emulation" the El Torito spec
99creates through BIOS. For example, under Linux it is possible to
100have an initial RAM disk loaded when the kernel starts up. If you let the
101kernel try to read in the initial RAM disk from floppy, it will fail
102miserably because Linux is not using BIOS calls to access the floppy drive.
103Instead of seeing the floppy image on the CD, Linux will be looking at
104the actually floppy drive.
105
106The solution is to have the initial boot loader, called LILO, load your
107initial RAM disk for you.  LILO uses BIOS calls entirely for these
108operations, so it can grab it from the emulated floppy image.
109
110I don't think making a CD bootable renders it unreadable by non-El Torito
111machines. The El Torito spec uses parts of the iso9660 filesystem which
112were reserved for future use, so no existing code should care what it does.
113
114Mkisofs currently stores identification records in the iso9660 filesystem
115saying that the system is a x86 system. The El Torito spec also allows
116one to write PowerPC or Mac id's instead. If you look at the code in write.c
117you could figure out how to change what is written.
118