Skip to content

CMake Script & Project Toolset for Linux Kernel / Kernel Module Support

Notifications You must be signed in to change notification settings

gunnerDgd/klever

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KLEVER - CMake Linux Kernel / Kernel Module Toolset


Use with CLion


  • First of all, build and generate kernel image (bzImage). Just build (Kernel Name)-build target in CLion.

  • When build progress finished, open CLion's Run / Debug Configuration.

  • Add "Remote Debug" to attach GDB (Debugger) to compiled kernel, which is being run at QEMU.

  • Set name, symbol file (vmlinux) 's location and QEMU's local provision port at configuration.
  • Default GDB provision port is "1234".

  • Execute QEMU by pressing "build" button for CMake target added with add_kernel_target().

  • QEMU window will appear and kernel will wait any GDB connection.

  • Let's Set Breakpoint at start_kernel() function, the entrypoint of the Linux kernel.
  • start_kernel() function is located at (Kernel Path)/init/main.c.

  • Run GDB using setting we have made. This will resume the QEMU machine and invoke breakpoint.
  • If kernel stopped execution at the breakpoint we set, You're ready to go!

About

CMake Script & Project Toolset for Linux Kernel / Kernel Module Support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages