{"id":114,"date":"2018-02-05T15:31:13","date_gmt":"2018-02-05T23:31:13","guid":{"rendered":"https:\/\/sysprogs.com\/tutorials\/?p=114"},"modified":"2018-02-06T18:57:36","modified_gmt":"2018-02-07T02:57:36","slug":"building-and-modifying-linux-kernel-with-visual-studio","status":"publish","type":"post","link":"https:\/\/sysprogs.com\/VisualKernel\/tutorials\/kernel\/","title":{"rendered":"Building and modifying Linux Kernel with Visual Studio"},"content":{"rendered":"<p>This tutorial shows how to build the Linux kernel, add a small modification to it and debug the new kernel using Visual Studio with VisualKernel.<\/p>\n<p>We will use a Kubuntu machine to build the\u00a0stock kernel provided by the distribution and then modify it so that it shows how much time has elapsed since loading of each kernel module.<\/p>\n<ol>\n<li>Before we begin modifying the kernel we should create a Visual Studio project for it. Open Visual Studio and start the\u00a0<strong>Custom Linux Kernel Wizard<\/strong>\u00a0in the VisualKernel folder:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-194\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/01-prj.png\" alt=\"\" width=\"837\" height=\"603\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/01-prj.png 837w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/01-prj-300x216.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/01-prj-768x553.png 768w\" sizes=\"(max-width: 837px) 100vw, 837px\" \/><\/li>\n<li>On the first wizard page select the remote machine you want to target. Ensure your Linux user account is in the sudoers group, as otherwise it won&#8217;t be able to install the kernel:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-195\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/02-target.png\" alt=\"\" width=\"822\" height=\"642\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/02-target.png 822w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/02-target-300x234.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/02-target-768x600.png 768w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/li>\n<li>On the next page select &#8220;automatically download sources for the current kernel&#8221;. This will work for the\u00a0<a href=\"http:\/\/sysprogs.com\/VisualKernel\/?page=os_support\">most popular Linux distributions<\/a>. If you are not running one of them, you can also specify a pre-configured kernel source directory:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-196\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/03-auto.png\" alt=\"\" width=\"822\" height=\"642\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/03-auto.png 822w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/03-auto-300x234.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/03-auto-768x600.png 768w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/>For all new projects we recommend using the Advanced Kernel Project Subsystem as it is\u00a0especially designed to handle the huge Linux kernel\u00a0codebase.<\/li>\n<li>VisualKernel will start downloading the kernel package and preparing it to build. This can take 5-10 minutes depending on your Internet connection speed:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-197\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/04-getsource.png\" alt=\"\" width=\"736\" height=\"553\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/04-getsource.png 736w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/04-getsource-300x225.png 300w\" sizes=\"(max-width: 736px) 100vw, 736px\" \/><\/li>\n<li>Once the kernel source package is setup, the wizard will ask you for a directory on the Windows machine where the sources will be copied. Note that Linux Kernel source is huge so ensure you have enough free space on your disk:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-198\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/05-getfiles.png\" alt=\"\" width=\"822\" height=\"642\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/05-getfiles.png 822w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/05-getfiles-300x234.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/05-getfiles-768x600.png 768w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/li>\n<li>Once you click &#8220;Next&#8221; VisualKernel will start downloading the source code to the Windows machine:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-199\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/06-download.png\" alt=\"\" width=\"696\" height=\"209\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/06-download.png 696w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/06-download-300x90.png 300w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/li>\n<li>On the last wizard page select the method you want to use to connect to the kernel. If your changes do not depend on custom hardware, we recommend\u00a0a VMWare virtual machine with a VMWare-specific debug connection. This connection method utilizes the highly reliable gdb stub that runs inside VMWare and outside the target kernel and hence won&#8217;t be affected\u00a0if the kernel freezes:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-145\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/08-debug.png\" alt=\"\" width=\"822\" height=\"642\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/08-debug.png 822w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/08-debug-300x234.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/08-debug-768x600.png 768w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/li>\n<li>Press &#8220;Finish&#8221; to complete the wizard. VisualKernel will create the project and start querying the project structure from KBuild:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-201\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/08-loading.png\" alt=\"\" width=\"997\" height=\"652\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/08-loading.png 997w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/08-loading-300x196.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/08-loading-768x502.png 768w\" sizes=\"(max-width: 997px) 100vw, 997px\" \/>Note that the first load may take several minutes (VisualKernel relies on KBuild to report build arguments for each source file inside the kernel in order to build accurate IntelliSense database). Once the project is loaded, VisualKernel will cache its structure and will\u00a0re-query it in the background if it detects\u00a0changes to project files.<\/li>\n<li>Once the project is loaded, all source files relevant to your target platform will appear in Solution Explorer:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-202\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/09-loaded.png\" alt=\"\" width=\"997\" height=\"652\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/09-loaded.png 997w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/09-loaded-300x196.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/09-loaded-768x502.png 768w\" sizes=\"(max-width: 997px) 100vw, 997px\" \/><\/li>\n<li>Build\u00a0the project\u00a0by pressing Ctrl-Shift-B. Note that the kernel is huge so it may take up to 2-3 hours to build. If\u00a0your Linux machine has multiple cores, VisualKernel will automatically detect it and run the multi-threaded build. Once the build is complete, VisualKernel will list the missing steps before you can test it out:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-203\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/10-built.png\" alt=\"\" width=\"997\" height=\"652\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/10-built.png 997w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/10-built-300x196.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/10-built-768x502.png 768w\" sizes=\"(max-width: 997px) 100vw, 997px\" \/><\/li>\n<li>Install the kernel by right-clicking on it in Solution Explorer and selecting &#8220;Advanced -&gt; Install Kernel with Modules&#8221;:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-204\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/11-install.png\" alt=\"\" width=\"997\" height=\"652\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/11-install.png 997w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/11-install-300x196.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/11-install-768x502.png 768w\" sizes=\"(max-width: 997px) 100vw, 997px\" \/><\/li>\n<li>Now we will test the debugging. Reboot your Linux machine so that the new kernel is loaded. Then press F5 to start debugging. If you are debugging this kernel for the first time VisualKernel will take some time to index the in-tree kernel modules:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-205\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/12-modules.png\" alt=\"\" width=\"997\" height=\"652\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/12-modules.png 997w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/12-modules-300x196.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/12-modules-768x502.png 768w\" sizes=\"(max-width: 997px) 100vw, 997px\" \/><\/li>\n<li>Set a breakpoint inside the\u00a0<strong>load_module()<\/strong>\u00a0function. Then go to the SSH Console and type the following commands:\n<pre class=\"code\">sudo rmmod floppy\r\nsudo modprobe floppy<\/pre>\n<p>As you can see, the\u00a0<strong>load_module()\u00a0<\/strong>function allocates the\u00a0<strong>mod<\/strong>\u00a0object that stores various information about the module:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-206\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/13-floppy.png\" alt=\"\" width=\"1113\" height=\"674\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/13-floppy.png 1113w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/13-floppy-300x182.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/13-floppy-768x465.png 768w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/13-floppy-1024x620.png 1024w\" sizes=\"(max-width: 1113px) 100vw, 1113px\" \/><\/li>\n<li>Now we will modify the kernel to store the load time of each module. Right-click on the\u00a0<strong>module<\/strong>\u00a0word and select &#8220;Go to Definition&#8221;.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-207\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/structmod.png\" alt=\"\" width=\"1169\" height=\"710\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/structmod.png 1169w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/structmod-300x182.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/structmod-768x466.png 768w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/structmod-1024x622.png 1024w\" sizes=\"(max-width: 1169px) 100vw, 1169px\" \/><\/li>\n<li>Add the following field to the end of the\u00a0<strong>struct module<\/strong>:\n<pre class=\"code\">time_t module_load_time;<\/pre>\n<\/li>\n<li>Add the following line to\u00a0<strong>load_module()<\/strong>\u00a0after\u00a0<strong>mod\u00a0<\/strong>is allocated and checked:\n<pre class=\"code\">mod-&gt;module_load_time = get_seconds();<\/pre>\n<\/li>\n<li>Now we will find the code that manages the\u00a0<strong>\/proc\/modules<\/strong>\u00a0file. Search for &#8220;modules&#8221; (with quotes):<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-208\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/modules.png\" alt=\"\" width=\"1169\" height=\"710\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/modules.png 1169w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/modules-300x182.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/modules-768x466.png 768w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/modules-1024x622.png 1024w\" sizes=\"(max-width: 1169px) 100vw, 1169px\" \/><\/li>\n<li>Go to definition of\u00a0<strong>modules_open()\u00a0<\/strong>and then to definition of\u00a0<strong>modules_op\u00a0<\/strong>and\u00a0<strong>m_show<\/strong><strong>()<\/strong>. Add the following line before the last call to\u00a0<strong>seq_printf()<\/strong>:\n<pre class=\"code\">seq_printf(m,\u00a0\" [loaded %d seconds ago]\",\u00a0get_seconds() - mod-&gt;module_load_time);<\/pre>\n<\/li>\n<li>Open VisualKernel Project Properties and enable automatic installation of the kernel\u00a0after build:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-210\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/14-inst.png\" alt=\"\" width=\"1105\" height=\"682\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/14-inst.png 1105w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/14-inst-300x185.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/14-inst-768x474.png 768w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/14-inst-1024x632.png 1024w\" sizes=\"(max-width: 1105px) 100vw, 1105px\" \/><\/li>\n<li>Press Ctrl-Shift-B to build the modified kernel. Note that VisualKernel will only re-upload the 2 source files you modified. However as the modified\u00a0<strong>module.h\u00a0<\/strong>is used by many other files, rebuilding the kernel will take a long time:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-209\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/15-installed.png\" alt=\"\" width=\"1113\" height=\"674\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/15-installed.png 1113w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/15-installed-300x182.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/15-installed-768x465.png 768w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/15-installed-1024x620.png 1024w\" sizes=\"(max-width: 1113px) 100vw, 1113px\" \/><\/li>\n<li>Restart your Linux machine so that the new kernel loads. Start debugging and run the following commands in the SSH Session window:\n<pre class=\"code\">sudo su\r\nsudo rmmod floppy\r\nsudo modprobe floppy\r\ncat \/etc\/modules | grep floppy<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-211\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/16-loaded.png\" alt=\"\" width=\"1113\" height=\"674\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/16-loaded.png 1113w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/16-loaded-300x182.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/16-loaded-768x465.png 768w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/16-loaded-1024x620.png 1024w\" sizes=\"(max-width: 1113px) 100vw, 1113px\" \/><\/li>\n<li>You will see that each line now contains the information about the load time. Set a breakpoint on the added seq_printf() call and re-run the last command again:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-212\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/17-puts.png\" alt=\"\" width=\"1113\" height=\"674\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/17-puts.png 1113w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/17-puts-300x182.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/17-puts-768x465.png 768w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/17-puts-1024x620.png 1024w\" sizes=\"(max-width: 1113px) 100vw, 1113px\" \/>You will be able to step through your new code and examine the variable values just like when debugging normal programs.<\/li>\n<li>Unlike the kernel module projects where VisualKernel will automatically edit the Makefile when you add\/remove files,\u00a0custom kernel projects won&#8217;t be automatically updated. You can still add\/remove files via Solution Explorer, however those changes won&#8217;t be preserved after you reopen the project. In order to physically add a new source file to the project, right-click on any of the sources in the same directory and select &#8220;Open Related Makefile&#8221;:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-214\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/18-makefile.png\" alt=\"\" width=\"1113\" height=\"674\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/18-makefile.png 1113w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/18-makefile-300x182.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/18-makefile-768x465.png 768w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/18-makefile-1024x620.png 1024w\" sizes=\"(max-width: 1113px) 100vw, 1113px\" \/><\/li>\n<li>Once the makefile is open, you can edit it to\u00a0update the actual files used by KBuild:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-213\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/19-opened.png\" alt=\"\" width=\"1113\" height=\"674\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/19-opened.png 1113w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/19-opened-300x182.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/19-opened-768x465.png 768w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/19-opened-1024x620.png 1024w\" sizes=\"(max-width: 1113px) 100vw, 1113px\" \/><\/li>\n<li>VisualKernel also provides convenient interface for configuring the kernel. Right-click on the kernel project and select &#8220;Configure Kernel Project&#8221;:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-215\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/20-config.png\" alt=\"\" width=\"1113\" height=\"674\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/20-config.png 1113w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/20-config-300x182.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/20-config-768x465.png 768w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/20-config-1024x620.png 1024w\" sizes=\"(max-width: 1113px) 100vw, 1113px\" \/><\/li>\n<li>Click &#8220;Launch graphical configurator&#8221;:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-216\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/21-xconfig.png\" alt=\"\" width=\"658\" height=\"189\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/21-xconfig.png 658w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/21-xconfig-300x86.png 300w\" sizes=\"(max-width: 658px) 100vw, 658px\" \/><\/li>\n<li>VisualKernel will automatically launch the xconfig\u00a0tool letting you tweak various\u00a0kernel settings directly\u00a0from your Windows machine:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-218\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/22-configwnd-1.png\" alt=\"\" width=\"1169\" height=\"710\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/22-configwnd-1.png 1169w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/22-configwnd-1-300x182.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/22-configwnd-1-768x466.png 768w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2018\/02\/22-configwnd-1-1024x622.png 1024w\" sizes=\"(max-width: 1169px) 100vw, 1169px\" \/>If you change the kernel configuration using xconfig, don&#8217;t forget to build and install the new kernel.<\/li>\n<\/ol>\n<p>You can avoid long build times and frequent restarts\u00a0by moving your experimental code to a kernel module and loading\/unloading it dynamically. Read\u00a0<a href=\"http:\/\/sysprogs.com\/VisualKernel\/legacy_tutorials\/kernel\/module\/\">this tutorial<\/a>\u00a0to learn\u00a0how to create modules for custom kernels built with VisualKernel.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to build the Linux kernel, add a small modification to it and debug the new kernel<\/p>\n","protected":false},"author":1,"featured_media":242,"comment_status":"closed","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[34],"_links":{"self":[{"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/posts\/114"}],"collection":[{"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/comments?post=114"}],"version-history":[{"count":6,"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"predecessor-version":[{"id":243,"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/posts\/114\/revisions\/243"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/media\/242"}],"wp:attachment":[{"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/tags?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}