9os – Nyan Cat ‘Operating System’

For our graduation-party at school two years ago, a friend of mine, Olrik, and I decided to play the Nyan Cat theme on all PCs at school.

With the name 9os, we started writing the entire project using 16bit x86 assembly.

The task was to draw the rainbow behind the cat, then the cat itself, play the music and in the end draw the stars.

Drawing the rainbow was pretty simple, as it consists only of a few stripes that need to be drawn at alternating heights and colors.
Staying in protected mode allowed us to use BIOS interrupts to render the data to screen using mode 13h.

For the cat, we converted each frame into a bitmap. To draw it, we scaled it up to 4x the original size to fit the screen and to save space in the binary.

To play the music, we converted each note into the frequency, which then had to be converted to a relative value for the speaker to play at a base frequency of 1.19Mhz[?].

Unfortunately, we didn’t have enough time left to implement the stars.

The final result looked like this:

Having it running at school looked like this:

The source code is available on GitHub.