User avatar
procount
Posts: 2209
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

NOOBS boot process help

Thu Jun 27, 2013 2:17 pm

I liked the Berryboot concept (for booting into different operating systems).
I loved NOOBS (for installing an operating system and recovering it when it failed).
But what I'd really like is a combination of the two.

From my basic understanding, Berryboot maintains 1 kernel image and changes the Root file system. This is mostly ok, but no good if you need diffferent kernels.
However, NOOBS seems to be able to boot into a different kernel from itself.

I looked into the recovery code and I am intrigued by the "reboot_to_extendedl()" function that calls "::reboot(RB_AUTOBOOT);"

How does this work then?
How does it reboot into a different kernel than the one used to boot NOOBS itself? (i.e. without endlessly booting itself?)
How does it know to boot this kernel from the extended partition number 5 (or whatever)?
And finally (and crucially) Is it possible to select which partition to boot the kernel from, from within the noobs recovery program?

I'm guessing this is done by modification to the boot loader in the GPU, so it is out of the realm of mere mortals, but if a small tweak could be done to allow the selection of the secondary boot partition, it would open up quite a few possibilities.....
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

rdb
Posts: 294
Joined: Mon Jul 16, 2012 3:42 pm

Re: NOOBS boot process help

Thu Jun 27, 2013 3:49 pm

> How does this work then?

NOOBS actually implements a soft reboot which triggers the BCM2835 to read the boot files from a different partition.

> How does it reboot into a different kernel than the one used to boot NOOBS itself? (i.e. without endlessly booting itself?)

Some state is saved in the soft reboot that indicates which partition to read.

> How does it know to boot this kernel from the extended partition number 5 (or whatever)?

See above

> And finally (and crucially) Is it possible to select which partition to boot the kernel from, from within the noobs recovery program?

No. This would require a firmware change.

GitHub is the best place to discuss this - see https://github.com/raspberrypi/noobs/issues?state=open

User avatar
procount
Posts: 2209
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: NOOBS boot process help

Thu Jun 27, 2013 4:22 pm

Thanks Rob,
I initially tried to post a new issue (question) on github, but I got an error 404 - I guess I have to register first.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1551
Joined: Sat Sep 10, 2011 11:43 am

Re: NOOBS boot process help

Thu Jun 27, 2013 4:32 pm

Currently we use two bits in the PM_RSTS register which do not get reset across a watchdog or soft reset...

One of those bits tells the bootcode whether you want to boot up at all (this is used when you do a halt) and the other is used to tell the bootcode to load the start.elf config.txt cmdline.txt from the second partition...

To enable booting from partition N we'd have to implement some other stuff.... But it's relatively simple

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

User avatar
procount
Posts: 2209
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: NOOBS boot process help

Thu Jun 27, 2013 9:06 pm

Gordon - Thanks for the clear explanation.
I have continued this topic on github now I have an account (as suggested by Rob) as issue #71 https://github.com/raspberrypi/noobs/issues/71 which I see you have also responded to.

I suggest interested people continue this thread over there to prevent duplications.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Return to “General discussion”