[ipxe-devel] [PATCH] Format HTTP Range with unsigned long long

Michael Brown mcb30 at ipxe.org
Thu May 25 10:33:45 UTC 2017


On 24/05/17 17:42, Linus Lüssing wrote:
> On Wed, May 24, 2017 at 04:29:23PM +0100, Michael Brown wrote:
>> We could plausibly extend format_decimal() to handle unsigned longs (%lu or
>> %zu) by factoring out the negation code.  This would probably be a smaller
>> overall size impact than dragging in the 64-bit division code.
> 
> So, hm, this would increase the maximum image size for sanboot/http from
> 2GB (2^31) to 4GB (2^32) for 32bit builds?

Correct.

> What size impact are we roughly talking about for the 64-bit
> division code? Would it be possible to make this a configurable build
> option?

Approximately an extra 426 bytes (uncompressed).

It can't sensibly be made a configurable build option; I try hard to 
avoid #ifdef spaghetti and this would definitely fall into that category.

> PS: I was testing with the image produced via a "make
> bin/undionly.kpxe" on an amd64 based system (an AMD Sempron,
> 8GB RAM). undionly.kpxe is always a 32bit build, right? So an
> unsigned long would not be sufficient for me for images larger
> than 4GB, even though my system architecture is 64bit, would it?

The "bin/" is implicitly "bin-i386-pcbios/".  You can also try

   make bin-x86_64-pcbios/undionly.kpxe

which will give you a 64-bit version of iPXE, incorporating the code 
needed to set up page tables, switch to long mode, etc.  In this build, 
even the existing signed long should work for your use case.

Michael





More information about the ipxe-devel mailing list