"Fossies" - the Fresh Open Source Software Archive

Member "xorriso-1.5.4/doc/zisofs_format.txt" (30 Jan 2021, 6064 Bytes) of package /linux/misc/xorriso-1.5.4.pl02.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 
    2                         Description of the zisofs Format
    3 
    4                    as of zisofs-tools-1.0.8 by H. Peter Anvin
    5                    and cdrtools-2.01.01a39 by Joerg Schilling
    6  
    7        For libburnia-project.org by Thomas Schmitt <scdbackup@gmx.net>
    8        - distribute freely , please report any errors or ambiguities -
    9 
   10                                 Apr 11 2009
   11 
   12 
   13 The zisofs format was invented by H. Peter Anvin. It compresses data file
   14 content, marks it by a header and provides a pointer array for coarse random
   15 access. Within a RRIP enhanced ISO 9660 image the format is additionally marked
   16 by a System Use entry with signature "ZF".
   17 
   18 The uncompressed size of a single zisofs compressed file is restricted
   19 to 4 GiB - 1. Larger files shall not be compressed.
   20 
   21 
   22                                 File Header
   23 
   24 The file header has this layout (quoted from zisofs-tools-1.0.8/mkzftree.c):
   25     Byte offset   iso9660 type    Contents
   26       0           (8 bytes)       Magic number (37 E4 53 96 C9 DB D6 07)
   27       8           7.3.1           Uncompressed file size
   28      12           7.1.1           header_size >> 2 (currently 4)
   29      13           7.1.1           log2(block_size)
   30      14           (2 bytes)       Reserved, must be zero
   31 So its size is 16.
   32 7.3.1 means little endian 4-byte words. 7.1.1. means unsigned single bytes.
   33 
   34 Readers shall be able to handle log2(block_size) values 15, 16 and 17
   35 i.e. block sizes 32 kB, 64 kB, and 128 kB. Writers must not use other sizes.
   36 
   37 
   38                                Block Pointers
   39 
   40 There are ceil(input_size / block_size) input and output blocks.
   41 Each input block is of fixed size whereas the output blocks have varying
   42 size (down to 0). For each output block there is an offset pointer giving
   43 its byte address in the overall file content. The next block pointer in the
   44 array tells the start of the next block which begins immediately after the
   45 end of its predecessor. A final pointer gives the first invalid byte address
   46 and thus marks the end of the last block.
   47 
   48 So there are ceil(input_size / block_size) + 1 block pointers.
   49 They are stored as an array of 4-byte values which are in ISO 9660:7.3.1 format
   50 directly after the file header, i.e. beginning at byte 16.
   51 
   52 
   53                                  Data Part
   54 
   55 The data part begins immediately after the pointer array. In principle it
   56 consists of the variable length output blocks as delivered by zlib function
   57 compress2() when fed with the fixed size input blocks.
   58 
   59 A special case of input and output block is defined:
   60 Zero-length blocks represent a block full of 0-bytes.
   61 Such input blocks do not get processed by compress2() but shall be mapped to
   62 0-sized output directly. Vice versa 0-sized blocks have to bypass uncompress()
   63 when being read.
   64 
   65 
   66                          ZF System Use Entry Format
   67 
   68 ZF may only be applied to files with a single extent and less than 4 GiB of
   69 uncompressed size.
   70 
   71 The ZF entry follows the general layout of SUSP and RRIP.
   72 Its fields are:
   73 
   74   [1] "BP 1 to BP 2 - Signature Word" shall be (5A)(46) ("ZF").
   75 
   76   [2] "BP 3 - Length" shall specify as an 8-bit number the length in bytes of
   77       the ZF entry recorded according to ISO 9660:7.1.1.
   78       This length is 16 decimal.
   79 
   80   [3] "BP 4 - System Use Entry Version" shall be 1 as in ISO 9660:7.1.1.
   81 
   82   [4] "BP 5 to BP 6 - Algorithm"  shall be (70)(7A) ("pz") to indicate 
   83       "paged zlib".
   84 
   85   [5] "BP 7 - Header Size Div 4" shall specify as an 8-bit number the number of
   86       4-byte words in the header part of the file data recorded according
   87       to ISO 9660:7.1.1.
   88       (This is a copy of header byte 12 / BP 13).
   89 
   90   [6] "BP 8 - Log2 of Block Size" shall specify as an 8-bit number the binary
   91       logarithm of the compression block size recorded according to
   92       ISO 9660:7.1.1.
   93       (This is a copy of header byte 13 / BP 14.
   94        The value has to be 15, 16 or 17 i.e. 32 kiB, 64 kiB, or 128 kiB.)
   95 
   96   [7] "BP 9 to BP 16 - Uncompressed Size" shall tell the number of uncompressed
   97       bytes represented by the given extent. This field shall be recorded
   98       according to ISO 9660:7.3.3.
   99       (This number is the same as in header bytes 8 to 11 / BP 9 to BP 12.)
  100 
  101   | 'Z' | 'F' | LENGTH | 1 | 'p' | 'z' | HEADER SIZE DIV 4 | LOG2 BLOCK SIZE
  102   | UNCOMPRESSED SIZE |
  103 
  104 ISO 9660:7.3.3 means 4-byte word in both byte orders, first little endian, then
  105 big endian.
  106 Example (block size 32 kiB, uncompressed file size = 1,234,567 bytes):
  107   { 'Z',  "F',   16,    1,  'p',  'z',    4,   15,
  108    0x87, 0xD6, 0x12, 0x00, 0x00, 0x12, 0xD6, 0x87 }
  109 
  110 
  111 -------------------------------------------------------------------------------
  112 Revoked specification aspects:
  113 
  114 A comment in zisofs-tools-1.0.8 indicates a special case of output block:
  115   "a block the length of which is equal to the block size is unencoded."
  116 This is not implemented in zisofs-tools and in the Linux kernel. Existing
  117 zisofs enhanced ISO images might contain encoded blocks which could be
  118 mistaken for unencoded blocks.
  119 Therefore this rule is not part of this description and must not be
  120 implemented.
  121 
  122 -------------------------------------------------------------------------------
  123 References:
  124 
  125 zisofs-tools
  126   http://freshmeat.net/projects/zisofs-tools/
  127 
  128 zlib:
  129   /usr/include/zlib.h
  130 
  131 cdrtools with mkisofs
  132   ftp://ftp.berlios.de/pub/cdrecord/alpha
  133 
  134 ECMA-119 aka ISO 9660
  135   http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-119.pdf
  136 
  137 SUSP 1.12
  138   ftp://ftp.ymi.com/pub/rockridge/susp112.ps
  139 
  140 RRIP 1.12
  141   ftp://ftp.ymi.com/pub/rockridge/rrip112.ps
  142 
  143 -------------------------------------------------------------------------------
  144 
  145 This text is under
  146 Copyright (c) 2009 - 2010 Thomas Schmitt <scdbackup@gmx.net>
  147 It shall reflect the effective technical specifications as implemented in
  148 zisofs-tools and the Linux kernel. So please contact mailing list
  149 <libburn-hackers@pykix.org> or to the copyright holder in private, if you
  150 want to make changes.
  151 Only if you cannot reach the copyright holder for at least one month it is
  152 permissible to modify and distribute this text under the license "BSD revised".
  153