DEV Community

Cover image for 🧠 “I Tried Debugging a ‘Mini Operating System’ in Python… It Broke Me 😅”
Tahami AK SERVICES
Tahami AK SERVICES

Posted on

🧠 “I Tried Debugging a ‘Mini Operating System’ in Python… It Broke Me 😅”

Hey devs👨‍💻,

Yesterday I thought:
👉 “Why not simulate a tiny operating system in Python?”

Simple idea, right?

Yeah… that’s what I...Read More

💻 The Idea

I wanted to build a basic OS simulation that could:

Manage processes
Allocate CPU time
Handle simple commands

So I wrote this:

def run_process(processes):
for p in processes:
if p["status"] == "ready":
print(f"Running {p['name']}")
p["status"] == "running"
elif p["status"] == "running":
print(f"Finishing {p['name']}")
p["status"] = "done"

processes = [
{"name": "Process1", "status": "ready"},
{"name": "...Read More

run_process(processes)
🚨 The Bug That Wasted My Time

At first glance, everything looked fine…
But the output was strange:

Running Process1
Running Process2

👉 Wait… why are they not finishing?

🔍 Debugging Time

I checked:

Logic ✅
Loop ✅
Conditions ✅

Then I saw it… 👀

p["status"] == "running"

💥 That’s not assignment. That’s a comparison.

🛠️ The Fix
p["status"] = "running"

Now the output:

Running Process1
Finishing Process1
Running Process2
Finishing Process2
🤯 What I Learned

Sometimes the smallest bugs:

Don’t crash your program ❌
Don’t show errors ❌
But completely...Read More

🔥 Real Talk

Debugging feels like:

“I am 100% sure this should work… but it doesn’t.”

And that’s where real developers are made.

💬 Your Turn

Have you ever spent hours on a tiny bug like this? 😭
Drop your story below 👇

🚀 Final Thought

You don’t need to build a real OS to feel like one broke on you.

Sometimes…
👉 One == is enough.

Top comments (0)