Building a Simple Operating System

dilusha sandaruwani
2 min readJul 26, 2020

--

What is the OS:-An Operating system is system software that manages computer hardware and software resources and provides common services for computer program.

Introduction

This is a simple guidance of showing how to implement an OS using Assembly language to show hardware information of a computer. In this article this task is performed in Linux based OS called Ubuntu. This OS can be bootable through floppy disk, CD Rom & USB.

Pre-Requisites for Creating OS

We need to gain Basic knowledge of assembly language.

This task is performed in Ubuntu.So below mentioned tools should be installed to coding.

  1. NASM Installation — This tool can be installed using terminal in Ubuntu following code.
sudo apt-get install nasm

2. mkisofs Installation -This is to generate a CD-ROM ISO image of OS

sudo apt-get install cdda2wav cdrecord mkisofs

3. QEMU — This is an emulator and this is to run .flp/.iso file that we needed.

sudo apt-get install qemu

File Containing the OS

  • programs/ — Source code for programs added to the disk image.
  • source/ — Contains the entire OS source code.
  • source/bootload/ — Source to generate BOOTLOAD.BIN, which is added to the disk image when building.
  • source/features/ — Components of dilu OS(keyboard and screen).
  • source/kernel.asm — The core kernel source file, which pulls in other source files.

CODE

You can find the full source code from this link.

Build the OS

To build the OS open the terminal in the folder which contain the source files of the OS and enter the following code.

sudo bash ./build-linux.sh

Run the OS

To run the OS open the terminal in the folder which contain the source files of the OS and enter the following code.

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

This is how “dilu OS” looks like:

References:

--

--

dilusha sandaruwani
dilusha sandaruwani

Written by dilusha sandaruwani

Software Engineering undergraduate at University of Kelaniya

No responses yet