Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
moved out of the previous thread
initial post by Andrew
but ....
main function:
int main(){
// everything is fine till next line
printf(" booom1 %u", Floppy::TickCounter); //Page Fault
return 0;
}
if i want to print value of the variable which is being changed by the IRQ0 handler i get page fault exception.
why? i can't use it that way? or maybe this is a bug in memory manager? or smth else?
and if i comment that printf line i get general protection error. is there smth i should do before exit?
There are 2 options:
- either you have no valid return address when 'main' is running (for example if you had a jmp main rather than a call main or something alike), in which case returning is a BadIdea (tm)
- or you have something wrong with your stack, like a misinitialized pointer or a buffer overflow BigBug (tm) somewhere, which destroyed the return address information, in which case your patch is just delaying the RealProblem (tm)
BadIdea, BigBug and RealProblem are trademarks of their respective ownerz