Mobile Internet device (mobile Internet device) is designed to enhance and customize the function set of the underlying OS at the central layer of customized platforms or embedded applications. This is especially true for closed systems. Additionally, you may want to connect to a dedicated hardware platform extension and write your own driver for it. Some multimedia codec optimizations can also be well applied to the device driver level.
The feature set provided by Intel C ++ JTAG debugger for Linux * OS for mobile internet devices can help develop OS configurations and drivers, it can also help with defect repair, verification and quality assurance. In this White Paper, we mainly discuss how to debug Linux OS enhancements, Linux core components, and kernel modules loaded at runtime.
Overview
The intel C ++ software development tool suite for Linux * OS that supports mobile internet devices contains intel C ++ JTAG debugger for Linux * OS. the system debugger of the graphic user interface. Using it requires that the target device has an Intel extended debug port (XDP) and a ITP-XDP3Intel in-target-probe.
The target users of Intel C ++ JTAG debugger are the initial device manufacturer and the initial design manufacturer (oxm). They need to be able to independently develop device drivers and adopt low-level OS kernel layer platforms.
Such software developers need to have a deep understanding of the hardware that runs embedded OS. At the same time, developers do not have to discard easy-to-use graphical user interfaces and the advanced languages they are used to support debugging.
The complete Intel Atom architecture supports a full view of processor technology. Easy access to most
Si functions,
Includes architecture registers, Intel sse3 and graphics supporting chip registers. Bitfield editors provides in-depth and comprehensive convenient access to documents, where you can view and modify registers.
Bitfield editors applies not only to standard registers, but also to descriptor table entries.
L Not only can you conveniently view and modify the descriptor table for debugging, but also can easily access the page translation table and real-time display of active memory ing.
L Execution tracing supports enhanced understanding of execution program streams. This helps prevent memory leakage, data structure calibration, and execution flow problems. The system debugging execution tracing improves debugging efficiency.
L The Linux OS awareness function can fully grasp system behavior at any time. Display all related kernel information, active kernel threads, and loaded kernel modules, and debug them in the OS environment.
The extended hardware access and OS sensing functions of the debugger also mean that it can remotely debug the Dynamically Loaded kernel modules (Device Drivers) through JTAG ), you only need to start the kernel module provided by the toolkit on the target. This dedicated kernel module can export loading events and memory locations of all modules. Therefore, the JTAG debugger and its OS-aware plug-ins can use this information to easily debug device drivers. For more details, see the version description and debugger documentation.
Basic Principles
JTAG does not support the target software, which makes debugging of device drivers and system services difficult. Because the device driver is usually a dynamic kernel module loaded at runtime, You need to implement a mechanism for the debugger to export kernel loading and detaching events. The purpose of kernel horizontal symbol export and event notification is to enable the debugger to monitor OS Kernel symbols that contain the Memory loading address information of the kernel module, and information about the kernel module status address, loading and initialization methods.
There are many methods to achieve this purpose. The traditional method needs to adjust the kernel module to be debugged. This is a radical method. You need to define or delete the debugging arrangement in the kernel module to release the code block. This method makes the analysis of errors or runtime problems complicated and may only be displayed after the end user receives the device driver.
Another method requires an OS kernel patch to trigger Linux * OS to export all required information. This operation actually requires a system overhead of several kilobytes of memory. When the debugger is not connected to query the export symbols, these patches have no impact on the runtime. However, it is worth noting that this method produces debugging hooks, which may make it easy for competitors to analyze the code base. But this avoids at least one situation, that is, you do not have to build the device driver code every time you debug it.
The best solution does not require kernel module adjustment or kernel patch, but the kernel module itself implements the kernel module's function of loading and exporting information. In this way, you can select any existing target platform without re-compiling the kernel or debugging the debugging object of the device driver.
This White Paper provides a concise tutorial and Application Scenario on how to use intelc ++ JTAG debugger for Linux * OS that supports mobile internet devices for debugging.
Build the kernel module to export the loading information
The kernel module debugging function loaded at runtime is part of the Linux * OS awareness plug-in Intel C ++ JTAG debugger. You need to install and run the kernel module on the target device.Idbntf. KoBefore use. Folder
/Opt/Intel/XDB/1.0.xxx/kernel-modules/idbntf
Contains the encoding for generating Linux * kernel modules. You can enable the kernel module debugging function. Use
/Opt/Intel/XDB/1.0.xxx/kernelmodules/idbntf/makefile
Run make in this folder to create the idbntf. Ko kernel module.
To generate the file, you only need to transfer the file to the user's target system and then call make. This will generate the kernel object idbntf. Ko.
To enable module debugging, this object must be passed through the commandInsmod idbntf. Ko. Load before starting the debugger. Then, it will be exported. The initialization method and cleanip method load information from the target to the debugger. After the debugging dialog is complete, you can use rmmod idbntf to uninstall the module.
Start debugging Dialog
1. First, in the shell environment, make sure that the XDP debugger STARTUP script is located in
/Opt/Intel/XDB/1.0.xxx/XDB. Sh
The settings are as follows:
#! /Bin/bash
# Intel (r) JTAG debugger for mids
# Copyright (c) 2000-2008 intel
Corporation. All rights reserved.
Installdir =/opt/Intel/XDB/ 1.0.008
Export
LD_LIBRARY_PATH = "$ installdir/lib: $ INS
Talldir/GUI: $ installdir/plugin/IA/Lin
OS: $ installdir/plugin/IA/Trace: $ insta
Lldir/plugin/IA/flash ": $ ld_library_pa
Th
Export
Path = "$ installdir/GUI: $ installdir/lib
": $ Path
Export idb_gui_debugger = "../lib/XDB"
Dbggui-tgttype' JTAG IA '-Iudgmode-
PLG
'Libguiialin. So, libiatrace. So, libplgflashw.
So '-Core 1-Target
Device = 'xdp 3'
Scanchain = 'targetplatform' hotdebug
"$ @"
If the preceding settings are not included, the in-target probe extended debug port setting does not specify xdp3, and the specified target is not an expected processor or one of the shared object plug-ins perceived by Linux OS; flash writing is lost. modify settings on the sh script
2. Check whether the xdp3 JTAG detector has been securely connected to the extended debug port labeled with JTAG on the target board. Check the connection between the detector and the USB cable and the USB port on the lab computer.
3. Change to the debugger directory
Chdir/opt/Intel/XDB/1.0.xxx
4. Start XDB Debugger
./XDB. Sh
5. If the connection fails, check the Linux Console window.
DebuggingLinuxKernel
Click here to download and view the full text