Your biggest OSdev /facepalm moment

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.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Your biggest OSdev /facepalm moment

Post by pcmattman »

nekros: I was about to say "Just find + replace" but then I remembered ASM comments are usually semicolons :(
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Your biggest OSdev /facepalm moment

Post by Solar »

Hmmm...

One for the regex masters: search all semicolons that
  • don't end the line and
  • don't follow a "for("
...and replace them with //. If that doesn't do the trick, your C++ style sucks. ;-)
Every good solution is obvious once you've found it.
User avatar
nekros
Member
Member
Posts: 391
Joined: Wed Mar 05, 2008 9:10 pm
Contact:

Re: Your biggest OSdev /facepalm moment

Post by nekros »

It was already fixed when I wrote this. :D
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Your biggest OSdev /facepalm moment

Post by neon »

The several times that I posted looking for help only to find and solve the problem 5 minutes later after posting.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
nekros
Member
Member
Posts: 391
Joined: Wed Mar 05, 2008 9:10 pm
Contact:

Re: Your biggest OSdev /facepalm moment

Post by nekros »

Funny when you ask something out loud you end up answering it the moment you finish your sentence. :lol:
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
User avatar
nekros
Member
Member
Posts: 391
Joined: Wed Mar 05, 2008 9:10 pm
Contact:

Re: Your biggest OSdev /facepalm moment

Post by nekros »

I think I just experienced the biggest one on my record yet. Bootloader, was being screwy because I set sp to the start of the stack...
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
Ferrarius
Member
Member
Posts: 69
Joined: Sun Oct 28, 2007 4:10 pm

Re: Your biggest OSdev /facepalm moment

Post by Ferrarius »

spending over an hour trying to locate a mistake in the IDT or any other code, only to find out I didn't correctly remap the second PIC.
Modular Interface Kernel With a lot of bugs ;)
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Your biggest OSdev /facepalm moment

Post by pcmattman »

neon wrote:The several times that I posted looking for help only to find and solve the problem 5 minutes later after posting.
I'm in that boat. It's like posting the question is a catalyst for the answer to come...
PHPnerd
Member
Member
Posts: 34
Joined: Mon Nov 05, 2007 11:15 am
Location: The Netherlands
Contact:

Re: Your biggest OSdev /facepalm moment

Post by PHPnerd »

Some time ago, with my previous PMM, I got always no pages. Have been searching for 2 weeks. Problem was in find free frame function

Code: Select all

uint32_t *bitmap; // is initialized, dont worry :P
uint32_t bitmapSize; // in bits
uint32_t i = 0;
for(i = 0; i <(bitmapSize >> 3); i++)
{
      if(bitmap[i] != 0xffffffff) // have != here, so when some bit is empty, it skips it!!!, and when all full, next statement checks where empty bit is, but its nowhere.
            continue; // fast break if full
      if() // do rest stuff, search through 32 bit finding empty one
}
really stupid

// PHPnerd
Jinix
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Re: Your biggest OSdev /facepalm moment

Post by earlz »

using code insertion on my IRQ handlers and injecting 'mov al,0x...' after the 'popa'
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: Your biggest OSdev /facepalm moment

Post by NickJohnson »

I setup a special linking script and code that would collect all of the init code in my kernel and free it after everything was set up. Unfortunately, in my overzealous marking for deletion, I made it get rid of the main loop, so when the freeing function returned... kpow! Somehow this took me three hours to figure out.

Or, equally dumb: I had my GDT being loaded before I switched on paging, and it was still in lower memory. I could unmap the kernel image that was in lower memory, but whenever I did an interrupt, it would reload the segments, not find an actual GDT, and triple fault. I kept looking through my memory manager to try and figure out where the heck it was faulting, when the actual problem was in the first ten instructions in the kernel.
User avatar
alethiophile
Member
Member
Posts: 90
Joined: Sat May 30, 2009 10:28 am

Re: Your biggest OSdev /facepalm moment

Post by alethiophile »

I initialized some space for a disk address packet to 0xdeadbeef so I could find it in a hex editor, then wondered why my read_sectors kept saying 'LBA out of range'.
If I had an OS, there would be a link here.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Your biggest OSdev /facepalm moment

Post by Troy Martin »

Ye gods, this could be a five-page post :)

One of them would be accidentally adding a * before a variable name. Unexpected output was everywhere. In the form of divide errors. Unfortunately I don't have a screenshot...
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Your biggest OSdev /facepalm moment

Post by pcmattman »

The other day:

Code: Select all

void assert(bool b)
{
    ERROR("Assertion failed.");
    Processor::breakpoint();
}
Took me a while to figure out why all my assertions were failing :D
Post Reply