Building a Simple Operating System

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.

sudo apt-get install nasm
sudo apt-get install cdda2wav cdrecord mkisofs
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:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store