DEV Community

Cover image for How I built a Linux Distribution from scratch for my sister
Achinthya J
Achinthya J

Posted on

How I built a Linux Distribution from scratch for my sister

Before you read this I want to express that this is my first blog ever and I have no previous experience of writing blogs

How it was decided

I wanted to make something truly fascinating as a gift for my sister.
She inspired me to start coding, and so I decided that I will build an Operating System for her.

This was going to be hard and something that I would prefer working on even not as a gift. And then began Project Leviathan

What I chose

I first took a look at the available options, I could try archiso which was nice to try but for me it wasn't something I would want to consider as mine. On the other end, trying to build a kernel, initramfs, and other core components of an OS all by myself was beyond what I could build in a week.

So it was decided,I was going to use the linux kernel, but would build the userspace, drivers, graphics stack, and others by myself basically a Linux Distribution

First steps

First I began researching on what I really needed to build a Linux Distribution. For most of the research of it I used ChatGPT. Also in order to build a OS I need to learn C. I settled with the basics, pointers, and other stuff.

And then it began, I started with a simple directory and grub configurations along with my linux kernel linux-6.8.0-138-generic kernel, so that grub would find and detect it.

The Userspace

Since pretty much every part of it was still from my ubuntu installation, the first userspace was just a Busybox shell provided by my installation. But of course I had to change it. I started with a simple virtual userspace using the TTY subsystem of linux with just echo and cat, according to me quite a important feature.

After quite a bit I got it working, and therefore had my first ever minimal userspace. It still worked on busybox but the TTY only worked with my commands. Soon enough I removed Busybox entirely and at added other essential commands such as ls, rm, copy, mkdir, and pwd.

The first graphics stack

Since most of my TTY was done, I figured it was a good time to get started on the graphics stack. First it started with a simple graphics stack. With a simple picture of a leviathan. Then I went ahead and built an animated leviathan(2d) then I soon went ahead and built a 3d renderer of a leviathan with splines and nodes.

The First UI

It was soon time to build the UI itself. If I needed a OS I need some UI to make it actually run software. I started with a regular UI in C language. But for me it seemed to inefficient so I switched to Rust which provided more capabilities. This wasn't a thoughtful decision but it seemed right. And within a few hours I had the first UI in rust. It was simply a terminal and a settings app.

The Package Manager

This was one of the most difficult part of the project for now. It took me a long time to figure out apt package manager, due to a lot of dpkg errors and dependency errors. I hadn't researched properly enough and was trying to force my own apt package manager from my host OS into Leviathan. But then I eventually found debootstrap and utilized it for apt package manager.

The Window Manager

Well I did get the package manager running to use software but without a window manager, the apps essentially wouldn't even launch. Hence, I had to build a window manager which was able to run all kinds of apps properly with the use of essential drivers.

The fun part

Now it came to finally customizing it to my sister's liking. First I needed a cinematic... Yes... the kind you see in games. And because it was a birthday gift I had to make it birthday themed. I got a cute 2d cat image from the internet and generated a warm feeling room with a table using leanardo.ai and then came the birthday song I got the song randomly and got a cake image from the internet and using gemini added candles and added two states, lit candles and lit off candles. So when she blew the candles(like by clicking space button) it would change to the lit off state.

Then I wanted to show my appreciation, and what would be better than prizes, so using a random image of a prize from the internet and a achievement sound I added a few prizes and using a image editor tool I added the prizes on the table with each prize when clicked will change to the next image without that prize, it is very inefficient but good enough for quite a small cinematic.

Then I added a gift box under the table of the room which when clicked shows a number of handwritten letters from a website called writebyhand.in which are heartfelt real letters written by me, my parents, and one of her friends. This was meant to feel like a real gift with the letters accompanied by some photos. It is truly a token of appreciation for her achievements and inspiration

And then finally I made a custom UI for Incy OS itself which was all cat themed OS, and also a custom homepage for firefox which was themed and renamed kittyfox.

Conclusion

In the end my sister was very happy with the Operating System itself, even though it does need a lot of polish and currently unusable, I will try my best to work on it and maybe one day, she will prefer Incy OS over other linux distributions. But for now, for this day atleast she got a gift that made her pretty satisfied. I will continue to work on Incy OS and Leviathan OS and push code and releases to https://github.com/AchinthyaJ/Leviathan-OS
Hope this short blog about my journey helped you with something

Thank you for reading!

Top comments (1)

Collapse
 
incharajayaram profile image
Inchara J

The efforts 🥺🫡🫡