Displaying 5 results from an estimated 5 matches for "lendian_int".
Did you mean:
bendian_int
2012 Feb 15
2
[PATCH] isohybrid: Generate MBR even when in EFI mode
...break;
case 'v':
@@ -581,6 +587,12 @@ initialise_mbr(uint8_t *mbr)
memcpy(mbr, afp_header, sizeof(afp_header));
}
+ if (!entry)
+ entry = 1;
+
+ if (mode & EFI)
+ type = 0;
+
mbr += MBRSIZE; /* offset 432 */
tmp = lendian_int(de_lba * 4);
@@ -633,6 +645,40 @@ initialise_mbr(uint8_t *mbr)
tmp = lendian_int(psize);
memcpy(&mbr[12], &tmp, sizeof(tmp));
}
+ if (i == 2 && (mode & EFI))
+ {
+ mbr[0] = 0x0;
+ mbr[1] = 0xfe;
+...
2011 Aug 05
3
isolinux: Generate GPT and Mac bootable images
...= 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(const uint16_t s)
@@ -236,6 +420,22 @@ lendian_int(const uint32_t s)
return r;
}
+uint64_t
+lendian_64(const uint64_t s)
+{
+ uint64_t r = 1;
+
+ if (*(uint8_t *)&r)
+ return s;
+
+ r = (s & 0x00000000000000FF) << 56 | (s & 0xFF00000000000000) >> 56
+ | (s & 0x000000000000FF00) << 40 | (s & 0x00FF...
2015 Feb 20
0
isohybrid and ISO images whose size is not a multiple of 2048 bytes vs. VirtualBox
>
> Same result as yours.
>
>
> Have a nice day :)
>
> Thomas
>
I was under the impression (apparently the wrong one) that your
pseudo-code was adding 4 cylinders to the first example, from 132 to
136, which would be non-optimal. Since I am not a developer, I believe
you when you say that such jump won't happen :). Perhaps the code will
be more clear to me
2015 Feb 20
2
isohybrid and ISO images whose size is not a multiple of 2048 bytes vs. VirtualBox
Hi,
my proposal is based on a mathematical proof (see mail
before) and yours is correct too. They cannot but match.
Let's inspect your examples:
Ady wrote:
> ISO size: 1'085'736'960 bytes ( > 1GiB)
This are exactly 132 cylinders of 255x63.
132 is divisible by 4. So there is no padding needed.
> Cylinders (1st attempt)=132
> [...]
> 2120580 / 4 = 530145, so
2015 Feb 20
4
isohybrid and ISO images whose size is not a multiple of 2048 bytes vs. VirtualBox
...;
uint8_t *buf = NULL, *bufz = NULL;
- int cylsize = 0, frac = 0;
+ int cylsize = 0, frac = 0, align_factor, align_cylsize;
size_t orig_gpt_size, free_space, gpt_size;
struct iso_primary_descriptor descriptor;
@@ -1058,9 +1058,20 @@ main(int argc, char *argv[])
isosize = lendian_int(descriptor.size) * lendian_short(descriptor.block_size);
free_space = isostat.st_size - isosize;
+ /* Making sure that the resulting image size is divisible by 2048.
+ (Can waste nearly 32 MB. Should be done on user request only.)
+ */
+ if ((head * sector) % 4 == 0)
+...