<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Kernel on Siddharth Mishra</title><link>http://brightprogrammer.in/tags/kernel/</link><description>Recent content in Kernel on Siddharth Mishra</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 13 Jun 2026 09:04:24 -0700</lastBuildDate><atom:link href="http://brightprogrammer.in/tags/kernel/index.xml" rel="self" type="application/rss+xml"/><item><title>Implementing Descriptor Tables</title><link>http://brightprogrammer.in/posts/implementing-descriptor-tables/</link><pubDate>Mon, 10 Jan 2022 00:00:00 +0000</pubDate><guid>http://brightprogrammer.in/posts/implementing-descriptor-tables/</guid><description>&lt;blockquote>
&lt;p>&lt;strong>WARNING&lt;/strong> : From here onwards you need some experience with &lt;code>x86_64&lt;/code> assembly. I&amp;rsquo;ve done some reverse engineering stuffs so I have some basic knowledge to find my way out of this. You&amp;rsquo;ll need something similar! You must have knowledge of what are registers, how many registers are there in amd64 architecture, what are the uses of those registers, etc&amp;hellip; Knowledge of more low level concepts will be a cherry on the top.&lt;/p></description></item><item><title>Creating Our Own 'puts'</title><link>http://brightprogrammer.in/posts/creating-our-own-puts/</link><pubDate>Sun, 09 Jan 2022 00:00:00 +0000</pubDate><guid>http://brightprogrammer.in/posts/creating-our-own-puts/</guid><description>&lt;p>Well, the title can be misleading. We will be eventually implementing our own &amp;lsquo;puts&amp;rsquo; function but for now it&amp;rsquo;s not named puts. The function will be analogous to puts. This function will actually be to help us debug things. After this chapter we will be adding more and more features to our OS and we need a method to see if it worked or not. This method can be anything! For eg : changing the screen colour to red (for error) or blue (for success). We print an error message if something bad happens.&lt;/p></description></item><item><title>Project Initialisation</title><link>http://brightprogrammer.in/posts/project-initialisation/</link><pubDate>Sat, 08 Jan 2022 00:00:00 +0000</pubDate><guid>http://brightprogrammer.in/posts/project-initialisation/</guid><description>&lt;p>We&amp;rsquo;ll use &lt;a href="https://github.com/limine-bootloader/limine">limine&lt;/a> bootloader and use stivale2 as our boot protocol. There are multiple boot protocols and stivale2 provides many advanced features. Limine supports stivale2 by default. It also gives us a way to instantly print anything on screen but we won&amp;rsquo;t be using that.
To read more about stivale2 boot specification, read &lt;a href="https://github.com/stivale/stivale/blob/master/STIVALE2.md">here&lt;/a>&lt;/p>
&lt;p>Create project with following directory structure&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── CMakeLists.txt
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── kernel
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│   ├── kernel.c
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│   ├── kernel.h
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│   └── stivale2.h
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>└── limine
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ├── bochsrc
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ├── build-aux
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#40a070">19&lt;/span> directories, &lt;span style="color:#40a070">183&lt;/span> files
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;code>kernel&lt;/code> will contain our kernel code. Soon we&amp;rsquo;ll be creating many other folders. Use &lt;code>wget&lt;/code> to get &lt;a href="https://raw.githubusercontent.com/stivale/stivale/master/stivale2.h">stivale2&lt;/a> header file. Initialise a git repository and add &lt;a href="https://github.com/limine-bootloader/limine">limine&lt;/a> boot loader as a &lt;code>submodule&lt;/code>.&lt;/p></description></item><item><title>System Boot</title><link>http://brightprogrammer.in/posts/system-boot/</link><pubDate>Sat, 08 Jan 2022 00:00:00 +0000</pubDate><guid>http://brightprogrammer.in/posts/system-boot/</guid><description>&lt;p>This will be a post on what actually happens when a system boots up.&lt;/p>
&lt;p>When system boots up motherboard first checks if all necessary components are attached or not. If they are not then it shows it&amp;rsquo;s tantrums that one needs to debug. Motherboard first initialises it&amp;rsquo;s firmware, i.e the chipset and other things needed for normal startup.&lt;/p>
&lt;p>Then the control is sent to the bootloader that is responsible for further initialisation of kernel which ultimately loads the complete OS. If on a multicore processor, one of the core is chosen dynamically (the bootstrap processor : BSP) and is given the responsibility to run the code for bootloader and kernel. The remaining cores remain halted unless being used explicitly by kernel or bootloader.&lt;/p></description></item></channel></rss>