Poems on Operating Systems

Mythili Vutukuru
Department of Computer Science and Engineering, IIT Bombay

Back to OS page

This page contains some (hopefully funny) poems I have composed on topics related to operating systems, which I have used (somewhat unsuccessfully) to add some humor to my (otherwise dry) OS lectures.


The Process Not Scheduled

Inspired by the famous poem "The Road Not Taken" by Robert Frost

Two processes were ready to run in the queue
And sorry I could not run both on one CPU
And be one scheduler, long I stood
And looked down one as far as I could
To where it stopped its execution

Then took the other, as just as fair
And having perhaps the better claim
Because it was I/O-bound with a shorter CPU burst
And would get blocked before using its time share

I shall be telling this cycles and cycles hence
That two processes were ready to run on the CPU
And I picked the one that wouldn't get its due
And that has made all the difference


Three Ready Processes

To be sung in the tune of the nursery rhyme "Three Blind Mice"

Three ready processes
Three ready processes
See how they run
See how they run
They all sat in the scheduler's queue
The scheduler sent them out to execute
They made an I/O request and went to sleep
Became ready to run after interrupts beeped
Did you ever see such a sight in your life
As three ready processes


Processes and Motherhood

Process P spawns a child C one day
Then waits for it to die and cleans it away
Oh, what a cruel mother, some might say
But they are processes, not humans, so all okay!

Albeit, humanity is not a rare find
For proof, look no further than the init
Which adopts orphan children sired by others
Without asking "For me, what's in it?"


Lost in Translation

"Fetch the data at this address", the CPU asks
The MMU and the OS give each other furtive stares
The address is only virtual, not real, they know
But together, they must translate and manage the show

The MMU first checks if the TLB can help
Else it must do the long page table trek
The MMU wonders if they should've kept things real
"No", says the OS, "I believe in the virtual"


What is an OS, you ask?

You want to run a program?
Then you should ask the OS
It manages the hardware for you
So that you do not make a mess
It creates a process in RAM
Initializes it from your a.out
Sets the CPU running on your code
And from the scene it bows out

... until you call it again
for an interrupt or a system call...


Great Power, Great Responsibility

A process running in user mode carefree
Encounters a trap that forces it to be
More responsible in the kernel mode
As it traps into the privileged OS code

"Don't panic", says the OS, "I'll handle this"
Saves context on the trap frame and dives right in
To its trap handling code that does what must be done
To handle the trap and bring the process back to run


The Switching Game

As the stack pointer moves to another stack
And the program counter points to another's code
The distraught process begins to wonder
"Am I still alive or am I dead cold?"

Little does the process know it will be back soon
For that's the game -- run a bit and get swapped
And when its context is restored into CPU registers
It will resume like it had never been stopped


Communication is Key

One process P1 said to its friend P2
"It's been long since I have heard from you
Let's communicate by sharing some memory?
Or how about a socket, a pipe, or a message queue?"

"No", said P2, "none of this is easy
I do not know your port number or unique key
Neither are we related to use the same pipe
So I really do not know how you can reach me"

Processes, like humans, always have an excuse
To avoid talking, we are never short of a ruse
But find a way out, get the conversation going
Nothing's better than IPC* to get over the blues!

*IPC = Inter Person Communication

The Life of a Shell

Read a command, fork, exec, and wait
That's all there is to the life of the shell
Day after day, command prompt after prompt,
Like the monotony of Tom Hanks in “The Terminell”

The only excitement is in the minor skirmishes
When signals are thrown via the system call "kill"
And processes defend using signal handler shields
Or perish by bowing to the operating system's will


Two Threads Tango

"The CPU cannot add", thread T1 laments to T2
"How can 1+1 not be equal to 2?"
"Oh, that is a race condition", T2 responds
"For things to make sense, we must both use locks"

"Wait till I finish", thread T1 says to T2
But paying no heed, T2 starts to run
As a very offended T1 yells "how could you?"
It hears back, "a CV or semaphore, you use either one?"


The Lazy Disk

"Read a few bytes from this file", a process says
The OS starts the system call, but the disk responds late
As it searches for inodes and disk buffers and bytes on sectors
The process, very bored, switches to sleeping state

To avoid such delays, the OS decides
To store fetched blocks in the disk buffer cache
So when another process needs the same disk block
The lazy disk need not be approached again