Your biggest OSdev /facepalm moment
-
- 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
nekros: I was about to say "Just find + replace" but then I remembered ASM comments are usually semicolons
Re: Your biggest OSdev /facepalm moment
Hmmm...
One for the regex masters: search all semicolons that
One for the regex masters: search all semicolons that
- don't end the line and
- don't follow a "for("
Every good solution is obvious once you've found it.
Re: Your biggest OSdev /facepalm moment
It was already fixed when I wrote this.
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
Re: Your biggest OSdev /facepalm moment
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();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Re: Your biggest OSdev /facepalm moment
Funny when you ask something out loud you end up answering it the moment you finish your sentence.
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
Re: Your biggest OSdev /facepalm moment
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
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
Re: Your biggest OSdev /facepalm moment
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
-
- 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
I'm in that boat. It's like posting the question is a catalyst for the answer to come...neon wrote:The several times that I posted looking for help only to find and solve the problem 5 minutes later after posting.
Re: Your biggest OSdev /facepalm moment
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
really stupid
// PHPnerd
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
}
// PHPnerd
Jinix
Re: Your biggest OSdev /facepalm moment
using code insertion on my IRQ handlers and injecting 'mov al,0x...' after the 'popa'
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: Your biggest OSdev /facepalm moment
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.
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.
- alethiophile
- Member
- Posts: 90
- Joined: Sat May 30, 2009 10:28 am
Re: Your biggest OSdev /facepalm moment
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.
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: Your biggest OSdev /facepalm moment
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...
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...
-
- 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
The other day:
Took me a while to figure out why all my assertions were failing
Code: Select all
void assert(bool b)
{
ERROR("Assertion failed.");
Processor::breakpoint();
}