sos-os / kernel

The Stupid Operating System
Apache License 2.0
264 stars 16 forks source link

Double fault as of 1f9b6cd2d67f6b0c0004b8fd1ff5678c0338be2b #22

Closed hawkw closed 8 years ago

hawkw commented 8 years ago

Something I changed between 1f9b6cd2d67f6b0c0004b8fd1ff5678c0338be2b and 19d09785340e1d49ba70100c1766aa3fe59db9d1 seems to be causing a double fault (or triple fault?).

I need to figure out where the fault is occurring and which commit caused it before I can pinpoint the cause of the issue. I'm assuming that the interrupt handling refactor in commits 621f40dd6e6731092043f4b3826f44dbb8f51235 and ec14c269f4ea9140ba5983a26d09464266345ddb, or the changes to DTable::get_ptr() are probably what's causing the problem.

hawkw commented 8 years ago

This issue has been observed on x86_64; since all changes (other than documentation changes) since the last known good boot have been to x86 platform code, this is almost certainly an x86-only issue. It probably exists on 32-bit x86 protected mode as well; that cannot be determined at the moment as we cannot boot on 32-bit x86 systems.

hawkw commented 8 years ago

If the problem has to do with the DTable loading process, which it certainly seems to, it's likely that my comments here may contain a workable solution. Otherwise, we can always revert to the pre 57bd1126f71413e5fdda81d34760de67535c8470 way of loading the IDT and see if that fixes it, as well.

hawkw commented 8 years ago

2725c6af55ee16478b9d465f3667ee9e1f6f2d07 changes DTable::get_ptr() which does not seem to fix this.

hawkw commented 8 years ago

Commenting out the vec test in kernel_main() also does not seem to fix this issue, so it is almost certainly IDT related.

hawkw commented 8 years ago

I checked out 621f40dd6e6731092043f4b3826f44dbb8f51235 and the issue is no longer present as of that commit. It seems likely that this bug was introduced by ec14c269f4ea9140ba5983a26d09464266345ddb. It's quite possible that Handler::from_raw() is actually necessary.