enpboss
Posts: 7
Joined: Thu Dec 18, 2014 5:34 am

Fast boot raspberry pi

Tue Dec 23, 2014 1:29 pm

How to boot the raspberry pi quickly.
i am not getting the correct solution.

shuckle
Posts: 565
Joined: Sun Aug 26, 2012 11:49 am
Location: Finland

Re: Fast boot raspberry pi

Tue Dec 23, 2014 1:48 pm

What is quickly?
1minute? 1 second?

User avatar
DougieLawson
Posts: 37069
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Fast boot raspberry pi

Tue Dec 23, 2014 1:49 pm

How quickly is quickly?
What services do you expect to be active to consider that your RPi has booted?
Is this running as a server, as a controller for a robot or as a desktop machine?

Have you looked at raspbian-ua-netinst to get Raspbian running in a very minimal configuration?
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24922
Joined: Sat Jul 30, 2011 7:41 pm

Re: Fast boot raspberry pi

Tue Dec 23, 2014 1:50 pm

How fast do you need to boot, and what can you afford to not have running once booted? Generally removing stuff start needs to start up improves boottime. I think someone has got a Pi to boot Linux in 4s by removing lots of stuff.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

enpboss
Posts: 7
Joined: Thu Dec 18, 2014 5:34 am

Re: Fast boot raspberry pi

Tue Dec 23, 2014 1:53 pm

I need to boot in 30 sec, it contains web service and java program.

shuckle
Posts: 565
Joined: Sun Aug 26, 2012 11:49 am
Location: Finland

Re: Fast boot raspberry pi

Tue Dec 23, 2014 6:37 pm

How long does it take now then?
My pi is very close tp 30 secs without tuning.

enpboss
Posts: 7
Joined: Thu Dec 18, 2014 5:34 am

Re: Fast boot raspberry pi

Wed Dec 24, 2014 4:15 am

shuckle wrote:How long does it take now then?
My pi is very close tp 30 secs without tuning.

it takes 56 seconds.

User avatar
DougieLawson
Posts: 37069
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Fast boot raspberry pi

Wed Dec 24, 2014 10:18 am

enpboss wrote:I need to boot in 30 sec, it contains web service and java program.
Forget getting it running fast as soon as you say "Java".
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: Fast boot raspberry pi

Wed Dec 24, 2014 11:54 am

If you need a fast boot get a Beaglebone black. It boots in about 10 seconds.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

hippy
Posts: 6687
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Fast boot raspberry pi

Wed Dec 24, 2014 8:43 pm

Richard-TX wrote:If you need a fast boot get a Beaglebone black. It boots in about 10 seconds.
Or just do on the Pi whatever is done to achieve that. If jamesh's recollection is correct then equally fast boot up times on a Pi should be possible but it does depend on exactly what the boot process needs to do.

I think, on balance, it would be better to do that, stay with the Pi, benefit the Pi community while retaining their help in achieving that goal, than going to a different board and losing the help the Pi community can offer.

jbowler
Posts: 70
Joined: Sun Jul 13, 2014 8:02 pm

Re: Fast boot raspberry pi

Sun Jan 18, 2015 6:30 am

Running a systemd system I get to the point the kernel starts to run user mode processes in about 2.5 seconds, but I think that's misleading because the kernel is still running its bootstrap. On the same kernel (3.18.3) with OpenRC I get to the magic "Freeing unused kernel memory" at 5.5seconds. (That happens at 3.3s on the systemd system.)

Both the test systems are overclocked:

arm_freq=1000
core_freq=500
sdram_freq=500
over_voltage=6

It you need faster than 2.5s to running user mode programs then I think I can be pretty sure you need something other than Linux. RISC OS is a probable solution.

If you are OK with 5s then you can probably make things work by tuning what happens in both the initrd (if you chose to use one) and whatever it exec's. In principle you can build a very high performance, very robust, system using just busybox and whatever you need in hand-crafted programs.

John Bowler

mikerr
Posts: 2804
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Fast boot raspberry pi

Sun Jan 18, 2015 9:30 am

Richard-TX wrote:If you need a fast boot get a Beaglebone black. It boots in about 10 seconds.
I have 7 seconds with a fairly stock archlinux on pi.

I use it with the raspicam camera, so that 7 seconds is from rainbow boot to end of startup ( and first picture taken)
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
r3d4
Posts: 978
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: Fast boot raspberry pi

Sun Jan 18, 2015 3:17 pm

mahjongg wrote:The "fastest booting OS" is the one that spends the least time transferring data from the card into memory, running the least amount of code to "boot", and spending the least amount of time initializing sub-systems. its as simple as that.
http://www.raspberrypi.org/forums/viewt ... 80#p657429

jbowler
Posts: 70
Joined: Sun Jul 13, 2014 8:02 pm

Re: Fast boot raspberry pi

Mon Jan 19, 2015 1:38 am

r3d4 wrote:
mahjongg wrote:The "fastest booting OS" is the one that spends the least time transferring data from the card into memory, running the least amount of code to "boot", and spending the least amount of time initializing sub-systems. its as simple as that.
http://www.raspberrypi.org/forums/viewt ... 80#p657429
Well, indeed, the fastest booting OS is the fastest booting OS.

Next.

jbowler
Posts: 70
Joined: Sun Jul 13, 2014 8:02 pm

Re: Fast boot raspberry pi

Mon Jan 19, 2015 2:58 am

To be slightly more constructive:

The original UNIX kernel required that everything you wanted to do with the hardware be there right at the start, and it has to be initialized right at the start too.

The current Linux kernel does this as well, unless you use systemd, however the 'generic' kernel doesn't require that everything is correct. Instead it asks each driver in turn whether it works and, if it doesn't, throws it away and reclaims the memory. This means that a generic kernel works with everything but takes a long time to boot.

Around the time the ARM was first developed, in the 1980s, the concept of a "microkernel" became popular, probably as a reaction to the increasing complexity of the UNIX kernel. Microkernels don't do anything that doesn't need to be done to run the first user process, so they boot very fast but the user process might then have to wait a bit to get hold of the hardware it needs. RISC OS is an example of such a kernel, and it boots very fast.

You can achieve the same thing with Linux by putting everything into modules and only modprobing the stuff you need. Linux starts to look a lot like RISC OS at this point :-)

But, as others have said by implication, the normal issue people encounter is that the user system is itself bloated; it does all manner of things that aren't necessary. This is why people quote boot times of more than 5 seconds; all that time is spent doing things that probably aren't necessary, like setting the time (a very slow operation.)

For that reason the first thing to do is to deconstruct the user boot process; everything that happens after process 1 is started. In some sense that means building your own operating system, but, in practice, if you are not providing a multi-user operating system and you care about the time-to-start then you have no choice but to do this. Anyway, it's really easy; both OpenRC and systemd can be effectively deconstructed by disabling things from the start. Debian probably isn't a good starting point - it *is* a multi-user OS so it expects to have to start up everything that any user might need.

For Linux systems busybox provides an almost canonical implementation; you don't need anything apart from busybox to get a running Linux based operating system.

John Bowler

summers
Posts: 63
Joined: Mon Jan 30, 2012 4:27 pm

Re: Fast boot raspberry pi

Thu Feb 05, 2015 9:59 pm

Within linux. Look at a custom kernel + a busybox initramfs.

The ram disk you-ll need to build yourself. Suggest busy box + uclibc + whatever else you need.

Then with the kernel - only enable the minimal that you need to boot the machine.

Link the initramfs into the kernel.

This will boot *very fast* into a not very usable system. This said though if you know what you want to run, it would be very fast - probably as fast as it can be with linux.

I've been planning on doing a RPi system like this - for amusment more than anything. Havn't yet had time to do it though ...

Return to “Linux Kernel”