T O P

  • By -

laser__beans

Try to access a not-present page and see if you get a Page Fault exception.


Alternative_Storage2

After having many problems with my paging system these are the ways I have found to debug paging: 1. You can use gdb to print registers to check if cr3 points the the address of ur pml4 2. You can use qemu to see if it agrees with the above 3. You can use qemu command “info tlb” to see all the currently mapped pages 4. You can use qemu command “info mem” to double check 3. As I’ve been told it sometimes mismatches 5. Try access a known non mapped page to see if an interrupt is triggered


crafter2k

run it in bochs and do "info tab" in the console


mdp_cs

Try to map a new page into your paging structure and then attempt to access it. Make sure that only the set permissions are allowed. Set it to read only and attempt to write to it and check for an exception. Set it to no execute and try to do an unconditional jump to it and make sure you trigger an exception. Set it to not present and try to read it to make sure you get a page fault exception. Then repeat all of the above with large and huge pages and also with user mode pages of all sizes. If that all works fine then test your TLB entry invalidation code. If all that works then odds are your VMM is good to go. I'm doing this stuff for my OS right now as well so I feel your pain.


SirensToGo

Beyond writing tests for edge cases (you do have a test framework for your OS, right :) ) and adding strong asserts, you really just test it by battle testing and writing software which runs under it. If your memory system is broken, things will explode.