FORUMS
Remove All Ads from XDA

[ADV] Boot menu for the Nook Color [2011-03-19]

248 posts
Thanks Meter: 74
 
By j4mm3r, Senior Member on 21st February 2011, 06:40 AM
Post Reply Email Thread
First a word of thanks to rookie1 for putting this idea in my head and get me cracking on the code. (checkout his thread: [ADV](multi)u-boot v0.1). The idea is to present a boot menu of options to select the boot order for the NC.

I have implemented a set of custom console management functions (see sources below) which can be used to display any text based interface, there is support for Portrait/Landscape orientation and two font sizes are supported (Warning! Large font sizes look extremely ugly so I haven't compiled the binary with large fonts, if anyone needs it PM, me and I can send it to you via email)

Presented here is a compiled version of the u-boot.bin binary which has default font scaling and Portrait mode selected.

Installation
Simply use the u-boot.bin from the zip file attached with the post and follow rookie1's installation instructions from the his post linked above.

Important: Backup the original u-boot.bin in case you need to restore it in the future

Usage
To get to the boot menu, simply press any key within 5 seconds when the prompt appears.

There are two options to select and each one of them has alternatives to chose from:
Quote:

- Boot Device
Select between: eMMC and SD

- Boot Mode
Select between: normal, recovery and alternative

Boot device enables the selection of the boot device. For the NC, there are just two options i.e eMMC (internal) or SD card.

Boot mode allows the selection of the kernel + ramdisk combo, which is then booted off from the selected Boot device:
Quote:

- normal mode: kernel image file is "uImage" and ramdisk file is "uRamDisk"
- recovery mode: kernel image file is "uRecImg" and ramdisk file is "uRecRam"
- alternate mode: kernel image file is "uAltImg" and ramdisk file is "uAltRam"

This allows for the creation of dual boot setups where uAltImg + uAltRam files can be created to support a second OS or maybe overclocked kernels. Follow your favorite method for creating these as I'm not going to expand into the topic of dual boot setups here.

Follow the on-screen key usage guide to navigate the boot menu.

Default Behavior
When no key is pressed and the NC is powered up normally, the boot behavior is to boot into the normal (files: uImage + uRamdisk) found on the boot device, hence:
- When u-boot.bin is installed on the eMMC, the uImage + uRamdisk files are from eMMC
- When u-boot.bin is installed on the SD card, the uImage + uRamdisk files are from SD card.

Setting default Boot Device
A file named "u-boot.device" can be created at the same location where u-boot.bin is installed to control the default boot device. The contents of this file determine the boot device selected at boot.

The value of "0" means SD card and "1" means eMMC. So for example if installing u-boot.bin on the SD card, one wants to set the default boot device to be eMMC instead of the SD card, then the following can setup the u-boot.device file:
Code:
# echo -n "1" > /media/SDCARD/u-boot.device
This is similar to the file u-boot.order as mentioned in rookie1's original post, but it only takes 1 byte instead of 2 in that case.

This is useful in case when you want to lend your nook to your girlfriend and have the stock BN Eclair installed on eMMC and HC on the SD card. This way you can setup u-boot.bin on the SD card along with the u-boot.device file pointing to eMMC and have the NC boot into stock even with the SD card inserted. Whenever you want to boot into HC, simply get into the boot menu and select SD + normal!!



Think of these choices as selecting the appropriate kernel + ramdisk images from either the eMMC (internal memory of the NC) or the SD card. Other exotic options like for example selecting uImage from eMMC and uRamdisk from the SD card are currently not supported.


Files
u-boot.bin_v0.4.zip - contains the u-boot.bin

Sources
(updated with v0.4 changes)
https://github.com/j4mm3r/bn_nc_u-boot/tree/boot_menu

Changelog
v0.4:
Now uses Portrait orientation for display
Implemented custom console functions that support:
Font scaling (default or double size)
Portait/Landscape mode
Added support for Portrait/Landscape mode
Changed keys to suit Portrait orientation

v0.3:
Cleaned up sources, misc fixes
Missed the power key (Press any key?)

v0.2:
Improved lcd console display
Supports alternate boot mode
Supports setting up a default boot device

v0.1:
Initial release

I'm lazy...
Make CWR installable zip (SD and eMMC versions)

A few words of caution: Please don't use this if you don't understand what you are doing and remember all the usual disclaimers and warnings apply here as well.

Furthermore, I target this thread towards developers and advanced users so I have deliberately left out user friendly instructions. Feel free to incorporate it into your own custom ROM/CWR release.


Enjoy!
Attached Thumbnails
Click image for larger version

Name:	u-boot.jpg
Views:	3630
Size:	86.5 KB
ID:	546795  
Attached Files
File Type: zip u-boot_v0.4.bin.zip - [Click for QR Code] (93.2 KB, 2451 views)
The Following 33 Users Say Thank You to j4mm3r For This Useful Post: [ View ] Gift j4mm3r Ad-Free
 
 
21st February 2011, 06:41 AM |#2  
OP Senior Member
Thanks Meter: 74
 
More
reserved
Reserved for future updates
The Following User Says Thank You to j4mm3r For This Useful Post: [ View ] Gift j4mm3r Ad-Free
21st February 2011, 08:07 AM |#3  
Senior Member
Flag Pittsburgh
Thanks Meter: 353
 
Donate to Me
More
This is going right on my nook...
21st February 2011, 01:29 PM |#4  
Senior Member
Thanks Meter: 97
 
More
would it be possible to update this so we could choose the emmc or the media position? what I mean is could this work with dual boot.
21st February 2011, 01:40 PM |#5  
OP Senior Member
Thanks Meter: 74
 
More
Not exactly sure what you mean, this is just the second stage boot loader. AFIAK, hardware limitations allow us to boot only from the eMMC or the SD card.

If you by any chance you meant the location of the /media mount after booting into Android, then I'm afraid that it is not under boot-loader control. Thats the job of init.rc loaded from the ram disk or depends upon the configuration for vold.

Quote:
Originally Posted by Novarider

would it be possible to update this so we could choose the emmc or the media position? what I mean is could this work with dual boot.

21st February 2011, 04:24 PM |#6  
Member
Thanks Meter: 9
 
More
Sorry to waste space, but I had to say THANK YOU! The explanation of what each option boots, made the light bulb come on... I finally understand uRamdisk, uImage, etc.

Thanks! Nice options to have!
21st February 2011, 05:10 PM |#7  
simon.ponder's Avatar
Senior Member
Flag Burlington
Thanks Meter: 21
 
Donate to Me
More
Recovery
This is a great idea that should be worked into a recovery as current recoveries are wiping eMMC when flashing new rom zip. I see some great things with this.
21st February 2011, 11:36 PM |#8  
Senior Member
Bennington, NE
Thanks Meter: 163
 
More
Would it be possible to alter this to allow boot into the "alternate" ROMs allowed by rookie1's dual-boot code? For example, I could set up dual-boot Eclair/Honeycomb on my eMMC using his code, then put CM7 on my SD card (and maybe even Froyo as well?), and choose between them?

Like this:
eMMC Normal
eMMC Alternate
SD Normal
SD Alternate

And you could include the recovery options you listed as well...
22nd February 2011, 12:02 AM |#9  
Senior Member
Thanks Meter: 117
 
More
Quote:
Originally Posted by Socrguru

Would it be possible to alter this to allow boot into the "alternate" ROMs allowed by rookie1's dual-boot code? For example, I could set up dual-boot Eclair/Honeycomb on my eMMC using his code, then put CM7 on my SD card (and maybe even Froyo as well?), and choose between them?

Like this:
eMMC Normal
eMMC Alternate
SD Normal
SD Alternate

And you could include the recovery options you listed as well...

what he said!
22nd February 2011, 01:32 AM |#10  
Senior Member
Thanks Meter: 83
 
More
As I am working on a major document about recovery and restoring procedures, can you please update your OP instructions to include how you would UN-do this feature?

I image just creating backup copy of the uboot.bin, but want to make sure.
22nd February 2011, 02:16 AM |#11  
Member
Thanks Meter: 18
 
More
Quote:
Originally Posted by j4mm3r

First a word of thanks to rookie1 for putting this idea in my head and get me cracking on the code. (checkout his thread: [ADV](multi)u-boot v0.1).

The idea is to present a boot menu of options to select the boot order for the NC.

Installation
Simply use the u-boot.bin from the zip file attached with the post and follow rookie1's installation instructions from the post linked above.

Instructions
To get to the boot menu, press and hold the "n" key while powering on the NC and keep pressing both the "n" key and power key till the words "Entering boot menu..." appear on the screen. Now release both the keys and, the boot menu will present itself.

There are four options to chose from:
- eMMC boot, normal
This boots from the internal eMMC in the normal mode. Which means the that uImage kernel is loaded from the eMMC boot partition and uRamdisk is the ramdisk.

- eMMC boot, recovery
This boots from the internal eMMC into recovery mode. Which means that the uRecImage kernel is loaded from the eMMC boot partition and uRecRam is the ramdisk

- SD boot, normal
This boots from SD card, in the normal mode. uImage and uRamdisk are loaded from the SD card boot partition.

- SD boot, recovery
This boots from the SD card, into recovery mode. uRecImg and uRecRam are loaded from the SD card boot partition.

Vol+/Vol- keys can be used to select between on-screen options.
Pressing the Home key (or the "n" key) then starts the boot process.

Think of these choices as selecting the appropriate kernel + ramdisk images from either the eMMC (internal memory of the NC) or the SD card. Other exotic options like for example selecting uImage from eMMC and uRamdisk from the SD card are currently not supported. Although it should be simple enough to expand the options to include lets say, an alternate normal boot overclocked kernel etc.

I'll post the sources on github very soon, but please feel to follow the patch details included here and expand the possibilities.

Files
u-boot.bin_v0.1.zip - contains the u-boot.bin
boot-menu.txt - source code patch details

Changelog
Initial release

A few words of caution: Please don't use this if you don't understand what you are doing and remember all the usual disclaimers and warnings apply here as well.

Enjoy!


next version, config file just like GRUB? kidding....

great work! U are real man!
Post Reply Subscribe to Thread

Tags
menu, multi-boot, nook color, u-boot

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes