Giter Club home page Giter Club logo

vscode-linux-kernel's Introduction

Visual Studio Code project for Linux kernel sources

Ensure the kernel is built (at least, all *.cmd files should be generated):

$ make defconfig
$ make

Clone this repository as ".vscode":

$ git clone [email protected]:amezin/vscode-linux-kernel.git .vscode

Generate compile_commands.json:

$ python .vscode/generate_compdb.py

If you are not compiling kernel for x64, change intelliSenseMode in c_cpp_properties.json. Possible values as of vscode-cpptools 1.0.1:

  • gcc-x86
  • gcc-x64
  • gcc-arm
  • gcc-arm64

Open the project:

$ code .

Out-of-tree builds

#4

Kernel can be built with separate output directory:

$ make O=../linux-build defconfig
$ make O=../linux-build

In this case, you should pass the directory to generate_compdb.py:

$ python .vscode/generate_compdb.py -O ../linux-build

compile_commands.json will still be generated in the current directory (root of the linux repository). Unfortunately, tasks.json will not work out of the box in this configuration (TODO).

Out-of-tree module development

If you build your module with this command:

$ make -C $KDIR M=$PWD modules

You could generate compile_commands.json with:

$ python .vscode/generate_compdb.py -O $KDIR $PWD

Example: https://github.com/amezin/nzxt-rgb-fan-controller-dkms

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.