You copied the Doc URL to your clipboard.

Configuring a connection to a Linux kernel

Use these steps to configure a connection to a Linux target and load the Linux kernel into memory. The steps also describe how to add a pre-built loadable module to the target.

Before you begin

For a Linux kernel module debug, a Remote Systems Explorer (RSE) connection to the target might be required. If so, you must know the target IP address or name.

Procedure

  1. From the Arm Development Studio main menu, select File → New → Hardware Connection.

  2. In the Hardware Connection dialog, specify the details of the connection:

    1. In Debug Connection give the debug connection a name, for example my_linux_kernel_connection and click Next.

    2. In Target Selection select a target, for example Juno Arm Development Platform (r2) and click Finish to complete the initial configuration of the connection.

      Name the Linux kernel connection
  3. In the Edit Configuration dialog, use the Connection tab to specify the target and connection settings:

    1. In the Select target panel, browse and select Linux Kernel and/or Device Driver Debug operation, and further select the processor core you require.
    2. Select your debug hardware unit in the Target Connection list. For example, DSTREAM Family.
    3. If you need to, Edit the Debug and Trace Services Layer (DTSL) settings in the DTSL Configuration Editor to configure additional debug and trace settings for your target.
    4. In the Connections area, enter the Connection name or IP address of your debug hardware adapter. If your connection is local, click Browse and select the connection using the Connection Browser.
  4. Use the Files tab to specify your application and additional resources to download to the target:

    1. If you want to load your application on the target at connection time, in the Target Configuration area, specify your application in the Application on host to download field.
    2. If you want to debug your application at source level, select Load symbols.
    3. If you want to load additional resources, for example, additional symbols or peripheral description files from a directory, add them in the Files area. Click Add resource to add resources, click Remove resources to remove resources.
  5. Select the Run control area in the Debugger tab to configure debugger settings:

    1. Select Connect only and set up initialization scripts as required.

      Note

      Operating System (OS) support is automatically enabled when a Linux kernel vmlinux symbol file is loaded into the debugger from the Arm Debugger launch configuration. However, you can manually control this using the set os command.

      For example, if you want to delay the activation of operating system support until the kernel has booted and the Memory Management Unit (MMU) is initialized, then you can configure a connection that uses a target initialization script to disable operating system support.

    2. Select Execute debugger commands option.

    3. In the field provided, enter commands to load debug symbols for the kernel and any kernel modules that you want to debug, for example:

      add-symbol-file <path>/vmlinux S:0

      add-symbol-file <path>/modex.ko

      Note

      • The path to the vmlinux must be the same as your build environment.
      • In the example above, the kernel image is called vmlinux, but this could be named differently depending on your kernel image.
      • In the example above, S:0 loads the symbols for secure space with 0 offset. The offset and memory space prefix is dependent on your target. When working with multiple memory spaces, ensure that you load the symbols for each memory space.
    4. The debugger uses your workspace as the default working directory on the host. If you want to change the default location, deselect the Use default option under Host working directory and specify a new location.

    5. In the Paths area, specify any directories on the host to search for files of your application using the Source search directory field.

    6. If you need to use additional resources, click Add resource (+) to add resources, click Remove resources (-) to remove resources.

  6. If required, use the Arguments tab to enter arguments that are passed to the main() function of the application when the debug session starts. The debugger uses semihosting to pass arguments to main().

  7. If required, use the Environment tab to create and configure environment variables to pass into the launch configuration when it is executed.

  8. Click Apply to save the configuration settings.

  9. Click Debug to connect to the target and start the debugging session.

    Tip

    By default, for this type of connection, all processor exceptions are handled by Linux on the target. Once connected, you can use the Manage Signals dialog box in the Breakpoints view menu to modify the default handler settings.