All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
I'm posting this essentially for therapeutic purposes. I've come back to a bit of OS Dev after pretty much a 10 year hiatus. I needed something to allow myself to "tune out" of the world, due to a lot of rubbish going on.
Anyway - wrote my PFE handler and all seemed well until the GPF on IRETQ. I used cli/hlt debugging and the stack seemed to be in the right place...hmmm.
The upshot is that at the end of my handler macro I was doing the following:
The original version of that was my Technical Project Manager back at the time, telling me (after I did spend almost two weeks hunting down a bug that should have been extremely simple to spot):
"Every bug is obvious. Once you've found it."
Don't fret, we've all been there.
Every good solution is obvious once you've found it.
My employer just spent six man-weeks searching for a bug and fielding a couple of rather irritated calls from the customer. Because of a forgotten break statement between two cases in a switch. It happens.
I've been trying to debug this triple fault in my kernel when it tries to initialize its heap involving its page tables for months now. GSoC and college have gotten in the way and I (still) haven't figured out precisely what causes the bug, even though I've inserted debug print calls. I have a good theory but its one that doesn't make sense, especially since nobody else that I know of is experiencing it. I'm sure that when I finally figure it out I'll go "well how did I miss that?".
If its any consideration, the amount of times I cant figure out why something doesnt work just to lead the way back to a TODO or FIXME comment...just happened again not too long ago. What starts out as "Why doesn't this work? There isn't a reason why this shouldn't work" leading back to "oh yeah...".
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
I think, it could be fun and interesting to create a whole forum subsection (or at least pinned topic) dedicated to this kind of bugs and mistakes. We all encounter them from time to time, but occasionally something really crazy pops up.
It would get old pretty fast. In the end it's always the same story...
@neon:
Add a way to easily extract and list all TODO and FIXME comments. I usually have a make target ("make todo") set up for that purpose. I even added a "--todo" option to a Perl script I am working on, which then goes on and scans itself. Then make it a habit of calling that feature at least once per day.
Every good solution is obvious once you've found it.
Once the brain thinks something is correct, it filters it out.
My friend sent me this; it cracked me up!
I once spent two hours trying to find a bug in a program. It was driving me crazy. I went over the code line-by-line, working it out in my head, but the logic seemed sound.
Just then a woman came by who knew absolutely nothing about programming. Zip. She asked me how I was doing and I told her about the bug that was driving me crazy. She took one look at my screen and immediately said, "Is that supposed to be a comma or a decimal?"
AAAAAAAARRRRRRRGGGGGGGGGGGGGG.....
I guess the comma didn't fit the formatting.
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie