DEV Community

Cover image for Piko-piko OS. A homemade 16-bit x86 toy operating system for fun.
Techie Kho
Techie Kho

Posted on

Piko-piko OS. A homemade 16-bit x86 toy operating system for fun.

So I made a 16-bit x86 toy OS in pure assembly. 3 months ago, I found a very fun tutorial on github that is about Operating system development. I read the first few chapter and from there I made a very simple, extensible (?) toy operating system that could run on hardware (yes, it is madness).

Piko-piko OS overview

As the title stated, it is a toy os so itself doesn't do much. Still, the language is still turing complete. Here is an example that prints Hello world 10 times.

00000 set 0 10
00001 say n "Hello world"
00002 sub 0 $0 1
00003 cmp $0 0
00004 june 1
Enter fullscreen mode Exit fullscreen mode

The language is more or less like an interpreted assembly language without label. It can read user input, print to output, basic arithmetic, save & load data and conditional jumps. Here is all the commands included. I'll write a more user-friendly tutorial to kick start your Piko-piko OS coding journey, but right now you can only

In Piko-piko OS, you can either enter the command to the prompt to run the command directly or using = command to save lines of command to buffer and run it all together with run command. By default, there is 3 buffer. Each buffer can only holds 2560 lines of text.

Piko-piko OS is self-contained, which means that it does not rely on any other code and won't effect other files except itself. When saving & loading data, it does read and write to itself only.

Practicality?

Yes, it is not practical but it is a very educational resource to learn lower-level programming and really knowing how machine work. Still, you can use it to:

  • Show off
  • Stop your child from watch too much youtube by locking them up in Piko-piko OS.

It is a very cool experience to be able to make an operating from scratch. I might be able to share the experience of developing Piko-piko OS on the next blog post.

Top comments (0)