Pingpong1109
Posts: 33
Joined: Sat Mar 30, 2013 3:58 pm

Fastest booting OS

Mon Apr 07, 2014 4:48 pm

What is the fastest booting Linux OS for the Pi?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Fastest booting OS

Mon Apr 07, 2014 4:49 pm

I don't think you'll find the fastest Linux OS they all have to do that usually init stuff on boot.
Raspbian is probably the best distro to use for software support and updates although RiscOS (not Linux OS) is quite a fast booter to the desktop.

Richard S.
Last edited by redhawk on Mon Apr 07, 2014 4:57 pm, edited 1 time in total.

User avatar
DougieLawson
Posts: 40794
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Fastest booting OS

Mon Apr 07, 2014 4:51 pm

Pingpong1109 wrote:What is the fastest booting Linux OS for the Pi?
Why is it important?
Even the fully bloated Raspbian comes up before you can say "Raspbian runs".
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Pingpong1109
Posts: 33
Joined: Sat Mar 30, 2013 3:58 pm

Re: Fastest booting OS

Mon Apr 07, 2014 11:06 pm

DougieLawson wrote:
Pingpong1109 wrote:What is the fastest booting Linux OS for the Pi?
Why is it important?
Even the fully bloated Raspbian comes up before you can say "Raspbian runs".
I am just wondering what is the fastest booting OS.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6291
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Fastest booting OS

Mon Apr 07, 2014 11:11 pm

It will depend on what you consider an OS. A stripped down kernel can boot almost instantly. Then you can keep adding 'stuff' and it will scale.

A less pedantic, but incorrect answer, would be ArchLinux.

Edit: It occurs to me that you asked which OS rather than which distro. In that case I'd say RiscOS or some bare metal OS. I suppose they're all bare metal, but you know what I mean.

User avatar
przemof
Posts: 168
Joined: Mon Dec 30, 2013 6:43 pm

Re: Fastest booting OS

Fri Dec 19, 2014 11:11 am

DougieLawson wrote:
Pingpong1109 wrote:What is the fastest booting Linux OS for the Pi?
Why is it important?
Even the fully bloated Raspbian comes up before you can say "Raspbian runs".
It's an old thread, but the issue remains exactly the same..

Mine model A+ takes about a minute to boot - way too long for me as it will run a battery powered [*] cycling computer. Is Arch with (ugh, dirty word..) systemd the distro with fastest boot time?

[*] If I can boot it within, let's say 10 s I could implement some sleep option with an accelerometer triggering wake up action.

fruitoftheloom
Posts: 25723
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Fastest booting OS

Fri Dec 19, 2014 11:18 am

przemof wrote:
DougieLawson wrote:
Pingpong1109 wrote:What is the fastest booting Linux OS for the Pi?
Why is it important?
Even the fully bloated Raspbian comes up before you can say "Raspbian runs".
It's an old thread, but the issue remains exactly the same..

Mine model A+ takes about a minute to boot - way too long for me as it will run a battery powered [*] cycling computer. Is Arch with (ugh, dirty word..) systemd the distro with fastest boot time?

[*] If I can boot it within, let's say 10 s I could implement some sleep option with an accelerometer triggering wake up action.
Tiny Core Linux

http://forum.tinycorelinux.net/index.ph ... ,57.0.html

http://distro.ibiblio.org/tinycorelinux/ports.html
The information is out there....you just have to let it in.

My other Linux machines are a ChromeBox & Intel CoreDuo Desktop

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

Re: Fastest booting OS

Fri Dec 19, 2014 2:37 pm

There will be an awful lot of fluff being booted if you are using standard Rasbian, that isn't needed on a bike computer. You can either take Raspbian and remove what you don't need, or create a new rootfs from scratch using buildroot. You'll need to google for how to do that one!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6291
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Fastest booting OS

Fri Dec 19, 2014 2:41 pm

If you use raspbian, it's probably best to start small and install what you need, rather than try to hunt down what you don't.
https://github.com/debian-pi/raspbian-ua-netinst

User avatar
przemof
Posts: 168
Joined: Mon Dec 30, 2013 6:43 pm

Re: Fastest booting OS

Fri Dec 19, 2014 3:23 pm

Thanks for the replies! I'll try to provide some test results later.
Current boot time to fully functional sytem, with my cycling computer running on class 4 SD card is 39.8s from cold start.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: Fastest booting OS

Fri Dec 19, 2014 3:31 pm

Pingpong1109 wrote:What is the fastest booting Linux OS for the Pi?
Aaah, friday afternoon, I will take a bite of the bait as I am so bored and intent on avoiding doing something useful I resort to playing table tennis.

I feel condescending yet ambivalent whenever I try to answer any question, I am sure you could answer this yourself with google, and I see that every other answer is wrong and yet also correct at the same time.

If you gave some more info maybe a more useful answer could be given?, Of course maybe you are being terse as you do not want to give away the world changing idea that will make you rich?

Simple answer is raspbian is the fastest, all you need to do is remove the init system and recompile a minimal speed optimised kernel then drop straight from kernel boot into your specialised application code or a minimal shell.

But really you need to know what you want to achieve with your project, benchmark the hardware and workout where any bottle necks are, then profile the kernel code, workout what services you require and what dependencies everything has, then you can optimize.

I remember years back running everything from a compressed ram disk because decompression was faster than reading the same data from disk, I use that as illustration that there are many ways of optimizing based on the many types and speeds of hardware that may be available in a system, so you need to look at benchmarking everything and working out time costs of everything (cache,ram,disk, bus transfers, cpu avaialable, coprocessors available). Also looking at dependencies and what can be delayed and what cannot, things like dhcp net config often takes a long time and disk access is probbly slowest factor.

I have heard a rumor that there could be vast improvements in rpi speed soon as someone is working on a gcc plugin for compiling vc4 native assembly from standard c and there is a vc4 Massalin Synthesis kernel for fast path linux bytecode.

So there's is my 2 pennys worth, 2p or not 2p is that the question?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5708
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Fastest booting OS

Fri Dec 19, 2014 3:39 pm

Using a minimal buildroot system to just launch a single application can be very quick. This looks like about 4 seconds from boot to game starting.

Heater
Posts: 17395
Joined: Tue Jul 17, 2012 3:02 pm

Re: Fastest booting OS

Fri Dec 19, 2014 4:23 pm

mung,
gcc plugin for compiling vc4 native assembly from standard c and there is a vc4 Massalin Synthesis kernel for fast path linux bytecode.
What on Earth are you talking about? Google is not helping me much. Sounds like .NET run time stuff or something. Not much to do with boot time I think as there is precious little of that involved in starting up a Linux machine.

It is said that installing systemd as a replacement init system speed things up. No idea really I have not tried it much.

Best to start with getting rid of all the services started at boot up that you don't need.
Memory in C++ is a leaky abstraction .

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

Re: Fastest booting OS

Fri Dec 19, 2014 8:49 pm

Real life is, to most, a long second-best, a perpetual compromise between the ideal and the possible.
-
Meanwhile, the sysadmin who accidentally nuked the data reckons "its best not run anything more with sudo today"
-
what about spike milligan?

User avatar
przemof
Posts: 168
Joined: Mon Dec 30, 2013 6:43 pm

Re: Fastest booting OS

Fri Dec 19, 2014 9:03 pm

Thanks again for the replies! The details:
I'm working on an open cycling computer written in python, based on pygame running on model A+. The display is PiTFT capacitive, so I don't care about GPU (gpu_mem set to 32MB, HDMI will be switched off). The framebuffer is handled directly from pygame, so no xorg required. The device will be battery powered, so I want to have 0 ;-) boot time, but the code won't be heavy, so when started I won't need a lot of processing power. There will be minimal disc activity (1 write/s, ~1 MB/hr of data, much more in debug mode). Currently there are a few sensors connected:
- gps chip (serial) - that's why I need gpsd,
- pressure/temperature sensor (SPI),
- accelerometer (I2C),
- future: bluetooth (BLE) connectivity.
I also use custom splash screen, based on fbi, but that might end up in framebuffer kernel module later on. Right now it's a service.
I need networking (over wifi), because of ssh, but that won't be required when the device is ready.
I'm waiting for CL10 SD card (currently CL4). I did a run test with bootchart and CPU is almost maxed out during boot.

Important part of config.txt:

Code: Select all

initial_turbo=30
arm_freq=1000
arm_freq_min=700
core_freq=500
sdram_freq=500
over_voltage=6
BTW initial_turbo doesn't seem to make any difference, but I didn't try to investigate it yet.

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

Re: Fastest booting OS

Fri Dec 19, 2014 9:06 pm

Heater wrote: It is said that installing systemd as a replacement init system speed things up. No idea really I have not tried it much.
Bootchart : http://www.bootchart.org/samples.html might shed some light on this claim .....

For speed first i would try passing the kernel option init=/path/to/your/app it might work ! ;)
Real life is, to most, a long second-best, a perpetual compromise between the ideal and the possible.
-
Meanwhile, the sysadmin who accidentally nuked the data reckons "its best not run anything more with sudo today"
-
what about spike milligan?

User avatar
emgi
Posts: 357
Joined: Thu Nov 07, 2013 4:08 pm
Location: NL

Re: Fastest booting OS

Fri Dec 19, 2014 9:22 pm

This one: http://arm.slitaz.org/rpi/
Boots in 5s.

/emgi

Heater
Posts: 17395
Joined: Tue Jul 17, 2012 3:02 pm

Re: Fastest booting OS

Sat Dec 20, 2014 11:41 am

I guess you don't really need gpds. Just read the GPS data stream from the UART directly and parse out the information you want.

That won't save much boot time but every little helps, right?

In the extreme write the app in C++ using Qt. That saves the overheads of loading the Python run time.
Memory in C++ is a leaky abstraction .

Heater
Posts: 17395
Joined: Tue Jul 17, 2012 3:02 pm

Re: Fastest booting OS

Sat Dec 20, 2014 11:48 am

r3d4

Those bootcharts are useless. Most of them are over 10 years old so are probably irrelevant today. Especially systemd was not around then.
Memory in C++ is a leaky abstraction .

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

Re: Fastest booting OS

Sat Dec 20, 2014 12:48 pm

As usual, the answer is "it depends"

Standard NOOBS raspbian image provided is of course relatively slow to boot(30 seconds),

Simply moving to Archlinux will get you under 10 seconds, with minimal messing
(many due to init/systemd difference)
Android app - Raspi Card Imager - download and image SD cards - No PC required !

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

Re: Fastest booting OS

Sat Dec 20, 2014 3:56 pm

Heater wrote:r3d4

Those bootcharts are useless. Most of them are over 10 years old so are probably irrelevant today. Especially systemd was not around then.
Just examples , & ... http://www.bootchart.org/docs.html
How it Works
Logger Startup

The boot logger (/sbin/bootchartd) is run by the kernel instead of /sbin/init. This can be achieved by modifying the GRUB or LILO kernel command line, e.g.:

/boot/grub/menu.lst
[...]
title Fedora Core (2.6.10) - bootchart
root (hd0,1)
kernel /vmlinuz-2.6.10 ro root=/dev/hda1 init=/sbin/bootchartd
initrd /initrd-2.6.10.img
Not that i have tried to set it up but AFAIK it should still work , all though it appears not to have been updated recenty
EG : http://i46.tinypic.com/29xjc4w.png

If anyone wants to put it to the test ? ..
+ It seams to still be in use http://forum.tinycorelinux.net/index.php?topic=8627.0
++ Hear is a Request : "Bootchart from a pi" http://forum.tinycorelinux.net/index.php?topic=14242.0
Last edited by r3d4 on Sat Dec 20, 2014 8:02 pm, edited 1 time in total.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13682
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Fastest booting OS

Sat Dec 20, 2014 4:19 pm

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.

Ivan Tham
Posts: 75
Joined: Mon Jun 24, 2013 7:06 am

Re: Fastest booting OS

Sun Dec 21, 2014 2:14 pm

mikerr wrote:As usual, the answer is "it depends"

Standard NOOBS raspbian image provided is of course relatively slow to boot(30 seconds),

Simply moving to Archlinux will get you under 10 seconds, with minimal messing
(many due to init/systemd difference)
No, Arch Linux took me about 17 seconds.

Return to “General discussion”