分类: LINUX
2009-08-31 22:41:12
The default Blackfin development board Linux and User-Space configuration examples, are optimized for ease of use and flexibility, and not for size and startup time.There are hundreds of options enabled by default, allowing you to test drive various Linux drivers and application examples. Or there are options only useful during development and debugging. Having these options in an embedded production system is pointless.
Small memory footprint, low and a time are typically in the interest of the embedded system designer.
This capture illustrates a 1 Second boot. For instrumentation I used GPIOs.
Configuration:
Section | Time Spend | Comments |
---|---|---|
Boot Bootloader | 20ms | Time between RESET High and u-boot invoking bootcmd=bootm 0x20040000 |
Bootloader loading u(vm)Image | 381ms | Time between bootm command and executing the first kernel instruction in head.S |
Linux kernel Startup | 302ms | Time between executing the first kernel instruction and kernel invoking /bin/init |
User Space Setup | 271ms | Time between kernel invoking /bin/init and end of /etc/rc scrip |
Total Boot Time | 973ms |
Config files used during this benchmark are available here:
Configuration:
Section | Time Spend | Comments |
---|---|---|
Boot Bootloader | 20ms | Time between RESET High and u-boot invoking bootcmd=bootm 0x20040000 |
Bootloader loading u(vm)Image | 427ms | Time between bootm command and executing the first kernel instruction in head.S |
Linux kernel Startup | 366ms | Time between executing the first kernel instruction and kernel invoking /bin/init |
User Space Setup | 244ms | Time between kernel invoking /bin/init and end of /etc/rc scrip |
Total Boot Time | 1057ms |
Config files used during this benchmark are available here:
See SPI flash boot example below: spi_boot_linux_form_processor_reset_into_user_space_in_less_than_1.4_second
See also here:
u-boot env: #set bootdelay 0
root:/> fw_setenv bootdelay 1
Compile u-boot with #define CONFIG_SILENT_CONSOLE
u-boot env: #set silent 1
u-boot env: #set baudrate 115200
The time spend here scales linearly with the size of your image your loading into memory.
Image sizes in the example discussed here:
michael@mhenneri-D02:~/devel/svn/uclinux-dist-trunk_3/images> ll total 9600 lrwxrwxrwx 1 michael users 18 2008-08-05 13:12 linux -> linux.initramfs.gz -rwxr-xr-x 1 michael users 2185567 2008-08-05 13:12 linux.initramfs -rwxr-xr-x 1 michael users 1816927 2008-08-05 13:12 linux.initramfs.gz -rw-r--r-- 1 michael users 773120 2008-08-05 13:12 rootfs.initramfs -rw-r--r-- 1 michael users 8236 2008-08-05 13:12 rootfs.initramfs.contents -rw-r--r-- 1 michael users 406936 2008-08-05 13:12 rootfs.initramfs.gz -rw-r--r-- 1 michael users 359142 2008-08-05 13:12 System.map.initramfs -rw-r--r-- 1 michael users 359142 2008-08-05 13:12 System.map.initramfs.gz lrwxrwxrwx 1 michael users 16 2008-08-05 13:12 uImage -> uImage.initramfs -rw-r--r-- 1 michael users 940474 2008-08-05 13:12 uImage.initramfs -rw-r--r-- 1 michael users 941208 2008-08-05 13:12 uImage.initramfs.gz -rw-r--r-- 1 michael users 533519 2008-08-05 13:12 vmImage -rwxr-xr-x 1 michael users 1398334 2008-08-05 13:12 vmlinux
u-boot env: #set verify n
See this configuration can be booted in exactly 1 Second.
Example: Calibrating delay loop... 1046.52 BogoMIPS (lpj=2093056)
Example Kernel command line:
root=/dev/mtdblock0 rw console=ttyBF0,115200 quiet lpj=2093056
Further speedups are easily possible:
By removing more options, such as support for printk, System V IPC, etc. the overall bootime can be less than 0.7 Seconds.
Disabling sysfs and procfs does have some negative side effects:
sysfs
No firmware loading (which affects most wireless cards). No power control/events. No tweaking of devices which export attributes only in sysfs (which is more and more each day but largely device-specific). No bus discovery (any bus, but for us usb is what really matters). Some more …
procfs
No information about running processes, filesystems, memory, network. No access to sysctl tunables (/proc/sys/)
This capture illustrates a 0.4 Seconds boot, of minimalistic system.
Almost all device drivers are removed except for Serial and GPIO. Kernel features such as loadable module support and many others are removed. User space only includes init, shell, ls and echo.
This setup may fit together with the bootloader into 0.5 Mega Byte of flash memory.
Section | Time Spend | Comments |
---|---|---|
Boot Bootloader | 20ms | Time between RESET High and u-boot invoking bootcmd=bootm 0x20040000 |
Bootloader loading u(vm)Image | 168ms | Time between bootm command and executing the first kernel instruction in head.S |
Linux kernel Startup | 224ms | Time between executing the first kernel instruction and kernel invoking /bin/init |
User Space Setup | 9ms | Time between kernel invoking /bin/init and end of /etc/rc scrip |
Total Boot Time | 421ms |
The config files used can be downloaded here:
michael@mhenneri-D02:~/devel/svn/uclinux-dist-trunk_3/linux-2.6.x> bfin-uclinux-size vmlinux */built-in.o text data bss dec hex filename 713068 54280 17604 784952 bfa38 vmlinux 69558 3692 3428 76678 12b86 drivers/built-in.o 116032 1224 1748 119004 1d0dc fs/built-in.o 13820 2509 1128 17457 4431 init/built-in.o 95120 7176 5488 107784 1a508 kernel/built-in.o 19028 12 16 19056 4a70 lib/built-in.o 44700 2852 508 48060 bbbc mm/built-in.o 120 0 0 120 78 net/built-in.o 1352 4 4 1360 550 security/built-in.o 305664 0 0 305664 4aa00 usr/built-in.o
michael@mhenneri-D02:~/devel/svn/uclinux-dist-trunk_3/images> ll total 4180 lrwxrwxrwx 1 michael users 18 2008-08-05 15:16 linux -> linux.initramfs.gz -rwxr-xr-x 1 michael users 939908 2008-08-05 15:16 linux.initramfs -rwxr-xr-x 1 michael users 796548 2008-08-05 15:16 linux.initramfs.gz -rw-r--r-- 1 michael users 305664 2008-08-05 15:16 rootfs.initramfs -rw-r--r-- 1 michael users 6895 2008-08-05 15:16 rootfs.initramfs.contents -rw-r--r-- 1 michael users 164813 2008-08-05 15:16 rootfs.initramfs.gz -rw-r--r-- 1 michael users 125155 2008-08-05 15:16 System.map.initramfs -rw-r--r-- 1 michael users 125155 2008-08-05 15:16 System.map.initramfs.gz lrwxrwxrwx 1 michael users 16 2008-08-05 15:16 uImage -> uImage.initramfs -rw-r--r-- 1 michael users 415208 2008-08-05 15:16 uImage.initramfs -rw-r--r-- 1 michael users 416145 2008-08-05 15:16 uImage.initramfs.gz -rw-r--r-- 1 michael users 250272 2008-08-05 15:16 vmImage -rwxr-xr-x 1 michael users 623513 2008-08-05 15:16 vmlinux
This example uses a similar configuration than the first 1 Sec. boot from to read more.
Test Setup | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u-boot-1.1.6
Configuration:
给主人留下些什么吧!~~
|