Welcome to the Linux Foundation Forum!

How to compile the kernel, and debug it

Posts: 1
edited April 2020 in Kernel Development

Hello,

I am getting back into kernel development, and it appears that the linux kernel's build system has changed. I am trying to debug it on Debian, and I am wondering what the steps are to compile the debug version, install it, and then debug it. Is there a guide anywhere?

Comments

  • Posts: 4
    edited April 2020

    I use a custom script. from /usr/src/linux

    Core part is,

    1. make oldconfig (or menuconfig)
    2. make clean
    3. make -j8 KALLSYMS_EXTRA_PASS=1 LOCALVERSION=-custom

    Then you can prepend with, if needed, ARCH and CROSS_COMPILE variables.

    To debug, debug symbols should be enabled in menuconfig.

    Then of course you may also check the official guide of your distribution.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training