Creating a simple OS using assembly language in windows

Peshala Dushyanthika
3 min readJul 26, 2020

--

Introduction

The netiOS kernel is written in 16-bit x 86 real mode assembly language. This gives the information of the hardware.First we need to have install few thing in our computer. We need to have nasm for convert our .asm file to .bin files.And a virtual box.

Structure

programs/..

Source code for programs added to the disk image

source/..

contains the entire OS source code

source/kernel.asm

It includes source code which needs to display the hardware information.

For create

what are the requirements?

The NASM assembler, dosfstools package, ‘mkisofs’ utility ,virtualbox and root access. We need root access because we loopback-mount the floppy disk image to insert our files.To create netiOS, open a terminal and switch into the expanded netiOS package.

This will use NASM to assemble the bootloader, kernel and supplied programs, then write the bootloader to the netiOS.flp floppy disk image in the disk_images/ directory.

The build script loopback-mounts the netiOS.flp image onto the file system — in other words, mounting the image as if it was a real floppy. The script copies over the kernel and binaries from the programs/ directory, before unmounting the floppy image.

What is the kernel?

The kernel is a computer program that is the core of a computer’s operating system,with complete control over everything in the system.Kernel is one of the first programs loaded on start-up(after the bootloader).

Go to source/kernel.asm

The source code for displaying hardware information is also included in kernel.asm

Build-linux.sh

This script assembles the netiOS bootloader, kernel and programs
with NASM, and then creates floppy and CD images .Only the root user can mount the floppy disk image as a virtual drive (loopback mounting), in order to copy across the files.

Bootloader

A bootloader, also known as a boot program or bootstrap loader, is a special operating system software that loads into the working memory of a computer after start-up. For this purpose, immediately after a device starts, a bootloader is generally launched by a bootable medium like a hard drive, a CD/DVD .The boot medium receives information from the computer’s firmware (e.g. BIOS) about where the bootloader is. The whole process is also described as “booting”.

How does a bootloader work?

When you press the start button on a computer, the very first thing you see on the screen is information about the hardware installed. The software responsible for this notification is the device firmware mentioned above, which is usually implemented by manufacturers in flash memory on the computer’s motherboard. With most desktop PCs and notebooks this will be the Basic Input/Output System or the more modern UEFI. Both applications collect the most diverse hardware data and create a complete list of all of the device’s available drives.

You can find source code go to source/bootload/bootload.asm

--

--

Peshala Dushyanthika
Peshala Dushyanthika

No responses yet