#include "roast/lexical/string_rule.hpp"
#include "roast/math/endian.hpp"
+#define ROAST_SECTOR_NO_BRVD (17) // Boot Record Volume Descriptor
+
namespace roast
{
namespace iso9660
ROAST_LEXICAL_FIXSTR(str_CD001, "CD001")
ROAST_LEXICAL_FIXSTR(str_ELTORITOSPEC, "EL TORITO SPECIFICATION") // 23byte
+ enum
+ {
+ _boot_catalog_sector_no = 18,
+ _boot_sector_no = 19
+ };
+
// Zero Padding Sector
typedef soft_repeat< unibyte<0>, 2048 > zero_padding_sector;
- // _volume_desc
+
+ // Boot Record Volume Descriptor Sector
typedef seq<
unibyte<0>, // Volume Descriptor Type
str_CD001,
soft_repeat< unibyte<0>, 9 + 32 >,
// [El Torito Only] Boot Record Volume Descriptor
- fixed_uint< fixed_little_endian<unsigned int, 18>::value >, // Boot Record Volume is No.18 Sector
+ fixed_uint< fixed_little_endian<unsigned int, _boot_catalog_sector_no>::value >, // Boot Record Volume is No.18 Sector
// Zero Padding Sector Rest
soft_repeat< unibyte<0>, 2048 - 0x4B >
- > _volume_desc;
+ > brvd_sector;
+
- // Boot Record Volume Descriptor
+ // Boot Catalog Sector
typedef seq<
unibyte<1>, // Volume Descriptor Type -> 1(PVD)
unibyte<0>, // 0:80x86
// 3: 2.88MB FDD Emulate,
// 4: HDD Emulate
- fixed_ushort< 0x0000 >, // Read Segment: 0 is Default (0x07c0)
- fixed_ushort< 0x0001 >, // Boost Sector Count
- fixed_uint<20>, // Boost Sector No.
+ fixed_ushort< 0x0000 >, // Read Segment: 0 is Default (0x07c0)
+ fixed_ushort< 0x0001 >, // Boot Sector Count
+ fixed_uint<_boot_sector_no>, // Boot Sector No.
// Zero Padding Sector Rest
soft_repeat< unibyte<0>, 2048 - 0x2B >
- > _boot_record_volume_desc;
+ > boot_catalog_sector;
// rule
typedef seq<
- soft_repeat< zero_padding_sector, 17 >, // Zero Padding 17 Sectors
- _volume_desc,
- _boot_record_volume_desc
+ soft_repeat< zero_padding_sector, ROAST_SECTOR_NO_BRVD >, // Zero Padding 17 Sectors
+ brvd_sector,
+ boot_catalog_sector
> rule;
>>>>>>> 63d7ba7... eltorito.hpp: とりあえず「Boot Record Volume Descriptor」の手前まで
}