2017-04-09 23:50:18 +08:00
|
|
|
Title: Kernel Footprint Measurement
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
Description:
|
|
|
|
|
|
|
|
This project is designed to characterize the memory requirements of a
|
2017-04-09 23:50:18 +08:00
|
|
|
standard kernel image running on an Atom target.
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
The project can be built using several configurations:
|
|
|
|
|
|
|
|
minimal (a "do nothing" image that has support for few kernel capabilities)
|
|
|
|
-------
|
|
|
|
- Idle task is only task in system.
|
2015-04-22 04:49:11 +08:00
|
|
|
- No system timer support.
|
|
|
|
- ISR for the spurious interrupt handling is present.
|
2015-04-11 07:44:37 +08:00
|
|
|
- IDT and stack memory sizes are very limited.
|
2015-04-27 21:39:53 +08:00
|
|
|
- Provides support for 2 task priorities.
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
regular (a "typical" image that has support for some kernel capabilities)
|
|
|
|
-------
|
|
|
|
- As for "minimal" configuration, except as noted below.
|
|
|
|
- Supports larger IDT and utilizes larger stacks.
|
|
|
|
- A statically linked dummy ISR is present.
|
|
|
|
- Has "foreground" task that prints a message to the console via printk().
|
2015-04-27 21:39:53 +08:00
|
|
|
- Provides support for 16 task priorities.
|
2015-04-22 04:49:11 +08:00
|
|
|
- Supports system timer, along with task scheduler support for time slicing.
|
2015-04-11 07:44:37 +08:00
|
|
|
- Links in support for EVENT, MUTEX, FIFO, and MAP objects.
|
|
|
|
|
|
|
|
maximal (a "complex" image that has support for many kernel capabilities)
|
|
|
|
-------
|
|
|
|
- As for "regular" configuration, except as noted below.
|
|
|
|
- Supports full IDT and utilizes even larger stacks.
|
2015-04-27 21:39:53 +08:00
|
|
|
- Provides support for 64 task priorities.
|
2015-04-11 07:44:37 +08:00
|
|
|
- Foreground task dynamically links in the dummy ISR, rather than having
|
|
|
|
it statically linked.
|
|
|
|
- Foreground task prints a message to the console via printf(),
|
|
|
|
rather than printk().
|
|
|
|
- Links in support for SEMAPHORE, PIPE, MAILBOX, and POOL objects.
|
|
|
|
- Links in support for task device interrupt handling and additional task APIs.
|
|
|
|
- Adds advanced power management support (including tickless idle).
|
|
|
|
- Adds floating point support (for x87 FPU, including SSE).
|
|
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
Building and Running Project:
|
|
|
|
|
2017-04-09 23:50:18 +08:00
|
|
|
This project does not generate any output in the default case
|
2015-04-11 07:44:37 +08:00
|
|
|
(TEST=min). In the regular case (TEST=reg) and the maximal case (TEST=max),
|
|
|
|
it outputs to the console. It can be built and executed on QEMU as follows:
|
|
|
|
|
2015-06-06 09:48:58 +08:00
|
|
|
make TEST=min qemu (minimal configuration)
|
2015-04-11 07:44:37 +08:00
|
|
|
|
2015-06-06 09:48:58 +08:00
|
|
|
make TEST=reg qemu (regular configuration)
|
2015-04-11 07:44:37 +08:00
|
|
|
|
2015-06-06 09:48:58 +08:00
|
|
|
make TEST=max qemu (maximal configuration)
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
2015-06-01 22:30:09 +08:00
|
|
|
Troubleshooting:
|
|
|
|
|
|
|
|
Problems caused by out-dated project information can be addressed by
|
|
|
|
issuing one of the following commands then rebuilding the project:
|
|
|
|
|
|
|
|
make clean # discard results of previous builds
|
|
|
|
# but keep existing configuration info
|
|
|
|
or
|
|
|
|
make pristine # discard results of previous builds
|
|
|
|
# and restore pre-defined configuration info
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
2015-04-11 07:44:37 +08:00
|
|
|
Sample Output:
|
|
|
|
|
|
|
|
The resulting image is bootable for all configurations, but produces different
|
|
|
|
output in each case.
|
|
|
|
|
|
|
|
minimal
|
|
|
|
-------
|
|
|
|
This configuration does NOT produce any output. To observe its operation,
|
|
|
|
invoke it using gdb and observe that:
|
2017-12-05 22:43:43 +08:00
|
|
|
- the kernel's timer ISR & main thread increment "_sys_clock_tick_count" on a
|
|
|
|
regular basis
|
|
|
|
- k_cpu_idle() is invoked by the idle task each time _sys_clock_tick_count
|
|
|
|
is incremented
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
regular
|
|
|
|
-------
|
|
|
|
This configuration prints the following message to the console:
|
|
|
|
|
2017-04-09 23:50:18 +08:00
|
|
|
Running regular kernel configuration
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
maximal
|
|
|
|
-------
|
|
|
|
This configuration prints the following message to the console:
|
|
|
|
|
2017-04-09 23:50:18 +08:00
|
|
|
Running maximal kernel configuration
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
Additional notes:
|
|
|
|
|
2016-08-24 03:32:20 +08:00
|
|
|
Various host utilities (such as the Unix "size" utility) can be used
|
|
|
|
to determine the footprint of the resulting
|
2017-04-09 23:50:18 +08:00
|
|
|
outdir/$BOARD/zephyr.elf image.
|