Randy Martin
|
Exciting possibilities with the kernel source... at boot time
|
Randy Martin
09/14/2007 9:46 AM
post1192
|
Exciting possibilities with the kernel source... at boot time
One of the things I love about QNX is that I can intimately control the boot process ... not only the order of program
load but also where programs reside. As everyone knows, the smallest QNX system can consist of the kernel (procnto) and
a statically linked program. No filesystems needed!
So... now that we have the kernel source I can do some things that let me investigate even more thoroughly how I want my
embedded target to boot.
First... I almost always do the following in my boot images.
- I use the instrumented kernel (procnto-instr)
- The first program I run in my startup-script is:
tracelogger -s20 &
(remember to include the tracelogger binary in your boot image)
- this is a great test, because when this system boots, it will record the first 20 seconds of system activity in to a
file called '/dev/shmem/tracebuffer.kev'
After booting, I can copy this file from my target in to the QNX Momentics workspace and examine the file using the
System Profiler. I will see every process start time and overall CPU activity for the first 20 seconds of boot.
Now with the kernel source I can add some other debug messages in my testing.
One thing that I sometimes get in trouble with is not having the proper environment when I start a program in my boot
image.
In trunk/services/system/proc there is a bootimage_init.c file that launches the programs from the boot image
(function boot_external()).
No reason why I cannot use a few kprintf() calls in that function to print out the command being run, the arguments used
and any other item about the launching application that I want to know.
Very cool...
I challenge others to post their new experiences with working with the source code.
Some notes on my setup:
Development: Kubuntu 7
User settings: non-root user. Checked out trunk to my home directory and built from there.
Embedded Targets:
Pentium 1.5GHz laptop (for general testing)
i.MX31 ADS board (for real work)
Randy Martin
Product Marketing
QNX Software Systems
|
|
|