README
README.eltorito
1 # Id: README.eltorito,v 1.1 2000/10/10 20:40:10 beck Exp
2 What is El Torito?
3 ------------------
4 Simply put, El Torito is a specification that says how a cdrom should
5 be formatted such that you can directly boot from it.
6
7 The "El Torito" spec says that ANY cdrom drive should work (scsi/eide)
8 as long as the BIOS supports El Torito. So far this has only been
9 tested with EIDE drives because none of the scsi controllers that has
10 been tested so far appears to support El Torito. The motherboard
11 definately has to support El Torito. The ones that do let you choose
12 booting from HD, Floppy, Network or CDROM.
13
14 How To Make Bootable CDs
15 ------------------------
16
17 For the x86 platform, many BIOS's have begun to support bootable CDs.
18 The standard my patches for mkisofs is based on is called "El Torito".
19
20 The "El Torito" standard works by making the CD drive appear, through BIOS
21 calls, to be a normal floppy drive. This way you simply put an floppy
22 size image (exactly 1440k for a 1.44 meg floppy) somewhere in the
23 iso fs. In the headers of the iso fs you place a pointer to this image.
24 The BIOS will then grab this image from the CD and for all purposes it
25 acts as if it were booting from the floppy drive. This allows a working
26 LILO boot disk, for example, to simply be used as is.
27
28 It is simple then to make a bootable CD. First create a file, say "boot.img"
29 which is an exact image of the boot floppu currently in use. There is
30 at least one HOWTO on making bootable floppies. If you have a bootable
31 floppy handy, you can make a boot image with the command
32
33 dd if=/dev/fd0 of=boot.img bs=10k count=144
34
35 assuming the floppy is in the A: drive.
36
37 Place this image somewhere in the hierarchy which will be the source
38 for the iso9660 filesystem. It is a good idea to put all boot related
39 files in their own directory ("boot/" under the root of the iso9660 fs,
40 for example), but this is not necessary.
41
42 One caveat - Your boot floppy MUST load any initial ramdisk via LILO,
43 not the kernel ramdisk driver! This is because once the linux kernel
44 starts up, the BIOS emulation of the CD as a floppy disk is circumvented
45 and will fail miserably. LILO will load the initial ramdisk using BIOS
46 disk calls, so the emulation works as designed.
47
48 The "El Torito" specification requires a "boot catalog" to be created as
49 ll.
50 This is a 2048 byte file which is of no interest except it is required.
51 My patches to mkisofs will cause it to automatically create the
52 boot catalog. You must specify where the boot catalog will go in the
53 iso9660 filesystem. Usually it is a good idea to put it the same place
54 as the boot image, and a name like "boot.catalog" seems appropriate.
55
56
57 So we have our boot image in the file "boot.image", and we are going to
58 put it in the directory "boot/" under the root of the iso9660 filesystem.
59 We will have the boot catalog go in the same directory with the name
60 "boot.catalog". The command to create the iso9660 fs in the file
61 bootcd.iso is then
62
63 mkisofs -b boot/boot.imh -c boot/boot.catalog -o bootcd.iso .
64
65 The -b option specifies the boot image to be used (note the path is
66 relative to the root of the iso9660 disc), and the -c option is
67 for the boot catalog file.
68
69 Now burn the CD and its ready to boot!
70
71 CAVEATS
72 -------
73
74 I don't think this will work with multisession CDs.
75
76 If your bootable floppy image needs to access the boot floppy, it has
77 to do so through BIOS calls. This is because if your O/S tries to talk to
78 the floppy directly it will bypass the "floppy emulation" the El Torito spec
79 creates through BIOS. For example, under Linux it is possible to
80 have an initial RAM disk loaded when the kernel starts up. If you let the
81 kernel try to read in the initial RAM disk from floppy, it will fail
82 miserably because Linux is not using BIOS calls to access the floppy drive.
83 Instead of seeing the floppy image on the CD, Linux will be looking at
84 the actually floppy drive.
85
86 The solution is to have the initial boot loader, called LILO, load your
87 initial RAM disk for you. LILO uses BIOS calls entirely for these
88 operations, so it can grab it from the emulated floppy image.
89
90 I don't think making a CD bootable renders it unreadable by non-El Torito
91 machines. The El Torito spec uses parts of the iso9660 filesystem which
92 were reserved for future use, so no existing code should care what it does.
93
94 Mkisofs currently stores identification records in the iso9660 filesystem
95 saying that the system is a x86 system. The El Torito spec also allows
96 one to write PowerPC or Mac id's instead. If you look at the code in write.c
97 you could figure out how to change what is written.
98 README.hfs_boot
1 Making HFS bootable CDs
2
3 It *may* be possible to make the hybrid CD bootable on a Mac. As I do not
4 have easy access to a CD-R (nor a Mac) at the moment, I have not actually
5 created and written a bootable hybrid to CD - however, I *think* it will work!
6
7 A bootable HFS CD requires an Apple CD-ROM (or compatible) driver, a bootable
8 HFS partition and the necessary System, Finder, etc. files.
9
10 A driver can be obtained from any other Mac bootable CD-ROM using the
11 "apple_driver" utility (to make, type "make apple_driver"). This file can
12 then be used with the -boot-hfs-file option. See below for usage.
13
14 The HFS partition (i.e. the hybrid disk in our case) must contain a
15 suitable System Folder, again from another CD-ROM or disk.
16
17 For a partition to be bootable, it must have it's "boot block" set. The boot
18 block is in the first two blocks of a partition. For a non-bootable partition
19 the boot block is full of zeros. Normally, when a System file is copied to
20 partition on a Mac disk, the boot block is filled with a number of required
21 settings - unfortunately I don't know the full spec for the boot block ...
22
23 I'm guessing that this will work OK ...
24
25 Therefore, the utility "apple_driver" also extracts the boot block from the
26 first HFS partition it finds on the given CD-ROM and this is used for the
27 HFS partition created by mkhybrid.
28
29 To extract the driver and boot block:
30
31 apple_driver CDROM_device > HFS_driver_file
32
33 where CDROM_device is the device name used by the CD-ROM (e.g. /dev/cdrom)
34
35 The format of the HFS driver file is:
36
37 HFS CD Label Block 512 bytes
38 Driver Partition Map (for 2048 byte blocks) 512 bytes
39 Driver Partition Map (for 512 byte blocks) 512 bytes
40 Empty 512 bytes
41 Driver Partition N x 2048 bytes
42 HFS Partition Boot Block 1024 bytes
43
44 The Perl script "hdisk.pl" can be used to give a listing of what's on
45 a Mac CD. hdisk.pl is part of hfsutils.
46
47 A hybrid CD is made using the option "-boot-hfs-file" e.g.
48
49 mkhybrid -boot-hfs-file HFS_driver_file -o hfs.raw src_files/
50
51 The -boot-hfs-file implies the -hfs option.
52
53 PLEASE NOTE:
54
55 By using a driver from an Apple CD and copying Apple software to your CD,
56 you become liable to obey Apple Computer, Inc. Software License Agreements.
57
58 The driver code (both extracting the driver and creating partitions etc.
59 is based on code from "mkisofs 1.05 PLUS" by Andy Polyakov
60 <appro (a] fy.chalmers.se> (see http://fy.chalmers.se/~appro/mkisofs_plus.html)
61
62
63 Any comments, bug reports/fixes to the address below
64
65 James Pearson (j.pearson (a] ge.ucl.ac.uk)
66 18/5/98
67
README.hfs_magic
1
2 Find file types by using a modified "magic" file
3
4 Based on file v3.22 by Ian F. Darwin (see libfile/LEGAL.NOTICE and
5 libfile/README.dist - File v3.22 can be found at many archive sites)
6
7 For each entry in the magic file, the "message" for the initial offset MUST
8 be 4 characters for the CREATOR and 4 characters for the TYPE - white space is
9 optional between them. Any other characters on this line are ignored.
10 Continuation lines (starting with a '>') are also ignored i.e. only the initial
11 offset lines are used.
12
13 e.g magic entry for a GIF file:
14
15 # off type test message
16 #
17 # GIF image
18 0 string GIF8 8BIM GIFf
19 >4 string 7a \b, version 8%s,
20 >4 string 9a \b, version 8%s,
21 >6 leshort >0 %hd x
22 >8 leshort >0 %hd,
23 #>10 byte &0x80 color mapped,
24 #>10 byte&0x07 =0x00 2 colors
25 #>10 byte&0x07 =0x01 4 colors
26 #>10 byte&0x07 =0x02 8 colors
27 #>10 byte&0x07 =0x03 16 colors
28 #>10 byte&0x07 =0x04 32 colors
29 #>10 byte&0x07 =0x05 64 colors
30 #>10 byte&0x07 =0x06 128 colors
31 #>10 byte&0x07 =0x07 256 colors
32
33 Just the "8BIM" "GIFf" will be used whatever the type of GIF file it is.
34 The continuation lines are used by the "file" command, but ignored by
35 mkhybrid. They could be left out completely.
36
37 The complete format of the magic file is given in the magic man page (magic.5).
38
39 See the file "magic" for other examples
40
41 Use with the -magic magic_file option, where magic_file is a file
42 described above.
43
44 The magic file can be used with the mapping file (option -map) - the order
45 these options appear on the command line is important. mkhybrid will try to
46 detect if the file is one of the Unix/Mac files (e.g. a CAP or Netatalk
47 file) first. If that fails, it will then use the magic and/or mapping
48 file e.g:
49
50 mkhybrid -o output.raw -map mapping -magic magic src_dir
51
52 The above will check filename extensions first, if that fails to set the
53 CREATOR/TYPE, the magic file will be used. To check the magic file
54 before the filename extensions, use:
55
56 mkhybrid -o output.raw -magic magic -map mapping src_dir
57
58
59 Using just a magic file - filename extensions will not be checked e.g:
60
61 mkhybrid -o output.raw -magic magic src_dir
62
63 For the magic method to work, each file must be opened and read twice
64 (once to find it's CREATOR/TYPE, and a second time to actually copy the
65 file to the CD image). Therefore the -magic option may significantly
66 increase processing time.
67
68 If a file's CREATOR/TYPE is not set via the magic and mapping matches,
69 then the file is given the default CREATOR/TYPE.
70
README.mkhybrid
1
2 mkhybrid v1.12b5.1 - make ISO9660/HFS shared hybrid CD volume
3
4 HFS hybrid code Copyright (C) James Pearson 1997, 1998, 1999
5 libhfs code Copyright (C) 1996, 1997 Robert Leslie
6 libfile code Copyright (c) Ian F. Darwin 1986, 1987, 1989,
7 1990, 1991, 1992, 1994, 1995
8 mkisofs code Copyright 1993 Yggdrasil Computing, Incorporated
9
10 WARNING - this is Beta release code - please use with care!
11 If you find a bug, please report it to the address given below.
12
13 This code is based on a Beta release of mkisofs, so there may be
14 problems unrelated to my additions. However, I have found mkisofs
15 v1.12b5 to be very stable.
16
17 However, many people are using v1.12, so although it's called a "beta"
18 release, I would encourage people to use it ...
19 Most of the HFS features work fine, however, some are not fully tested.
20 These are marked as "Alpha" in the man page.
21
22 Please read the man page (mkhybrid.8, or mkhybrid_man.html) for information
23 on how to use mkhybrid.
24
25 Also see "ChangeLog.mkhybrid" for any minor changes/bug fixes
26
27 DESCRIPTION
28
29 mkhybrid is a pre-mastering utility that creates ISO9660/ROCKRIDGE/JOLIET/HFS
30 hybrid CDROM images. You will have to use some other CD-R package to write
31 the image to a CD.
32
33 INSTALLATION
34
35 To make/install, type "./configure", make any changes to the Makefile
36 and type "make"
37
38 This has been tested with gcc on SunOS 4.1.3 (see below), gcc on Linux
39 (Redhat v5.1), cc on IRIX 5.3/6.2 and gcc on Win95/WinNT4 using Cygnus'
40 cygwin (see README.win32)
41
42 If you are using SunOS 4.1.[34], then you need the following patches
43 to read CDs with associated files:
44
45 SunOS 4.1.3: Patch 101832-05
46 SunOS 4.1.3_U1: Patch 101833-02
47 SunOS 4.1.4: Patch 102583-02
48
49
50 EXAMPLES
51
52 To create a HFS hybrid CD with the Joliet and Rock Ridge extensions or
53 the source directory cd_dir:
54
55 % mkhybrid -o cd.iso -r -J -hfs cd_dir
56
57 To create a HFS hybrid CD from the source directory cd_dir that contains
58 Netatalk Apple/Unix files:
59
60 % mkhybrid -o cd.iso --netatalk cd_dir
61
62 To create a HFS hybrid CD from the source directory cd_dir, giving all files
63 CREATOR and TYPES based on just their filename extensions listed in the file
64 "mapping".:
65
66 % mkhybrid -o cd.iso -no-mac-files -map mapping cd_dir
67
68 To create a CD with the 'Apple Extensions to ISO9660', from the source
69 direcories cd_dir and another_dir. Files in all the known Apple/Unix format
70 are decoded and any other files are given CREATOR and TYPE based on their
71 magic number given in the file "magic":
72
73 % mkhybird -o cd.iso -magic -apple cd_dir another_dir
74
75 The following example puts different files on the CD that all have
76 the name README, but have different contents when seen as a
77 ISO9660/RockRidge Joliet or HFS CD.
78
79 Current directory contains
80
81 % ls -F
82 README.hfs README.joliet README.unix cd_dir/
83
84 The following command puts the contents of the directory "cd_dir" on the
85 CD along with the three README files - but only one will be seen from
86 each of the three filesystems:
87
88 % mkhybrid -o cd.iso -hfs -J -r \
89 -hide README.hfs -hide README.joliet \
90 -hide-joliet README.hfs -hide-joliet README.unix \
91 -hide-hfs README.joliet -hide-hfs README.unix \
92 README=README.hfs README=README.joliet README=README.unix \
93 cd_dir
94
95 i.e. the file README.hfs will be seen as README on the HFS CD and the
96 other two README files will be hidden. Similarly for the Joliet and
97 ISO9660/RockRidge CD.
98
99 There are probably all sorts of stange results possible with
100 combinations of the hide options ...
101
102
103 Any comments, bug reports/fixes to the address below.
104
105 Please state the version, platform and command line used when submitting
106 a bug report - the output from "-log-file -v" would help.
107
108 James Pearson (j.pearson (a] ge.ucl.ac.uk)
109
README.mkisofs
1 # Id: README.mkisofs,v 1.1 2000/10/10 20:40:11 beck Exp
2 Note:
3
4 This program requires a lot of virtual memory to run since it
5 builds all of the directories in memory. The exact requirements
6 depend upon a lot of things, but for Rock Ridge discs 12Mb would not
7 be unreasonable. Without RockRidge and without the translation
8 tables, the requirements would be considerably less.
9
10 The cdwrite utility is maintained separately from mkisofs by
11 yggdrasil.com. It is enclosed here as a convenience, since the two programs
12 are often useful together.
13
14 *****************************
15 Notes for version 1.12
16
17 Joliet support is now complete. See the -J option.
18
19 The file scanning code is much improved - mkisofs can use multiple
20 sources of input files and merge them together to form the output
21 image. In addition, each source can be grafted at any point in the
22 iso9660 image.
23
24 The image writing code has been cleaned up to make it much easier
25 to add custom extensions.
26
27 The ADD_FILES feature has been removed as it didn't work well,
28 and it was hard to figure out. The recent rearrangements in the
29 file scanning code would tend to solve these issues.
30
31 *****************************
32 Notes for version 1.11
33
34 There is a feature which can be optionally compiled into
35 mkisofs that allows you to merge arbitrary directory trees into the
36 image you are creating. You need to compile with -DADD_FILES for my
37 changes to take effect. Thanks to Ross Biro biro (a] yggdrasil.com.
38
39 *****************************
40 Notes for version 1.10b1
41
42 Big news is that multi-session capability is very close to being
43 done. There is still a missing interface to cdwrite that is
44 used to determine the next writable address and the sector number
45 of the last existing session. Until we get the interface to cdwrite
46 done, this is a beta version.
47
48 Bug involving DST fixed (dates are always calculated, since some
49 files may be DST and other ones would not be).
50
51 Unfortunately the notes on some of the small patches got lost.
52
53 *****************************
54 Notes for version 1.06
55
56 Jan-Piet Mens <jpm (a] mens.de> added support for the '-m' switch. This
57 allows exclusion of shell-style globs from the CDROM.
58 See manual mkisofs.8 for more information.
59
60 *****************************
61 Notes for version 1.05
62
63 Added support for '-r' switch. This is very similar to -R for
64 Rock Ridge, but echos of the development environment are removed
65 (i.e. uid/gid set to 0, and permissions of the files are canonicalized).
66 Useful in applications where a distribution medium is being produced.
67
68 *****************************
69 Notes for version 1.04
70
71 No notes for 1.04.
72
73 *****************************
74 Notes for version 1.03
75
76 No notes for 1.03.
77
78 *****************************
79 Notes for version 1.02.
80
81 Minor bugfixes here and there. Support for compiled in
82 defaults for many of the text fields in the volume header are now
83 present, and there is also support for a file ".mkisofsrc" that can
84 also read settings for these parameters.
85
86 A short script "Configure" was added to allow us to set up special
87 compile options that depend upon the system that we are running on.
88 This should help stamp out the sphaghetti-isms that were starting to grow
89 up in various places in the code.
90
91 You should get more meaningful error messages if you run out of
92 memory.
93
94 *****************************
95 Notes for version 1.1.
96
97 The big news is that SUSP CE entries are now generated for
98 extremely long filenames and symlink names. This virtually guarantees
99 that there is no limit (OK, well, about 600Mb) for file name lengths.
100 I have tested this as well as I can, and it seems to work with linux.
101 This would only be used very rarely I suspect.
102
103 Also, I believe that support for VMS is done. You must be
104 careful, because only Stream-LF and FIxed length record files can be
105 recorded. The rest are rejected with error messages. Perhaps I am
106 being too severe here.
107
108 There is a bugfix in the sorting of entries on the disc - we
109 need to stop comparing once we reach the ';' character.
110
111 There are four new options -z -d -D -l -V. Some of these tell
112 mkisofs to relax some of the iso9660 restrictions, and many systems
113 apparently do not really seem to mind. Use these with caution.
114
115 Some diagnostic programs to scan disc images are in the diag
116 directory. These are not as portable as mkisofs, and may have some
117 bugs. Still they are useful because they can check for bugs that I might
118 have introduced as I add new features.
119
120 *****************************
121 Notes for version 1.0.
122
123 In version 1.0, the date fields in the TF fields were fixed -
124 previously I was storing st_ctime as the file creation time instead of
125 the file attribute change time. Thanks to Peter van der Veen for
126 pointing this out. I have one slight concern with this change,
127 however. The Young Minds software is definitely supplying 3 dates
128 (creation, modification and access), and I would strongly suspect that
129 they are incorrectly putting the file attribute change time in the
130 file creation slot. I would be curious to see how the different RRIP
131 filesystems treat this. Anyway, this is something to keep in the back
132 of your mind.
133
134 The symlink handling was not quite correct in 0.99 - this is
135 now fixed. Only some systems seemed to have been affected by this bug.
136
137 A command line option is now present to allow you to
138 specifically exclude certain files from the distribution.
139
140 The case where you do not have permissions to read a directory
141 is now handled better by mkisofs. The directory that cannot be opened
142 is converted into a zero-length file, and processing continues normally.
143
144 A few portability things have been fixed (hopefully).
145
146
README.session
1 # Id: README.session,v 1.1 2000/10/10 20:40:11 beck Exp
2
3 This release of mkisofs has basic support completed for
4 multiple sessions. However, we still need some interaction
5 between cdrecord and mkisofs for this to work correctly. This is needed as
6 only cdrecord knows the different ways to gather these numbers for all
7 different drives. It may be that future versions of mkisofs will include
8 the needed support for MMC compliant drives.
9
10 There are a few new options to mkisofs to allow for this.
11 The first one is "-M /dev/scd0", and is used so that mkisofs can examine
12 the entirety of the previous image so that it can figure out what additional
13 files need to be written in the new session. Note that there are operating
14 systems that don't allow to read from CD drives with a sector size
15 of 2048 bytes per sector. To use mkisofs on such an operating system, you
16 will need a version of mkisofs that includes the SCSI transport library
17 from cdrecord. Simply use the dev= syntax from cdrecord with -M in
18 such a case. It will tell mkisofs to use the SCSI transport library to
19 read from the CD instead of using the standard read() OS interface.
20
21 There is also a temporary hack in mkisofs in the form of a '-C' option.
22 The -C option takes two numbers as input, which are delimited by commas.
23 For example, you could specify "-C 1000,1020", but you should never just
24 make up numbers to use here. These numbers are determined from cdrecord.
25
26 Note that if you use -C and omit -M, it effectively means that
27 you are writing a new session, starting at a non-zero block number,
28 and you are effectively ignoring all of the previous session contents.
29 When this session is sent to the writer, the new session effectively
30 "erases" the previous session.
31
32 In practice you should be able to do something like:
33
34 mkisofs [other options] -C `cdrecord dev=b,t,l -msinfo` \
35 -M /dev/cdblkdev
36
37 Replace 'b,t,l' by the aproriate numbers for SCSIbus, target and lun
38 of your drive.
39
40 Note: As of the 1.12b5 release, the multi-session technology has
41 matured quite significantly. It is entirely possible that bugs
42 exists, or that further tweaks will be required somewhere along the
43 way to get things working correctly. The data gathering mode of
44 cdrecord has been tested, and I believe it works correctly. Caveat
45 Emptor.
46
47 [Mar 1, 1999].
48
49
README.win32
1 mkhybrid can be compiled on Win9X/NT4 using Cygnus' cygwin
2 available from:
3
4 http://sourceware.cygnus.com/cygwin/
5
6 To build, start a "bash" shell (open a DOS/Command window, cd to the required
7 directory and type "bash"), and type "./configure" and "make"
8
9 A pre-compiled current Win32 binary is available from:
10
11 ftp://ftp.ge.ucl.ac.uk/pub/mkhfs/win32
12
13 To use the pre-compiled binary, extract the files from the Zip archive, put
14 the files cygwin1.dll, mount.exe and mkhybrid.exe in your WINDOWS directory
15 and from a Command/MS-DOS window type mkhybrid for usage (also see
16 mkhybrid_man.html).
17
18 mkhybrid is a Unix command line utility and knows nothing about DOS/WIN.
19 Therefore all directory names are given in Unix format (i.e. use '/' for a
20 directory separator, not '\'). To access files on another disk (i.e.
21 floppy, CDROM and network disk), you need to use the supplied "mount"
22 command e.g.
23
24 mount a: /a
25 mount d: /cdrom
26
27 i.e. files on the floppy disk are accessed as being in directory /a and
28 files on the CDROM are accessed as /cdrom (assuming your CDROM is drive d:)
29 e.g. the following command creates a CD image in the current directory
30 using a source directories on the CDROM drive, a sub-directory and the
31 floppy drive:
32
33 mkhybrid -o hfs.iso -h -J -r /cdrom/subdir dir1 /a
34
35 Please note: Starting with v1.12b5.0 the Win32 executable uses the b20.1
36 version of the cygwin DLL. If you are using an earlier version of mkhybrid,
37 then you will need this DLL as well.
38
39