Weird bug in preemptive task switching (x86)
Posted: Thu Aug 03, 2017 2:20 am
I'm currently stuck at debugging a really weird bug in my task switching code.
I currently have one task that runs in kernel mode and I switch back and forth to it using timer interrupt.
The tasks runs good for couple of seconds and then I get either a page fault or a general protection fault followed by page fault.
I don't know how to even start debugging it, as the problem doesn't reproduce itself the same in each run, which is something I never encountered before.
Complete project is hosted here: https://github.com/mellowcandle/epOS
Relevant code snippets:
https://github.com/mellowcandle/epOS/bl ... cheduler.c
https://github.com/mellowcandle/epOS/bl ... cheduler.s
https://github.com/mellowcandle/epOS/bl ... /process.c
Thanks a lot !
I currently have one task that runs in kernel mode and I switch back and forth to it using timer interrupt.
The tasks runs good for couple of seconds and then I get either a page fault or a general protection fault followed by page fault.
I don't know how to even start debugging it, as the problem doesn't reproduce itself the same in each run, which is something I never encountered before.
Complete project is hosted here: https://github.com/mellowcandle/epOS
Relevant code snippets:
https://github.com/mellowcandle/epOS/bl ... cheduler.c
https://github.com/mellowcandle/epOS/bl ... cheduler.s
https://github.com/mellowcandle/epOS/bl ... /process.c
Thanks a lot !