Note: none of this is terribly important or urgent, and comes down to a safety versus
performance tradeoff - just something I noticed while digging more deeply into 0.3.
Also, my calculations/assumptions may of course be incredibly wrong :)
At the moment MaxBootImageBytes is set to 512, but (at least on my toolchain), the
actual .text size is 492 bytes, so we could fit an extra six instructions in!!!
Ok... so maybe that doesn't matter too much, but if the PingCmd logic is taken out of
the boot loader then it drops down to 436 bytes, which is 19 instructions, and starts
to be the difference between a program fitting and having to start cutting out
functionality.
It looks like PingCmd is used in linktest, so I guess the idea is that you can use it
without needing to load programs? Would it be reasonable to move it out of
the bootloader, now that things have settled?
Similarly, the LoadCmd I think is providing functionality that actually isn't used
anywhere (as far as I can see from grepping). The functionality doesn't work
post-boot (short of not releasing threads), so is it needed? If that is taken out
too, then the bootloader drops to 348 bytes, so that's 41 extra instructions
left.
A few times I've had to shave ~300 bytes off a program to get it to fit, so it's
enough space that it might help. Or allow us to write more bloated programs :)
Note: none of this is terribly important or urgent, and comes down to a safety versus
performance tradeoff - just something I noticed while digging more deeply into 0.3.
Also, my calculations/assumptions may of course be incredibly wrong :)
At the moment MaxBootImageBytes is set to 512, but (at least on my toolchain), the
actual .text size is 492 bytes, so we could fit an extra six instructions in!!!
Ok... so maybe that doesn't matter too much, but if the PingCmd logic is taken out of
the boot loader then it drops down to 436 bytes, which is 19 instructions, and starts
to be the difference between a program fitting and having to start cutting out
functionality.
It looks like PingCmd is used in linktest, so I guess the idea is that you can use it
without needing to load programs? Would it be reasonable to move it out of
the bootloader, now that things have settled?
Similarly, the LoadCmd I think is providing functionality that actually isn't used
anywhere (as far as I can see from grepping). The functionality doesn't work
post-boot (short of not releasing threads), so is it needed? If that is taken out
too, then the bootloader drops to 348 bytes, so that's 41 extra instructions
left.
A few times I've had to shave ~300 bytes off a program to get it to fit, so it's
enough space that it might help. Or allow us to write more bloated programs :)