Page 1 of 1

General Protection Fault, Interrupts, printf();... Is there

Posted: Wed Aug 28, 2002 10:37 pm
by Warmaster199
Hello people, I am having a major problem with my OS. It seems like I cannot pass any arguments to printf(); from within an interrupt function. I can say printf("A key was pressed"); or putch(char); from my keyboard interrupt function, but as soon as printf is given an argument such as printf("stuff = %d", stuff); from within my keyboard interrupt function, I generate a General Protection Fault when printf(); returns. This is proving to be VERY annoying for me. Right after this, the timer fires and it prints "[t]" on the screen. Welcome to my nightmare... The screen is flooded with "Invalid Opcode". I am guessing that there is some kind of error with either the stack or printf(); or both :o

Is it possible that something could have royally messed up in my printf(); function? Or does ebp or esp have to be reset after a call to it? Please help, this is fairly important.

Re:General Protection Fault, Interrupts, printf();... Is the

Posted: Wed Aug 28, 2002 11:18 pm
by roswell
Hi,

If you need some help, you must provide some code. So you can try to submit one piece of your code here or send me some files by mail [email protected].

roswell

Re:General Protection Fault, Interrupts, printf();... Is the

Posted: Thu Aug 29, 2002 2:11 am
by Pype.Clicker
i think one of the most useful thing you could try is write some "dump registers & stack" function in ASM (because you'll better see what you do) and study where exactly things goes wrong ...

i've got such a debugging function in my crash() S.O.S. call that you might find helpful. see here

Re:General Protection Fault, Interrupts, printf();... Is the

Posted: Fri Aug 30, 2002 10:02 pm
by Warmaster199
That's mainly what the F12 key was supposed to be for CTOS. The problem is that when I press that key, the error happens... I think I have a debug solution, but my friend is using my ONLY floppy disk because he just got a computer AMD PC(Athlon 1.6G)and is wanting Sonique plugins, so I cannot test. I have Bochs, but I find it a bit of a hassel, it's better to boot my kernel on my old 486...