Note: This is an article I wrote for iWave System's newsletter/blog. Read this artcile on iWave's blog post.
iWave Systems, a genuine embedded solutions provider has now optimized the booting time of its Windows Embedded Compact 7 (WEC7) BSP for Freescale’s SABRE SDP/B platform.
Now the WEC7 OS is booting in
short boot time of ~3 seconds for a small footprint OS image with display and
touch drivers support, and boot time of ~8 to ~10 seconds for an OS image with
basic drivers and OS components support.
Why boot time optimization?
WEC7 is a real time OS which
will be used in performance-critical applications such as automotive and
healthcare units.
In most of the cases, booting
time will play important role, e.g. if the device is used in rear-view camera
system in automotive field, the user needs the device to start working as soon
as the reverse-gear is applied. This requirement needs the device to boot and
start the camera application within few seconds.
This demands a very short OS
boot time.
Some of the techniques which
can be applied for efficient boot time optimization are discussed in this
article.
(image courtesy: iWave systems. iWave's BSP on SABRE SDP platform)
Boot phases in WEC7:
1.
Boot-loader
(eboot):
Boot-loader is used to load
the WEC7 OS.
On Freescale’s SABRE platform,
eboot consumes about 3 to 4 seconds, by default, which includes a delay for
eboot menu.
The time consuming tasks in eboot
are basic hardware initializations of booting device (e.g. Micro-SD) and other
necessary devices, display initialization if necessary, and splash screen
loading.
2.
Copying
of OS image from booting device (e.g. Micro-SD) to RAM:
Most time consuming task is the
copying of WEC7 OS image from booting device (e.g. Micro-SD) to RAM.
On Freescale’s SABRE platform,
this phase consumes about ~10 to ~12 seconds to copy the WEC7 OS image, by
default.
This copying time increases as
the size of WEC7 OS image is increased.
3.
OAL
Layer:
OAL layer initializes
interrupts, schedulers, timers and may contain hardware initializations if
needed.
This process takes only ~200ms
to ~500ms, by default.
4.
Driver
initializations and file system mounting:
This phase includes all driver
initializations and mounting of file system.
It consumes approximately ~15 seconds, by default, on
Freescale’s SABRE platform.
WEC7 device manager loads all
the drivers serially. So, if a driver initialization function waits for a
hardware initialization or uses a delay or looping sequences, it will directly
affect the booting time.
File system mounting also has
an impact on the booting time.
Reducing the boot time in different
booting phases of WEC7:
1.
Boot-loader
(eboot):
Remove the code that
initializes a hardware which is not required in boot-loader. E.g. If booting
device is micro-SD, the initialization of NAND is not necessary. So, this
redundant code needs to be removed.
The eboot menu in eboot is
important for debugging of WEC7 OS. But it is not needed in an end product. So,
the delay for this eboot menu can be completely removed to reduce 3 seconds of
time.
In few platforms such as
Freescale’s SABRE platform, a default splash screen is used, which updates
continuously. This can be removed, and a static splash screen can be displayed,
which can save a few milliseconds of time.
Remove unnecessary serial
debug prints.
2.
Copying
of OS image from booting device (e.g. Micro-SD) to RAM:
This time increases as the
size of WEC7 OS image increases. So, select the OS components carefully and
remove redundant components from OS image so that the OS image can be copied to
RAM quickly.
Also remove unnecessary
registry keys, dlls and libraries to reduce the OS size. Optimize binary image
builder (.bib) file to reduce the run-time image file.
Implement Multi-BinFS OS
binaries to reduce the OS copying size.
As the
functionalities/driver supports goes on increasing, WEC7 image size increases.
So, the time required to copy the image increases, and RAM size needed to store
the OS image increases.
The Binary
ROM Image File System (BinFS) can fix the two issues.
In a BinFS
file system, the WEC7 OS binary is divided into multi-binary Image files, and only
the one binary (less than 5MBs) is copied into the RAM by the boot-loader. The components
in the other binary files are copied into the RAM only when they are required
to run.
Links that can be referred to
implement multi-BinFS in WinCE:
MSDN
documentation: http://msdn.microsoft.com/en-us/library/aa516960.aspx;
An implementation
guide by Freescale: http://cache.freescale.com/files/dsp/doc/app_note/AN4137.pdf
You can
also include compressing-decompressing mechanisms in boot-loader to achieve
even shorter copying time.
3.
OAL
layer:
Remove the code that does
unnecessary hardware implementations. Skip the initializations that already
done in eboot.
Remove any wait/loop/delay if
exists.
Remove unnecessary serial
debug prints.
4.
Driver
initializations and file system mounting:
Analyse and remove all the
redundant drivers, check for any loop, wait or delay sequences in driver
initialization code.
Load any applicable drivers
(e.g. USB, sensors) after the OS boot (i.e. after user sees a
desktop/application).
In WEC7 OS, a
driver can be either loaded during booting using device manager/GWES, or can be
loaded dynamically whenever necessary.
This can be
achieved easily by changing the registry key configurations to remove the
driver from built-in drivers, a small application to load the driver after OS
boot-up, and registry settings to launch this application automatically once
the OS is booted.
To decide the
load order, it is important to check the dependencies of/on a driver.
Use appropriate splash
screen/progress bar while user waits for OS booting.
Remove unnecessary serial
debug prints.
By effectively following the techniques
mentioned, WEC7 based platforms can achieve reduced boot time for quick
application access.
iWave Systems has optimized
the WEC7 booting time on Freescale’s SABRE SDP platform. The booting time is as
low as ~3 seconds for a WEC7 OS with standard shell, LCD display, DDraw, I2C
and touch driver support, and ~8 to 10 seconds for WEC7 OS with following
components:
·
Standard shell
·
Display
·
DDRAW
·
Capacitive touch screen
·
MicroSD
·
USB host – Mass storage and HID
·
Ethernet
·
GPU (OpenVG/GL)
·
Multimedia codecs
·
DirectShow
·
Audio
·
Video Playback
·
Ambient Light Sensor
·
Accelerometer
·
SMP
·
PWM
·
Backlight
·
I2C
·
Debugging using KITL
See this demo video published on iWave's official youtube channel:
No comments:
Post a Comment