• Segmented Memory Model

    Remember we are in 16 bit mode. That means the size of every register is 16 bit only. So how much memory can we access using a 16-bit address? 2^16 = 65,536 Bytes that’s only 64 KB.

    But 64 KB was not sufficient as the complexity of the software grows the demand for memory also increased with it.

    Intel solution to this was using a 20 bit address line instead of 16 bit. This would increase the memory accessible from 64 KB to 1 MB.

    2^20 = 10,48,576 that would be 1 MB.

  • Hello World from bootloader

    What next?

    To give you a picture of where we are heading to.

    Right now we’re in 16 bit mode and we want to start our kernel which would be in 64 bit mode. We have to do the following steps before we can even do that.

    1. Find and load our kernel into RAM.
    2. Setup and enter 32 bit mode.
    3. Setup and enter 64 bit mode.
    4. Prepare information which would be passed to kernel.
    5. Call our kernel.

    It would be going to be a information overload from here onwards.

  • Let's write a bootloader

    When you press the power button

    It all starts with you pressing the power button. A signal is passed to your motherboard and it’s the forward signal to PSU (Power Supply Unit) and it starts powering the rest of the system if PSU is able to supply power without any major problem it sends a power_good signal to motherboard BIOS. BIOS then runs BIOS POST(Power on self-test) and a lot of other things. If you want to get an in-depth idea about this goto link 1 and link 2

  • Environment Setup

    Before we can start with the coding part you would need some of the tools to build and run our OS. Generally, this setting up cross compiler setup with other tools for OS development is very much platform-dependent and required you to know a lot of things even before you start. In this series, I try to make OS development platform-independent using docker for the compiler setup.


    Apart from these, this series expect that you know following things

    • Have done some programming before.
    • Atleast have heard about CPU registers.
  • lilith OS

    Today while browsing hacker-news I found a new hobby OS. link

    I too have tried writing OS from scratch but lost the interest mid-way. I wanted a GUI system in my OS but that required too many things to do before and I was kind of lost where I couldn’t find much motivation to continue. So I left it there and never got time to start it again.

    But today I have a hobby OS which has a GUI ready to start with. What got my motivation kicked in that it is written in Crystal. Since I’m working on ruby as my day-to-day job I can easily jump in crystal.

    More of all I was looking for a side project to kill my free time. So It might be an excuse but I’m excited about it. Let’s see how far can take this.

  • Compiling lillit OS in macos

    So the first thing I tried to do was to compile the OS and enjoy it. Well no so fast. I just forgot that I’m now on macos.

    When I ran the first make command make toolchain/crystal/.build/crystal it failed. I haven’t opened make file in years so I tried to avoid opening it. Googled the error so if it’s some generic error or not. Couldn’t find anything significant so have to get to make file. After little tinkering figured out that it was patching the crystal compile and it was failing in that step. In short, I got down to the crystal wrapped and found that path for crystal was incorrect for my installation.

    After fixing the crystal path another roadblock was just waiting for me. It was using gcc assembler. So I tried installing gcc assembler. Had no luck.

    Finally, I decided to use ubuntu for it. So I could install ubuntu, use docker or just a few days back read about ubuntu vm using multipass. I thought this is the perfect time to try this. Booted a VM installed bunch of tools things were going good when I hit another error. Which was strange. So I decided to run each command one by one for installing gcc. Then I learned VM was out of disk space. I did google a bit but can’t find much to increase the disk size.

    One thing is clear it would take a lot of effort to build this thing in mac.

    Anyways I would now be starting my project taking help from the very first commit of lillt OS. Learning from this I would be automating the build process using docker.

  • Hello world

    2 am

    Reading the book on Information Retrieval. I get really excited about this topic and planned to write a series of blog post to explain the concept in simpler and organized way. Atleast that what I hope for.

    2:15 am

    I’m so much excited just by thinking that finally i would start my blog that I stopped reading the book and started setting up the blog in my system.

    4 am

    Finally got everything working. BTW I wasn’t even aware that we can push jekyll code directly to the github repo and github would build the site and then host it. I used to think of GitHub pages as proxy to but turns out it not works like that.

    It simplified my work flow so much.

    Finally finished writing this blog. Actually I wrote a different one by system got restarted and lost all the changes. Yes, I know it would auto save but i guess i luck was not with me this time.

subscribe via RSS