eltorito.c revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
#include <etherboot.h>
#include <fs.h>
#include <lib.h>
#define DEBUG_THIS DEBUG_ELTORITO
#include <debug.h>
#define ELTORITO_PLATFORM_X86 0
#define ELTORITO_PLATFORM_PPC 1
#define ELTORITO_PLATFORM_MAC 2
#include <bits/eltorito.h>
#ifndef ELTORITO_PLATFORM
#error "ELTORITO_PLATFORM is not defined for this arch"
#endif
/* El Torito boot record at sector 0x11 of bootable CD */
struct boot_record {
};
/* First entry of the catalog */
struct validation_entry {
};
struct default_entry {
#define MEDIA_MASK 0x0f
#define MEDIA_NOEMU 0
#define MEDIA_1200_FD 1
#define MEDIA_1440_FD 2
#define MEDIA_2880_FD 3
#define MEDIA_HD 4
};
/* Find El-Torito boot disk image */
unsigned long *length_p)
{
struct boot_record boot_record;
struct validation_entry *ve;
int i, sum;
struct default_entry *de;
/* We always use 512-byte "soft sector", but
* El-Torito uses 2048-byte CD-ROM sector */
/* Boot Record is at sector 0x11 */
return 0;
if (boot_record.ind != 0
!= 0) {
debug("No El-Torito signature\n");
return PARTITION_UNKNOWN;
}
if (part != 0) {
return 0;
}
return 0;
/* Validate the catalog */
//debug_hexdump(ve, sizeof *ve);
printf("Invalid El Torito boot catalog\n");
return 0;
}
/* All words must sum up to zero */
sum = 0;
for (i = 0; i < sizeof(*ve); i += 2)
sum &= 0xffff;
if (sum != 0) {
printf("El Torito boot catalog verify failed\n");
return 0;
}
/* Platform check is warning only, because we won't directly execute
* the image. Just mounting it should be safe. */
}
debugx("WARNING: Default boot entry is not bootable\n");
}
case MEDIA_NOEMU:
printf("Disc doesn't use boot disk emulation\n");
return 0;
case MEDIA_1200_FD:
break;
case MEDIA_1440_FD:
break;
case MEDIA_2880_FD:
break;
case MEDIA_HD:
/* FIXME: read partition table and return first partition.
* Spec states emulation HD has only one partition and it must
* be the first partition */
printf("Disc uses hard disk emulation - not supported\n");
return 0;
}
return 1;
}