search for: bendian_int

Displaying 4 results from an estimated 4 matches for "bendian_int".

2014 Jun 22
0
[PATCH 2/6] utils/isohybrid.c: Correct blocking factor in APM partition block counts
...insertions(+), 5 deletions(-) diff --git a/utils/isohybrid.c b/utils/isohybrid.c index c5b4281..7d0864e 100644 --- a/utils/isohybrid.c +++ b/utils/isohybrid.c @@ -842,7 +842,7 @@ initialise_apm(uint8_t *gpt, uint32_t start) part->signature = bendian_short(0x504d); part->map_count = bendian_int(apm_parts); part->start_block = bendian_int(1); - part->block_count = bendian_int(0x10); + part->block_count = bendian_int(4); strcpy(part->name, "Apple"); strcpy(part->type, "Apple_partition_map"); part->data_start = bendian_int(0); @...
2011 Aug 05
3
isolinux: Generate GPT and Mac bootable images
...7,6 +364,33 @@ check_option(int argc, char *argv[]) return optind; } +uint16_t +bendian_short(const uint16_t s) +{ + uint16_t r = 1; + + if (!*(uint8_t *)&r) + return s; + + r = (s & 0x00FF) << 8 | (s & 0xFF00) >> 8; + + return r; +} + + +uint32_t +bendian_int(const uint32_t s) +{ + uint32_t r = 1; + + if (!*(uint8_t *)&r) + return s; + + r = (s & 0x000000FF) << 24 | (s & 0xFF000000) >> 24 + | (s & 0x0000FF00) << 8 | (s & 0x00FF0000) >> 8; + + return r; +} uint16_t lendian_short(co...
2014 Jun 22
16
Announcing a patch series for isohybrid.c
Hi, following will be 6 patch proposals for isohybrid.c 1: Encode GPT partition names as UTF-16LE 2: Correct blocking factor in APM partition block counts 3: Correct end block address of first GPT partition 4: Write GPT backup to the very end of the image 5: Change all fseek(3) to fseeko(3) 6: Introduce option --mbr and make isohybrid.c compilable standalone If the form needs adjustments,
2012 May 06
1
isohybrid.c, problem reports and questions
...ounts in the Apple partitions obviously assume 512 bytes per block, whereas the start block numbers obviously assume 2048 as announced in the APM header. In initialise_apm() i see two occasions where block counts are handled: - This should probably be 4 rather than 0x10: part->block_count = bendian_int(0x10); - These _count variables should probably be divided by 4 before being submitted to bendian_int(): part->block_count = bendian_int(efi_count); part->data_count = bendian_int(efi_count); part->block_count = bendian_int(mac_count); part->data_count = bendian_int(m...