Building a Simple Operating System

kavi_os

Kavindu Gayantha
2 min readJun 11, 2019
Image result for operating system
https://cdn-images-1.medium.com/max/1600/1*72cktuehSngJboCjBkOXew.jpeg

Lets see how to make a simple operating system. First of all we should be having some files to implement this simple OS. I associated mike OS , josh OS and aqua_seven_os to make this OS. I made a simple OS that shows only Hardware information of our device, when running on Ubuntu terminal.

so that we have to download two things before starting of making the operating system.

nasm

nasm is for converting .asm files to .bin files. Before start making the operating system we need to download this with ubuntu terminal. Code is given below.

sudo apt-get install nasm

qemu

qemu is used for making the operating system run on our Ubuntu OS terminal.

sudo apt-get install qemu 

How to build

sudo bash ./build-linux.sh

How to run on Ubuntu terminal

sudo qemu-system-i386 -soundhw pcspk -drive format=raw,file=disk_images/kavios.flp,index=0,if=floppy

Then qemu make the operating system run.Lets see the parts of the operating system.

Kernel :

first of all we have to build the kernel. Vernal is the main part of the operating system that can access all the I/O devices and the processor.It’s like the heart of the operating system , so kernel is the main part of an operating system , ours is same.

we can write the kernel file with c or c++ or assembly language however after that we have to transform it into .bin file.

reference:

files in kavi os

source/ — entire OS source code.

source/bootload/ — Source to generate bootload.bin ,that is added to the disk image when building.

source/features/ — Components of the operating system such as keyboard and screen.

source/kernel.asm —can be called as the heart of the operating system.

programs/ — Source code for programs which is added to the disk image.

This is how kaviOs looks like when running on qemu ,

The full code is given here. i made this to run on ubuntu so in the directory of kavi os open terminal and type

sudo qemu-system-i386 -soundhw pcspk -drive format=raw,file=disk_images/kavios.flp,index=0,if=floppy
displaying hardware information after running the kaviOs on terminal

--

--

Kavindu Gayantha

Software Engineering final year undergraduate of University of Kelaniya, Sri Lanka