Skip to content
Browse files

better error handling and more verbose reserved bit fault message

  • Loading branch information...
1 parent c22ba2f commit aa89aa958855ec610c9f077b223a5215f1cfaec5 @wolfwood wolfwood committed Aug 13, 2011
Showing with 17 additions and 0 deletions.
  1. +17 −0 kernel/arch/x86_64/core/paging.d
View
17 kernel/arch/x86_64/core/paging.d
@@ -175,6 +175,10 @@ static:
bool recoverable;
if(stack.errorCode & 8){
+ kprintfln!("You look angry that I wrote some bits in a reserved field. Have some PTEs.")();
+ uint depth = 4;
+ root.walk!(pageEntryPrinter)(cr2, depth);
+
kprintf!("Reserved bit ")();
}else{
if(stack.errorCode & 4){
@@ -247,6 +251,16 @@ static:
}
}
+ bool pageEntryPrinter(T)(T table, uint idx, ref uint depth){
+ if(table.entries[idx].present){
+ kprintfln!("Level {}: {x}")(depth--, table.entries[idx].pml);
+
+ return true;
+ }
+
+ return false;
+ }
+
// --- AddressSpace Manipulation ---
AddressSpace createAddressSpace() {
@@ -386,6 +400,9 @@ public:
ulong vAddr = cast(ulong)location;
PhysicalAddress phys = PageAllocator.allocPage();
+ if(phys is null)
+ return false;
+
T* segmentParent;
root.walk!(mapSegmentHelper)(vAddr, flags, success, segmentParent, phys);

0 comments on commit aa89aa9

Please sign in to comment.
Something went wrong with that request. Please try again.