diff options
author | Shao Miller <shao.miller@yrdsb.edu.on.ca> | 2009-08-03 21:45:34 -0400 |
---|---|---|
committer | Shao Miller <shao.miller@yrdsb.edu.on.ca> | 2009-08-03 23:50:20 -0400 |
commit | 3369a18e1a3eae71a8b37bd91cff61dbbe389a2b (patch) | |
tree | fb0db869d0a1a5e1314762c5c4676769840a17a4 /memdisk/eltorito.c | |
parent | 1275c1535315174f355b4bf74e69e572d8b38fc6 (diff) | |
download | syslinux-3369a18e1a3eae71a8b37bd91cff61dbbe389a2b.tar.gz |
[memdisk] Add El Torito emulation for .ISO images
With this patch, users can now boot El Torito-bootable .ISO (CD/DVD) images.
The user should specify "iso" on the kernel command-line.
Diffstat (limited to 'memdisk/eltorito.c')
-rw-r--r-- | memdisk/eltorito.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/memdisk/eltorito.c b/memdisk/eltorito.c new file mode 100644 index 00000000..7e0ba89b --- /dev/null +++ b/memdisk/eltorito.c @@ -0,0 +1,58 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 2009 Shao Miller - All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, Inc., 53 Temple Place Ste 330, + * Boston MA 02111-1307, USA; either version 2 of the License, or + * (at your option) any later version; incorporated herein by reference. + * + * ----------------------------------------------------------------------- */ + +/* + * eltorito.c + * + * EDD-4 El Torito structures and debugging routines + */ + +#include <stdint.h> +#include "memdisk.h" +#include "conio.h" +#include "eltorito.h" + +#ifdef DBG_ELTORITO +void eltorito_dump(uint32_t image) +{ + printf("-- El Torito dump --\n", image); + + /* BVD starts at sector 17. */ + struct edd4_bvd *bvd = (struct edd4_bvd *)(image + 17 * 2048); + + printf("bvd.boot_rec_ind: 0x%02x\n", bvd->boot_rec_ind); + printf("bvd.iso9660_id: %c%c%c%c%c\n", bvd->iso9660_id[0], + bvd->iso9660_id[1], bvd->iso9660_id[2], bvd->iso9660_id[3], + bvd->iso9660_id[4]); + printf("bvd.ver: 0x%02x\n", bvd->ver); + printf("bvd.eltorito: %s\n", bvd->eltorito); + printf("bvd.boot_cat: 0x%08x\n", bvd->boot_cat); + + struct edd4_bootcat *boot_cat = + (struct edd4_bootcat *)(image + bvd->boot_cat * 2048); + + printf("boot_cat.validation_entry\n"); + printf(" .header_id: 0x%02x\n", boot_cat->validation_entry.header_id); + printf(" .platform_id: 0x%02x\n", boot_cat->validation_entry.platform_id); + printf(" .id_string: %s\n", boot_cat->validation_entry.id_string); + printf(" .checksum: 0x%04x\n", boot_cat->validation_entry.checksum); + printf(" .key55: 0x%02x\n", boot_cat->validation_entry.key55); + printf(" .keyAA: 0x%02x\n", boot_cat->validation_entry.keyAA); + printf("boot_cat.initial_entry\n"); + printf(" .header_id: 0x%02x\n", boot_cat->initial_entry.header_id); + printf(" .media_type: 0x%02x\n", boot_cat->initial_entry.media_type); + printf(" .load_seg: 0x%04x\n", boot_cat->initial_entry.load_seg); + printf(" .system_type: 0x%02x\n", boot_cat->initial_entry.system_type); + printf(" .sect_count: %d\n", boot_cat->initial_entry.sect_count); + printf(" .load_block: 0x%08x\n", boot_cat->initial_entry.load_block); +} +#endif |