4 ms·
> This continues for 2 days This thing made me scoff at the article the most. I've written a unix-like OS for ARM 2 years ago as a final project for an OS cla
by optymizer 13y ago
> This continues for 2 days
This thing made me scoff at the article the most. I've written a unix-like OS for ARM 2 years ago as a final project for an OS class I took on campus. There were 20 other people in the class, and all of us forgot to update the IDT at some point. It was a common mistake, so for this article to emphasize it like it's some bug that takes 2 days is just lame.
Imagine if my blog post would talk about my experiences with building an HTML page, and how it took me 2 days to change a <p> element to a <div>. Let's get serious here.
How long will it take the author to write a circular buffer to read and write characters to the UART? A month? That says nothing about the difficulty of the actual task.
You know, when it comes to writing operating systems, I like to think of this quote: "it's hard, it's harder than it looks, but it ain't THAT hard" (I first heard it when the commentators were laughing at Chris Andersen was struggling to dunk in an NBA Dunk Contest).
If you're interested in writing an OS, make sure your primary source isn't some blog post. My textbook was Tannenbaum's Operating System book, and it's a very solid book that I can recommend. Tannenbaum knows operating systems. He's not going to tell you how hard it is. He's going explain all the details to you and, when you understand them, you'll think how easy kernels really are.
Good luck!
- vidarh 13y ago> like it's some bug that takes 2 days is just lame. Unless she was spending full time on it, it was not some bug that takes 2 days. At the same time: If you've never come across some trivial, stupid little bug that has left you stumped for far longer than it should have, you're either superhuman (or have selective memory), or you're a total beginner. Your dismissive tone is really offputting.
- abshack 13y agoWhen I did Operating Systems in University (in a group), I remember distinctly only 3 bugs that we had difficulty debugging: * re-using a loop variable from the outer loop in an inner loop (damn you `int i`!) * putting a char[256] on the stack when the stack size was only 256 bytes and getting stack corruption (this one wasn't me, thankfully) * signed vs unsigned code being passed between user mode and kernel mode causing problems (no idea why it was causing issues; i just made it all unsigned and the issue went away) In hindsight, -Wall would have probably caught everything and saved a couple hours of "wtf" at 2-3 in the morning. Often the simplest things are the hardest to discover.
- optymizer 13y ago> THE OS IS STILL CRASHING WHEN I PRESS A KEY. This continues for 2 days. In case you didn't read the article.
- deleted 13y ago[deleted]
- PhasmaFelis 13y agoEarlier in this thread, I said that shamelessly admitting your mistakes is a virtue. People like you are the reason it's such a difficult virtue to cultivate. The lesson conveyed in your post is "if something is hard for you, keep your mouth shut about it, or someone will laugh at you." That is a fucking terrible lesson and it needs to be stamped out and destroyed. I'm still trying to unlearn it.
- optymizer1 13y agoI'm not saying that having a bug is something to be ashamed of. I am pointing out that the page is making a big deal out of a small issue, in order to argue a bigger point: operating system development is hard. The whole page screams with: "look how hard this is!". The lesson conveyed in my post should be that this author is making it look harder than it actually is, and if you want to write an OS, you shouldn't feel like it's an unsurmountable task. But by all means, stamp and destroy it.