Making a Small OS

Booting

Umayanga Vidunuwan
2 min readJul 14, 2021

We have to do this in a virtual environment because the operating system we use may suffer some damage during this process. Therefore I install the VirtualBox in my Windows Operating System. And I install Ubuntu in my virtual environment.

OS has to be written in assembly code. In this process I learnt so many things about the booting an operating system

First compiling Operating System, The file contain assembly code compile into a 32 bits ELF object file. The code must now be linked to produce an executable file, which requires some extra thought compared to when linking most programs. We want GRUB to load the kernel at a memory address larger than or equal to 1 megabyte (MB), because addresses lower than 1 MB are used by GRUB itself, BIOS and memory-mapped I/O.

We need to create the kernel ISO image. After the creating ISO file We can run the OS in the Bochs emulator using the ISO image.

After quitting Bochs, display the log produced by Boch using cat bochslog.txt

Now see the contents of the registers of the CPU simulated by Bochs somewhere in the output. If RAX=00000000CAFEBABE or EAX=CAFEBABE in the output then your OS has successfully booted.

--

--

Umayanga Vidunuwan

| Software Engineering Undergraduate| University Of Kelaniya | Sri Lankan|