Hardware/ARMEBS/3/LinuxFastBoot
From UIT
|
Howto make Linux boot faster
This article is an howto which explain how to boot Linux faster on an ARMEBS3. More precisely, it talks about the boot time from -on to the time the kernel run it's init (= first userland task). After the first task, booting faster simply means running less task, or running them in parallel for optimizing CPU usage.
Current results
It's possible to have a shell after 2.59 seconds on the ARMEBS3, using kernel 2.6.19 (configured with support for all of our hardware), u-boot (r855) and a small romfs containing the (statically linked) busybox sh.
Timing details
- u-boot 0.328 seconds
- linux 1.656 seconds
- sh 0.606 seconds
Configuration
- Uncompressed kernel image (Image.img)
- u-boot variables:
- stdout nulldev (be less verbose while booting)
- verify n
- Don't check the crc for the kernel image, flash is a reliable media, and can be checked once after it has been written, not on every boot.
- bootargs "loglevel=4 init=/bin/sh lpj=350208 root=1f04 ro console=ttyS0,115200"
- root file system on flash (1f04 == /dev/mtdblock4)
- Be less verbose (loglevel)
- Don't measure bogomips, use the value of lpj. If you don't change the clock and don't change the HZ value, the loop per jiffie won't change.
u-boot timing (as for r885)
- 3.8 Mo kernel image
- From reset to u-boot display_banner : 42 ms
- was 90 ms
- optimized PLL init in r875
- optimized size of environment in r885
- From banner to display_dram_config : 18 ms
- was 200 ms
- optimized size of environment in r885
- was 200 ms
- From display_dram_config to "hit any key..." message : 3 ms
- was 110 ms
- reduce size of environment in r885
- setenv does a *lot* of strcmp
- replaced 10 ms active wait by wait on ready bit while accessing ethernet phy in r884
- From "ok" to "Starting kernel" message : 235 ms
- was 1320 ms
- replaced memcpy, memmove, ... by linux assembly version (r874 and r880)
- was 90 ms
Measured speed as for r885
- memcopy from flash to ram
- 235 ms for 3958672 bytes -> 16.84*10^6 bytes/seconds -> 16.06 Mo/s
- crc
- 1.404 seconds for 3958672 bytes -> 2.82*10^6 bytes/seconds -> 2.68 Mo/s
- kernel uncompression (uncompressed size: 3958672)
- speed: 1.556 seconds for 1956972 bytes -> 1.25*10^6 bytes/seconds -> 1.19 Mo/s