Close

Adding More Applications

A project log for MooseOS

x86 Operating System that runs on QEMU, Bochs and physical PCs.

ethan-zhangEthan Zhang 10/11/2025 at 01:420 Comments

Retroactive Log – June 28th (Reconstructed from memory and commit logs)

GUI made things much easier. I had functions that made creating shapes like windows and buttons a breeze. It didn’t take long before I had a working dock, terminal, text editor, and a Pong demo. I also gave MooseOS a dock, similar to macOS's Application Launcher. I added a clock, which would use the CMOS chip to read the time and update it every few seconds.

Caption: File Explorer. Notice the blue-beige colour scheme

The hardest part was the Pong demo, because it was refreshing all its pixels at such a rate that redrawing the entire screen at a playable rate was nearly impossible. Thus, I had to implement functions that only updated the paddle and ball locations. Moreover, the opponent in Pong was absolutely unbeatable because it was fast and based on code, which meant it had insane reflexes. I had to add a small delay between when the opponent hit the ball, which reduced its difficulty. However, it was still quite hard to balance the enemy difficulty.

Caption: Pong demo

NOTE: In later versions of MooseOS, I had to remove Pong since it was the hardest to maintain while adding new features. It's expected to be re-added soon.

Developing Pong also led me to add another important feature of MooseOS, cooperative multitasking. Since I was dealing with all sorts of GUI updates, I wanted them to each be updated through a multitasking system. I chose cooperative multitasking since preemptive multitasking was a bit overkill for this stage of the OS, and cooperative was simple and reliable enough in the sense that there was no way an application was going to stop the entire multitasking system. Adding cooperative multitasking was quite easy, and there were no hardships.

What was strange, though, was that every time I pressed keys too fast, the entire OS would triple-fault and reset itself. After hours of debugging, I found the issue wasn’t with the multitasking system (as I’d first suspected), but with the keyboard interrupt handler — it was missing its save-and-restore routine, likely a casualty of refactoring.

Discussions