Monday, April 30, 2007

Conquered... well... almost!

Never thought that a single decision in my life would change how my life would be for over 4 looooong months... Though when I look back I can't seem to recall how time flew... and yet the initial days of the semester are so blurry.... Kind of an antithesis, don't you think?

15-410... these 5 digits are probably embedded in my brain forever. I still remember the fateful night when I stayed up all through just so that I could register for this class at 6 am as soon as course registrations started. This was how desperate I was to get into the class. The reason? The stories I had heard about this course from seniors. I had heard all about it for 2 years before I landed in Carnegie Mellon University. And it fascinated me... it challenged me.... and as soon as I got my admit into this university I knew I was definitely going to take this course.

15-410... Operating System Design and Implementation.... the 5 words that changed my life... OK, somewhat an exaggeration but that's how it feels when I look back at it about 24 hours after I completed my last project in that course. Most people told me it's a C course.. meaning it's an achievement to get a "C" in the course and it requires a hell lot of effort to get a B and an A was possible only if you were as smart as the CS undergraduate students here.

Seniors warned us about the truckloads of work which this course represented. But this did not deter the 21 brave warriors of INI. We were mentally prepared to fight this battle and emerge victorious that too with flying colours. And so the course began, with some simple (most certainly didn't seem simple back then but a piece of cake in hindsight) labs. More of a warm up if I may say so, before the real projects came along. Wrote a stack crawler, some device drivers and a game. OK... so far so good... And we started wondering "What was all the fuss about? This seems pretty doable..." Hah... we were soooooooooo wrong!

Then came along hurdle 1. It was called P2 - the POSIX thread library. 3 weeks of sleepless nights and sheer madness. Eventually my partner and I managed to crash the kernel and received a new one to work with. Finally 2 days before the lab was due we managed to get the tests running. Hurray!

OK.... now the dreaded P3 begins... 6 weeks to build a preemptible multithreaded kernel. Start off with some simple things like the loader and virtual memory. And gradually we get a tiny bit complacent as things seem to be under control while God above laughed at us and said "Right... wait and watch sonny!"

Then gradually things began to take a nasty turn. Bug after bug... and just when we went about announcing to everyone how we got something working. OS got to us. Arguments and frustration ensued. A bug that had my partner and me on the verge of going bald. And one week later we found the problem and learnt a valuable lesson. Never ever copy-paste!!!

The kernel chugged along, with many unexpected halts and frantic debugging. Spent many a night pondering over why I put myself in this mess. C code and hex dumps were my companions every night as I closed my eyes in a futile attempt to sleep. I would see page tables and triple faults and dumps of segmentation faults in my sleep. Not the best dream I tell you. My last thought as I drifted off and my first thought as I woke up 2-3 hours later were the same "Why is this not working?" and some more mumbo-jumbo about design and the code. Just when something started working, some other functionality would break. Frustrations soared with the eagles. Tempers soared higher. Not that my partner and I were trying to blame each other for the code but then when you start spending 14-15 hours every single day working on the same issue day after day, night after night, it kinda gets to you to the extent that you start blasting anybody around you... and who better than your OS partner!!! Sorry Gurpreet.. :-P

At times I used to sit and calculate how my grades would be hit if I couldn't submit the kernel. But it was not about grades really. I was out to prove something to myself. It was a challenge and I wanted to face it and more importantly conquer it.

The hardships did not end once we reached the "code complete" stage. It was when we started running the plethora of tests that we realized how "incomplete" the kernel was. Quick design changes followed by recoding happened ever so often. And of course bugs, bugs and more bugs everywhere.

But it was not all bad. The joy we experienced when after hours of debugging we would rectify an error is indescribable. We felt on top of the world every time we fixed an error and got another test to run successfully. OS and I shared a love hate relationship. Loved the course when things worked and absolutely hated it when it didn't. I once referred to the kernel "Pebbles" as my boyfriend, given the importance it held in my life and the amount of time I was devoting to it... much to the displeasure of a certain person... :-P

Finally we got the damned thing to work... or rather so we would like to believe.. so it's better for your welfare that you do not contradict us on this. The tests ran "happily" as my partner says and we submitted the kernel and promised never to run and look at it till the grades were out. But the 6 weeks had hit us so hard that every waking moment we continued to spend thinking of possible errors and other improvements. Thankfully we still had write permission so we made a couple of changes later. He he...

And yes, this post is incomplete without a mention of the Floppy Disk seminar. This was on the night that the kernel was due. All through the semester the professors had been talking about this rather important seminar where we would learn about giant (about 14" in diameter going by what he showed us through gestures) floppy disks. Finally we signed up for the seminar and had to choose from some rather interesting and in fact ridiculous options. Eventually this turned out to be a class tradition. Every semester, the night when the kernel is due, the professors treat the students to pizza and soda at the CS department lounge at 12 am. It was a fabulous surprise and a looooot of fun!!! As for the name.. well think about it.. pizzas are like disks too and are floppy... ingenious! That's our CS department for you...

Then came the last project. The boot loader for the kernel. This too was challenging. Some bugs and 2 sleepless nights later we managed to boot our kernel with our very own bootloader. Oh that felt so wonderful. I started jumping up and down in excitement.

Never have I ever taken a course that took me from utter hopelessness and depression to sheer ecstasy within a few seconds. Never have I ever done something so fulfilling. Never have I done something that will make me finally agree upon the saying "There's no gain without pain." The take away from this course is mind blowing. Nothing else could have taught me what I have learnt in the last few months. Systems programming concepts, design, debugging tactics, teamwork and many innumerable moments of happiness and sorrow. These 4 months I shall treasure... It was an experience worth blogging about, a journey worth remembering, an experience of a lifetime...

4 comments:

Anonymous said...

Kudos! I'm sure the sense of achievement is nothing short of surmounting Mt Everest despite a handicap!

And it so true that tough courses in grad school teach you so much about living life itself ...

Prasoon said...

Beautifully inspiring post Rupsha.. I'm just mute at the achievements.

Congrats on completing the course !!

Incognito Princess said...

Hey Rupsha, reading your post was like reliving those days of OS again. I think you've captured the moments so perfectly. Many a time I've felt like writing about those days but somehow have always felt too overwhelmed with emotions and passions to do right justice to the subject matter at hand. I think OS is a course that teaches you much more beyond the mere technical knowledge. Its like a trial by fire that strengthens you, and at the end of it, you are somehow glad that you took the decision to brave the course till the end. OS can almost be likened to a prize fight, in which you duel against your own demons in addition to the challenges posed by the course content. In that sense it is a highly satisfying experience to know that you did not throw in the towel till the end and persevered. Good work Rupsha.. Keep it up

Bankim Bhavsar said...

Very well written. I can relate to almost everything that you've mentioned.
How about forwarding this to Dave?