[Kindle Fire Android Development] eldarerathis:
Update: For anyone interested in simply USING this, I have started a new thread for the public release of FFF Extended: http://xdaforums.com/showthread.php?t=1615093. I wanted to keep all of this development discussion separate from the release.

I'm going to re-purpose the title a bit to leave this as a general discussion thread (at least for now) since there's still a lot of interesting discussion still taking place.

-----

Please understand the following: This is what I consider a proof-of-concept only. It will probably not be all that useful to most people unless you have your device partitioned the same way mine is (protip: you almost certainly DON'T). Please please PLEASE don't mess with this (for now) unless you understand what you're doing. Thanks!

-----

So as the title and little disclaimer above states, I've got something of a proof-of-concept that I wanted to share in case it proves to be useful for others down the line. What I've basically done is taken FIREFIREFIRE 1.2 (thank you pokey9000!) and modified it a bit so that I can dual boot my Fire.

The way this works is actually pretty simple. FFF1.2 lets you get into recovery by starting up fastboot and listening for 10 seconds for you to press the power button. If you press it then it boots into recovery instead of doing a normal boot.

What this version does is somewhat different: it listens for 5 seconds and starts up fastboot like FFF1.2 does, but when you press the power button it restarts the 5 second countdown and effectively changes the selected boot state. This provides more flexibility because it allows you to "cycle" between boot options instead of just being a one-shot thing.

Here's a (somewhat blurry) video demo to help illustrate how it works:

[YOUTUBE]xV2Jtu3fDSM[/YOUTUBE]

In the video I'm dual booting CM9 (which is on my normal boot partition) and CM7 (which is set up on a "boot2" partition). I know it's really hard to read, but the boot options are "Normal boot", "Recovery", and "Alternate boot". Here's a screenshot:

Before you say anything, I know it's not fancy. The u-boot image needs to fit onto the bootloader partition, and fancy images are simply too big to fit, whereas ones with a lot of solid colors (in this case mostly black) can be compressed much smaller when using RLE. Sorry to all you graphics types out there :D

This is still rough around the edges, but the basic breakdown of what's been changed is:

Fastboot delay is 5 seconds instead of 10

Delay resets to 5 after each button press

Visually indicates what you're selecting to boot

Adds the option to boot from a boot2 partition (in addition to boot and recovery as normal)

Also note, if you decide to try this out: the button still has a slight delay at startup before it will accept input. You can tell when it's ready for input when the LED fades a bit (from bright green to darker green), just like on FFF 1.2 (this is simply unchanged). So don't mash the button right after the screen comes up, because it won't respond. You also may need to press and hold it for just a split second to make sure it registers the press properly. Just a few minor niggles.

The source for this can all be found on my GitHub here: https://github.com/eldarerathis/FIREFIREFIRE-Multiboot-PoC. Fair warning: I'm not really a C guy, I'm a C#/Java guy by trade, so this may not be the prettiest C (it's been a few years). However, I hope that it's easy enough to follow to perhaps be useful in a more friendly dual-boot solution that doesn't involve repartitioning like I did.

Again, this probably needs some more work, but I wanted to share nonetheless. Also, if you really want to you can use this as a bootloader just for getting into recovery. Selecting "Alternate boot" will in theory not really do anything if you try to use it but you don't have a boot2 partition (and you'd simply need to restart your device), so...don't select it from the menu and you're fine. This also boots fine using pokey9000's omap4boot (see it here: http://xdaforums.com/showpost.php?p=19800610&postcount=74) for testing it out.

With that in mind, here's a binary you can play with if you want to, but remember - use at your own risk! Just unzip and flash it with fastboot ('fastboot flash bootloader u-boot.bin') or boot it from omap4boot.

https://github.com/downloads/eldarerathis/FIREFIREFIRE-Multiboot-PoC/kf-multiboot.zip​

I may also make a version that replaces the "Alternate boot" option with something like "Fastboot" so that it will be more useful to the general public for the time being. I was thinking that might be nice so you don't have to worry about catching the fastboot delay from your computer.

Lastly, thanks again to pokey9000 for his FIREFIREFIRE work that this is all built on. Remember where it started people!