Welcome to the Linux Foundation Forum!

How to compile the kernel, and debug it

Sp4rt4h
Sp4rt4h 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

  • opendrain
    opendrain Posts: 4
    edited April 2020

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

    Core part is,

    make oldconfig (or menuconfig) 
    make clean
    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.

Categories

Upcoming Training