Debug Linux kernel pre-decompression stage

后端 未结 1 953
猫巷女王i
猫巷女王i 2021-02-10 07:37

I am trying to use GDB to debug a Linux kernel zImage before it is decompressed. The kernel is running on an ARM target and I have a JTAG debugger connected to it with a GDB ser

1条回答
  •  花落未央
    2021-02-10 08:23

    There are assembler macros that print out stuff when compiling with low level debug. You have to make sure the macros are appropriate for your board.

    linux-latest/arch/arm$ find . -name debug-macro.S | wc
     56      56    2306
    

    Find the file for your board and ensure the correct serial port registers are hit. You can instrument the code with out using JTAG. These macros are used in the decompress code. Of course configure with *CONFIG_DEBUG_LL*.

    Most likely the ATAGs are not correct or one of the other requirements. Checkout Documentation/arm/Booting to make sure you have registers set properly. Note there is a new requirement with recent kernels to send a dt list.

    0 讨论(0)
提交回复
热议问题