Share via


KITL Code Overview (Compact 7)

3/12/2014

Because the kernel independent transport layer (KITL) is the transport mechanism that you use to debug the kernel, we strongly recommend that you support it for board support package (BSP) development. For security reasons, we recommend that you disable KITL in any device that you release.

Some KITL support functions are implemented in the kernel’s KITL library (kitlcore.lib). You do not need to modify these KITL support functions; you only need to modify the OEMKitlStartup function, which is in the OAL. The following are typical BSP KITL code locations:

  • Platform\Common\Src\Common\KITL
  • Platform\<BSP Name>\Src\KITL
  • Platform\Common\Src\<CPU Family>\Common\KITL

The following table lists the main KITL functions. Other related functions are described in Kernel Independent Transport Layer.

Purpose Function name Typical file name

Initializes KITL

OALKitlInit, OEMKitlInit

kitl.c

Starts KITL

OEMKitlStartup, StartKitl

kitl.c

You can use the common implementation of OALKitlInit, OEMKitlInit, and StartKitl, but you will need to customize OEMKitlStartup for your hardware platform. OEMKitlStartup is the entry point to kitl.dll. It reads any boot arguments, chooses and initializes the KITL hardware transport, and calls OALKitlInit. OALKitlInit sets KITL to use active or passive mode, interrupt-driven or polled transport, initializes the KITL variables, such as function pointers for each required KITL function, and then starts KITL. (For information about the difference between active and passive mode, or interrupt-driven and polled transport, see Kernel Independent Transport Layer.)

The following figure shows the KITL startup sequence.

KITL startup sequence

Below is a description of the KITL startup sequence shown in the figure.

  1. During the system startup process, the OEMInit function calls KITLIoctl with IOCTL_KITL_STARTUP as the IOCTL. (For the sequence of events leading to this point, see Startup (OAL).)
  2. The KITLIoctl function, which is implemented in the kernel (kitlcore.lib), calls the OEMKitlStartup function, which is implemented in the OAL. The OEMKitlStartup function reads the boot arguments, chooses and initializes the KITL hardware transport (such as an Ethernet controller), and sets up data structures to contain the KITL parameters and the KITL device information. The OEMKitlStartup function is the primary function that you customize to use KITL with your hardware platform.
  3. The OEMKitlStartup function calls the OALKitlInit function, passing in a parameter that determines whether KITL will be used in active or passive mode (these modes are described below). The OALKitlInit function is implemented in the BSP common KITL library (oal_kitl.lib).
  4. The OALKitlInit function calls the KitlInit function, which is implemented in the kernel (kitlcore.lib). The KitlInit function’s main task is to call the StartKitl function, which is also implemented in the kernel (kitlcore.lib).
  5. The StartKitl function detects and initializes the Ethernet hardware and calls the BSP functions described below.
    1. The StartKitl function calls the OEMKitlInit function, which is implemented in the common KITL library (oal_kitl.lib). If the KITL connection is over Ethernet, the OEMKitlInit function calls the OALKitlEthInit function. If the KITL connection is serial, the OEMKitlInit function calls the OALKitlSerialInit function.
    2. The StartKitl function then calls the KITLConnectToDesktop function, which is implemented in the kernel (kitlcore.lib), to exchange transport information with the development computer.
    3. Finally, if interrupt-mode KITL is used (which is optional), the StartKitl function calls the KITLInitializeInterrupt function, which is also implemented in the kernel (kitlcore.lib), to start the interrupt service routine (ISR) thread and unmask the hardware interrupts.

See Also

Concepts

BSP Code Overview