GithubHelp home page GithubHelp logo

xlmeng1988 / debug_kernel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leapio/debug_kernel

0.0 0.0 0.0 52.19 MB

kernel debug module, can be

License: GNU General Public License v2.0

Shell 3.59% C++ 1.14% Python 0.98% Perl 0.17% C 84.72% Awk 0.01% Makefile 1.08% HTML 4.66% Yacc 0.14% Lex 0.06% Roff 3.45%

debug_kernel's Introduction

kernel_debug

  • A linux kernel debug env based on qemu and gdb

what you need

  1. linux kernel src (git clone from [email protected]:torvalds/linux.git)
  2. qemu
  3. cgdb
  4. ...

steps

  1. download linux kernel src and compile it to vmlinux (with debug_info and no any install)
  2. pull debug_kernel and put it in the first level of linux kernel src code
  3. cd debug_kernel && make mad (details are in Makefile)
    • gen manual ramdisk.img including busybox with the most basic linux cmd
  4. cd debug_kernel && make dr
  5. edit file gdbinit in first level and replace target remote:1236 of yours
    • 1236 is the gdbserver listen port, corresponding to the port you specify in Makefile
  6. cgdb -q -x gdbinit
  7. More details are in Makefile, you can choose kinds of blocks (ahci disk, nemv ssd, nvdimm, etc.) to debug corresponding driver and all parts in kernel, you can gen backend storage file by Makefile

features (details are in Makefile)

  1. debug kernel without block dev
  2. debug kernel with a ahci disk device in /dev
  3. debug nvdimm with a nvdimm device in /dev
  4. debug nvme ssd with a nvme ssd device in /dev
  5. debug pcie hba by vfio

cgdb

To be continued ...



debug_kernel's People

Contributors

doubledddd avatar xmucxx avatar h-weijie avatar xlmeng1988 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.