Home | History | Annotate | Download | only in memdisk
      1 /* ----------------------------------------------------------------------- *
      2  *
      3  *   Copyright 2009-2010 Shao Miller - All Rights Reserved
      4  *
      5  *   This program is free software; you can redistribute it and/or modify
      6  *   it under the terms of the GNU General Public License as published by
      7  *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
      8  *   Boston MA 02111-1307, USA; either version 2 of the License, or
      9  *   (at your option) any later version; incorporated herein by reference.
     10  *
     11  * ----------------------------------------------------------------------- */
     12 
     13 /*
     14  * eltorito.h
     15  *
     16  * EDD-4 El Torito structures and debugging routines
     17  */
     18 
     19 #include <stdint.h>
     20 #include "compiler.h"
     21 
     22 /* EDD-4 Bootable Optical Disc Drive Boot Volume Descriptor */
     23 MEMDISK_PACKED_PREFIX
     24 struct edd4_bvd {
     25     uint8_t boot_rec_ind;	/* Boot Record Indicator */
     26     uint8_t iso9660_id[5];	/* ISO9660 ID            */
     27     uint8_t ver;		/* Descriptor Version    */
     28     uint8_t eltorito[32];	/* "EL TORITO" etc.      */
     29     uint8_t res1[32];		/* Reserved              */
     30     uint32_t boot_cat;		/* Boot catalog sector   */
     31     uint8_t res2[1973];		/* Reserved              */
     32 } MEMDISK_PACKED_POSTFIX;
     33 
     34 MEMDISK_PACKED_PREFIX
     35 struct validation_entry {
     36     uint8_t header_id;		/* Header ID                      */
     37     uint8_t platform_id;	/* Platform ID                    */
     38     uint16_t res1;		/* Reserved                       */
     39     uint8_t id_string[24];	/* Manufacturer                   */
     40     uint16_t checksum;		/* Sums with whole record to zero */
     41     uint8_t key55;		/* Key byte 0x55                  */
     42     uint8_t keyAA;		/* Key byte 0xAA                  */
     43 } MEMDISK_PACKED_POSTFIX;
     44 
     45 MEMDISK_PACKED_PREFIX
     46 struct initial_entry {
     47     uint8_t header_id;		/* Header ID                */
     48     uint8_t media_type;		/* Media type               */
     49     uint16_t load_seg;		/* Load segment             */
     50     uint8_t system_type;	/* (Filesystem ID)          */
     51     uint8_t res1;		/* Reserved                 */
     52     uint16_t sect_count;	/* Emulated sectors to load */
     53     uint32_t load_block;	/* Starting sector of image */
     54     uint8_t res2[4];		/* Reserved                 */
     55 } MEMDISK_PACKED_POSTFIX;
     56 
     57 /* EDD-4 Bootable Optical Disc Drive Boot Catalog (fixed-size portions) */
     58 MEMDISK_PACKED_PREFIX
     59 struct edd4_bootcat {
     60     struct validation_entry validation_entry;
     61     struct initial_entry initial_entry;
     62 } MEMDISK_PACKED_POSTFIX;
     63 
     64 /* EDD-4 CD Specification Packet */
     65 MEMDISK_PACKED_PREFIX
     66 struct edd4_cd_pkt {
     67     uint8_t size;		/* Packet size                     */
     68     uint8_t type;		/* Boot media type (flags)         */
     69     uint8_t driveno;		/* INT 13h drive number            */
     70     uint8_t controller;		/* Controller index                */
     71     uint32_t start;		/* Starting LBA of image           */
     72     uint16_t devno;		/* Device number                   */
     73     uint16_t userbuf;		/* User buffer segment             */
     74     uint16_t load_seg;		/* Load segment                    */
     75     uint16_t sect_count;	/* Emulated sectors to load        */
     76     uint8_t geom1;		/* Cylinders bits 0 thru 7         */
     77     uint8_t geom2;		/* Sects/track 0 thru 5, cyls 8, 9 */
     78     uint8_t geom3;		/* Heads                           */
     79 } MEMDISK_PACKED_POSTFIX;
     80 
     81