Introduction to Rio Operating System

Charith Wijebandara
4 min readJul 25, 2020

--

Through this blog article I will give you an understanding about the structure,code path and implementation process of Rio OS as well as how to try out it in your computer.

Rio Operating System is a simple operating system written in assembly language. Main task of Rio OS is to show hardware details of your Computer.

Structure of Rio OS

These are the most important files and directories in the Rio Operating System.

  • 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 Rio OS such as keyboard and screen.
  • source/kernel.asm — The core kernel source file, which pulls in other source files.

Code path of Rio OS

When the PC starts up, it loads the bootblock, bootload.bin, that was inserted into the first sector (512 bytes) of the floppy disk image by the build script. It loads this at memory location 31744 (7C00h in hex) and begins executing it.

bootload.bin then scans the floppy disk for kernel.bin and loads it at memory location 2000h:0000h.

Once the bootloader has loaded the kernel, it jumps to memory location 2000h:0000h to begin executing it. We have a list of vectors right at the very start of the kernel which jmp to specific system calls, so an external program can call these vectors.

Then the main kernel execution starts, setting up various things and offering the user a choice of a Hardware Information screen or Exiting the System.

How I implemented Rio Operating System

First I read the reference articles and Mike OS Documentation to get an idea of what needed to be Done.By reading those , I also got a good understanding about the fundamentals of Assembly language which is a must to implement the OS.

Since we don’t have the knowledge to implement a bootloader I used the bootloader of Mike OS as the bootloader for my Rio OS. After that I started to implement the Kernel of Rio OS. For that I had to install nasm, an assembler which can be install using the ubuntu terminal with the following code.

             sudo bash apt-get install nasm

After developing the first parts of the kernel code I needed to get hardware details of computer.

For that I used two ways,

  • To get Processor details I used CUPID, a special command provided by processor manufactures.
  • To get Memory ,Hard Drive and Serial Port details I used Hardware interrupts.

Through the implementation process, to build and run my OS i used following codes in ubuntu terminal.

To build:

                   sudo bash ./build-linux.sh

To Run OS in QEMU Emulator:

        qemu-system-i386 -fda ./disk_images/rioos.flp

By Using Those Steps I was able to develop this simple OS to Show Hardware Information.

How Rio OS Looks Like

Rio Operating System consists of two separate windows, Welcome Screen and Hardware Information Screen.

Welcome screen provides you two options.

  • Go to Hardware Information Screen by selecting Hardware Info option.
  • Quit the OS by selecting Exit option.

Hardware Information Screen shows the following hardware information of your computer.

  • Processor Vendor ID
  • Processor Type and Speed
  • Base Memory
  • Extended Memory Between( 1M-16M)
  • Extended Memory Above 16M
  • Total Memory
  • No of Hard Drives
  • No of Serial Ports
  • Base I/O address for Serial Port 1 (Only if your computer has a Serial Port)

How you can try out Rio OS

The Best and Easiest way to try out Rio OS is by using an Emulator or Virtual Thing.

Using QEMU Emulator:

  • First Download Rio OS by this Link.

https://github.com/CharithNiroshan/Rio-OS

In linux

  • Install QEMU and nasm on your Computer by running the following code in linux terminal.
        sudo apt-get install build-essential qemu nasm
  • Next open Rio OS folder and open the terminal from that location.And then compile and built Rio OS by running this command.
                       sudo bash ./build-linux.sh
  • Then Run this command in the terminal to try out Rio OS through QEMU Emulator.
            qemu-system-i386 -fda ./disk_images/rioos.flp

2. In Windows

  • Get the latest version of nasm for Windows and Then extract the nasm.exe file into your Windows folder
  • Then download and install ImDisk Virtual Disk Driver. Get it from here.Also get PartCopy for copying the bootloader on to the disk image.
  • Then to build MikeOS, double-click on build-win.bat or run it from the command line.
                 imdisk -a -f mikeos.flp -s 1440K -m B:
  • At last to test in the QEMU PC emulator, Extract QEMU to somewhere on your computer.Then enter the following to run MikeOS under QEMU:
 qemu.exe -L . -m 4 -boot a -fda mikeos.flp -soundhw all -localtime

Thank You.Hope you all enjoyed and learned something on this.

References

--

--