Intel® Software Development Tools for Intel® Atom™ Processor and Moblin Powered Devices Class 2 Feb 27th 2009 System Software Development for Intel® Atom™ Processors.

Download Report

Transcript Intel® Software Development Tools for Intel® Atom™ Processor and Moblin Powered Devices Class 2 Feb 27th 2009 System Software Development for Intel® Atom™ Processors.

Intel® Software Development Tools
for Intel® Atom™ Processor
and Moblin Powered Devices
Class 2
Feb 27th 2009
System Software Development for Intel® Atom™ Processors
Agenda
• Intel’s Software Development Tools for System
Development
− System cross development and Intel’s tools offering
• Bootprocess, Bootloaders
• OS Kernel Development
• Kernel Modules and Device Drivers
2
Intel® C++ Software Development Tools
Intel® Tools for Intel®
Atom™ Processor
•
Rich Development Tool Suite
from Intel: “Intel® C++
Software
Development Tool Suite for
Linux* OS Supporting
Mobile Internet Devices”
(Intel® MID Tools)
•
Intel® C++ Compiler for
targeted performance
advantage in critical code
•
Intel® C++ JTAG Debugger
for system debug and fast
issue resolution
Intel’s software development tools address
system development needs
*Other names and brands may be claimed as the property of others
3
System cross development principles
•
Cross Development
–
–
•
Different host and target hardware
Cross Debug
•
•
access to target through remote connection
full remote execution control
System Development
– Remote OS kernel and application download
–
•
•
Remote NAND flash programming
Application load and launch into target RAM
•
Target OS threads, device drivers, services ….
Remote target OS visibility from host
Remote development and debug only option for
small
form factor Intel® Atom™processor based
4
Intel® Tools for System Development
• Intel® C++ Compiler
– Build performance critical OS components and drivers
– Optimize for fast execution and fast OS switch into low power mode
• Intel® C++ JTAG Debugger
– Debug and identify issues in bootloader
– Debug and identify issues in OS kernel
– Debug and identify issues in device
drivers
5
Using Intel® C++ Compiler for
OS kernel development
• Use protected OS image build environment like Moblin Image Creator
• OS kernels are highly optimized code. Recompile using different compiler –
“hard work with limited benefit”
Typical approach:
• Install Intel® C++ Compiler into build environment
• Modify component makefiles to use ICC instead of GCC for parts that
– Are multimedia or data volume, or data stream driven
– Have a lot of direct interaction with user interface
• Improve overall OS responsiveness and end-user experience
Use Intel® C++ Compiler for
spot optimizations
6
Intel® C++ Compiler and Intel® Atom™
Processor
• Intel® C++ Compiler 10.1
• Optimization Switch –xL
– In-order Scheduler
– Automatic SSE3 SIMD optimizations
• Intel® C++ Compiler 11.1
• Optimization Switch –xSSE3_ATOM
– IDIV  DIVB expansion
– Arithmetic operations feeding addresses turned into LEAs
– All stack adjusts done using LEAs
Performance
improvement
over Intel®
Compiler 10.1
on Atom
• Optimization Switch –axSSE3_ATOM
– Code optimized for Intel® Atom™ Processor also runs on other platforms
Dedicated performance optimizations
for the Intel® Atom™ Processor
7
Target Connection
• JTAG connector on the target HW
• An intelligent probe Intel® XDP3 connects to the JTAG connector on
target.
• The System debugger running on the host PC connects via USB to the
Intel® XDP3 probe.
 The System Debugger provide commands to the probe which handles the
low level communication with the target HW
Custom HW
Debugger host
USB
ITP XDP 3
8
Debugging Bootprocess, Bootloaders
• Objectives:
- Debug the bootprocess
- Debug test code/statically linked code
- Download test code into target RAM memory
- Getting the code into Flash
9
Building and debugging statically
linked code
• Used for register testing, custom platform stress testing, hardware
functionality testing and OS Bootloader
• For build
−Use Intel® C++ Compiler or assembly
−OS independent = separate build and link step.
$ as test1.asm -o test1.o
$ icc –c –O0 test2.c –o test2.o
$ ld –-image-base <address> --entry <address> -–heap <size>-stack <size> -o <image name> <input file list>
$ objcopy –I elf32-i386 –O binary <image name in> <image name
out>
• For debug
−ensure consistent use of –g for all build steps
−ensure link address and target download address are identical
10
Debug Linux* OS boot process
• Run target platform until basic platform initialization through firmware/BIOS is
complete
• Connect to Intel® Atom™ Processor based platform using
−Intel® ITP-XDP Connector
−Intel® C++ JTAG Debugger
$ ./xdb.sh
• some memory locations may not be mapped as valid yet or may be read-only:
XDB> set opt /hard=on
using only hardware breakpoint for stepping.
• Set breakpoint in OS bootloader or at kernel unpack
• Run and single step as you please
• For symbolic debugging of early OS kernel code – load OS symbols
XDB> LOAD /SEGMENT /DEBUG /NOLOAD /GLOBAL OF "/usr/linux2.6.22.i686/vmlinux"
11
Download of testcode into RAM
• Use preexisting initialization code to set up target RAM.
• Use Intel® C++ JTAG Debugger to download test code
– download image to target and load symbol info with
XDB> LOAD /DEBUG /NOLOAD OF <elf dwarf2 file>
XDB> LOAD /BINARY /ADDRESS = <address> OF <binary file>
12
Flashing Target Images and Bootloader
•
Intel® C++ JTAG Debugger Flash Memory Tool
– Flash binary and hex files
– Erase/unlock/lock blocks
– Backup flash contents into binary file on host
– Ideal for BIOS update
Flash "select /board=
'targetboard'"
Flash "change offset 0x00"
Flash "change datafile
'/home/qa/BIOS50.bin'"
Flash "burn flash false true true"
13
Debug Linux* OS Kernel
•Objectives
– Validate boot-up process
– Analyze and correct stability issues
• segmentation faults, services not starting correctly
– Identify and correct configuration issues
• page tables, descriptor tables, stack overflow, data abort
– Develop and test device drivers
14
Debug Linux* OS Kernel
The Intel® C++ JTAG Debugger offers
•
Full platform support with
unique hardware insight
•
Linux* host support and
Linux* target OS awareness
•
On-Chip Trace Support
•
SMP support
15
Full Eclipse* GUI based System Debugger
Source Window
Register View
Disassembly Window
Command Console
*Other names and brands may be claimed as the property of others
16
Run control; break points / watch points
Breakpoint in source code
Breakpoint defined via dialog
Breakpoint set in command window
Watchpoint set in command window
xdb> set break at &start_kernel hard
BREAKPOINT 0 AT &start_kernel (addr=0xC03D7490) : enabled (S=0, CS=0, HW=0)
xdb> set watch /access=io at 0x80
WATCHPOINT 0 AT 0x80 (addr=0x00000080, len=4,acc=I) : enabled (S=0,CS=0,HW=0)
17
Modify target code on the fly
Powerful tool for on-the-fly testing and rerun of test and
firmware code
• Open memory window or disassembly window
• The hex values can be modified – memory window
•
Opcodes or mnemonics can be overwritten – disassembly
window
18
Debug Linux* OS kernel
• Run target platform until basic platform initialization through firmware/BIOS is
complete
• Connect to Intel® Atom™ Processor based platform using
−Intel® ITP-XDP Connector
−Intel® C++ JTAG Debugger
$ ./xdb.sh
• If not already present then you can flash a bootloader and OS image on the target
now
• Run to kernel entry point &start_kernel
• Step through kernel initialization and single step as you please
• Run to &mwait_idle to debug fully initialized OS
• For symbolic debugging of early OS kernel code – load OS symbols
XDB> LOAD /SEGMENT /DEBUG /NOLOAD /GLOBAL OF "/usr/linux2.6.22.i686/vmlinux"
19
Symbol Info Handling for OS Kernel
Debug
•
The debugger reads the .elf file on the host and uses
the debug records and symbol maps from that file
•
The .elf file is the same file as executed on the target
•
Use directory substitution for the symbol info to map
sources if necessary
•
You can use the ‘load –dialog window’ to specify the
‘symbol file’ or use the load command in the command
window. Example below:
20
Debugging Hyperthreading Enabled OS
Cores
•
Intel® Atom™ Processor single-core processor with 2
possible hyper-threads
•
Intel® C++ JTAG Debugger connects to both hyper-threads
•
For non-SMP enabled Linux* hyperthreaded support needs
to be disabled in xdb.sh.
•
The debugger behavior looks similar to a single hwthread system:
Intel® C++ JTAG Debugger supports
hyperthreading-enabled OS cores
21
Intel® Debugger Trace Support
Intel® Atom™ Processor hardware feature
• enables viewing of execution history
• enhances understanding of the flow of an executed program
• analyze the instruction execution history to find errors
• identify the root cause for exceptions
Executed
Kernel
Code
Source Code
Send Branch
On-chip Branch
Trace Info To
Trace
Debugger
22
Localize Configuration Issues with
Instruction
1. Kernel(1)
or device driver causes exception
Trace
2.
Read execution trace at assembler level to identify
access that caused exception
23
Localize Configuration Issues with Instruction
Trace (2)
C/C++ Source
Window
Trace
Window
Stop at
specific OS
signal
Assembler
Window
24
Page Translation Table
– Provides insight into Memory Configuration
•
•
Instant and simple resolution and translation between
physical and virtual address space
Identify why memory access failed
Instruction trace and memory configuration awareness
help monitor and correct OS runtime behavior
25
Linux* OS Awareness – System Debug
Kernel
Kernel
•
•
•
Monitor kernel modules and system threads
Access status information
Debugging of Linux* memory images
Be aware of all relevant platform software stack
interactions
* Other names and brands may be claimed as the property of others.
26
Kernel modules and device drivers
•The Linux* OS awareness allow you to:
- view of all currently active kernel threads –
select from the menu
-list of all currently loaded kernel modules
-
select from the menu
- allow for debugging loadable kernel modules
• Additional steps for kernel module debugging:
•Launch kernel module idbntf.ko on the target
device using insmod.
• Make sure you have symbol information
27
Debugging Services and Drivers
Kernel modules that the debugger is already registering during
boot-up can be seen in kernel module list and breakpoints can be
set right away.
*Other names and brands may be claimed as the property of others
28
Intel® Atom™ Processor Chipset
Peripheral Registers
JTAG interface
Intel® Atom™ Processor
Z510/Z530
Kernel Module/Audio Driver
- Init Code
#include <hdaudioregisters.h>
#define HD_AUDIO_REG_BASE = 0x00FF0000;
24bit
LVDS
400/533 MHz FSB
uint32 * hdaudioregbase = (uint32)HD_AUDIO_REG_BASE;
System
Controller Hub
SDVO
DDR2 400/533
(mem down)
init()
2 PCIe* x1
Lanes
{
hdaudioregbase[D27FO_IHDACR] = 0x01;
GPIO
…
US15W
8* USB 2.0 Host
Ports
SMBus
LPC
SDIO/
MMC
FWH
1 IDE
Channel
SIO
}
SCH US15W
•
~400 Peripheral Registers
Intel® High Definition Audio
29
*Other names and brands may be claimed as the property of others
Summary
•
Intel® C++ Software Development Tool Suite covers all aspects of system
software development
•
Use Intel® C++ Compiler for higher performance of your sensitive device
drivers
•
Find OS kernel and driver issues faster with Intel’s GUI driven systemlevel JTAG debugger
OS bring-up, Hardware test code deployment, driver
development.
The Intel® C++ Software Development Tool Suite has you
covered.
30
For More Information
If you have questions concerning the webinar, please post them at:
http://software.intel.com/en-us/forums/intel-software-development-tools-for-mids/
Or write a private mail to: [email protected]
For the Intel® C++ Software Development Tool Suite visit
www.intel.com/software/products/mid
For more information on Intel® Software Partner Program go to:
http://www.intel.com/software/partner/mid/
Further Info:
•
•
•
•
•
http://software.intel.com/en-us/forums/intel-software-development-tools-for-mids
http://software.intel.com/en-us/articles/sampling-collector-mid
http://software.intel.com/en-us/articles/cross-application-debugging
http://software.intel.com/en-us/articles/atom-optimized-compiler
http://software.intel.com/en-us/articles/intel-development-tools-for-mids-faqs
31
* Other names and brands may be claimed as the property of others.