Page 1 of 1

What is the Funniest Thing your OS ever Did ?

Posted: Mon Dec 07, 2015 11:10 am
by aswinmohanme
I know it sounds crazy , but really Every Dev has that moment where you would laugh out your eyes for something silly that your code did .

Re: What is the Funniest Thing your OS ever Did ?

Posted: Mon Dec 07, 2015 1:34 pm
by alex00
Once my kernel started moving the cursor in random positions and the best thing was that I could write in this positions so I made random strings around my screen :lol:

Re: What is the Funniest Thing your OS ever Did ?

Posted: Wed Dec 16, 2015 1:05 pm
by DiscobarMolokai
I just created this account and I have yet to boot my first kernel (you guessed it, messing with a x86 bootloader at the moment), so I can't really reply to your actual question. Nevertheless, I definately recall trying to boot from a debian install CD on my dad's old PC (he bought it in '99 or '00, don't remember) four years ago, when I was still in high school and mostly oblivious to the wonderous world of computer science (at present I'm a student).

I mainly post this because I'm curious whether any of the experts on this forum have an idea about what could have happened to the poor old Compaq. I have no idea, and knowing what I know today about OS theory -- only some theory, no practical experience with OS dev here -- what happened that day completely mystifies me.

To cut a long story short, I inserted the CD fully expecting to be able to install this 'debian linux' sorcery my older cousin told me about (he also gave me the install CD). Needless to say, it did not work. The system complained about not being able to find a bootable medium. Looking back now I guess I understand that part. About five seconds later, however, the screen went black again. Next, it started spitting out garbage, rendering strange glyphs on the old CRT monitor and beeping harshly while doing so. It did that for about two more seconds and then froze.

Again, the 'no bootable medium' or something similar makes sense to me. But how, after (!) the BIOS decided it could not grab a boot loader from any of the present disks, could it still break down and go haywire? I would expect the BIOS to halt the CPU upon failing to boot.


Anyway, didn't expect this to be my first post, but I had to reply to this one.

Re: What is the Funniest Thing your OS ever Did ?

Posted: Wed Dec 16, 2015 4:25 pm
by Octocontrabass
DiscobarMolokai wrote:I would expect the BIOS to halt the CPU upon failing to boot.
Failure conditions aren't usually tested very well. I've had one BIOS that would restart my bootloader from the beginning whenever I tried to call a specific function. I disassembled the BIOS code and found out it didn't even support the function; the odd behavior was caused by the error handler forgetting to pop a saved register from the stack before trying to return.

Even my own first-stage bootloader had a bug in its error handler. The bug had been there for months, but I didn't notice until I managed to cause an error while working on something else.

Re: What is the Funniest Thing your OS ever Did ?

Posted: Thu Dec 17, 2015 4:42 am
by DiscobarMolokai
Octocontrabass wrote: Failure conditions aren't usually tested very well.
I'm not sure I understand you. Do you mean that the manufacturers of the system don't test it thoroughly for cases where booting fails (or something similar)?

Re: What is the Funniest Thing your OS ever Did ?

Posted: Thu Dec 17, 2015 2:47 pm
by Octocontrabass
I mean in general. It's really easy to write code that will detect errors and attempt to handle them gracefully; it's a lot harder to simulate all the possible error conditions to make sure the error handler actually works.