public void SetTraceOptions(PageFrameAllocatorTraceOptions options) { for (var i = 0; i < Allocators.Length; i++) { Allocators[i].SetTraceOptions(options); } }
public void Setup(MemoryRegion region, AddressSpaceKind addrKind) { TraceOptions = new PageFrameAllocatorTraceOptions(); _AddressSpaceKind = addrKind; _Region = region; FistPageNum = region.Start / PageSize; _TotalPages = region.Size / PageSize; kmap = AllocRawMemory(_TotalPages * (uint)sizeof(Page)); PageArray = (Page *)kmap.Start; var firstSelfPageNum = KMath.DivFloor(kmap.Start, 4096); var selfPages = KMath.DivFloor(kmap.Size, 4096); KernelMessage.WriteLine("Page Frame Array allocated {0} pages, beginning with page {1} at {2:X8}", selfPages, firstSelfPageNum, (uint)PageArray); PageTable.KernelTable.SetWritable(kmap.Start, kmap.Size); kmap.Clear(); var addr = FistPageNum * 4096; for (uint i = 0; i < _TotalPages; i++) { //KernelMessage.WriteLine(i); PageArray[i].Address = addr; //if (i != 0) // PageArray[i - 1].Next = &PageArray[i]; addr += 4096; } KernelMessage.WriteLine("Setup free memory"); SetupFreeMemory(); KernelMessage.WriteLine("Build linked lists"); BuildLinkedLists(); KernelMessage.WriteLine("Build linked lists done"); _FreePages = 0; for (uint i = 0; i < _TotalPages; i++) { if (PageArray[i].Status == PageStatus.Free) { _FreePages++; } } //Assert.True(list_head.list_count(FreeList) == _FreePages, "list_head.list_count(FreeList) == _FreePages"); var debugCheckCount = list_head.list_count(FreeList); if (debugCheckCount != _FreePages) { KernelMessage.WriteLine("debugCheckCount {0} != {1}", debugCheckCount, _FreePages); Debug.Break(); } KernelMessage.Path(DebugName, "Pages Free: {0}", FreePages); }
public void SetTraceOptions(PageFrameAllocatorTraceOptions options) { }
public static void SetTraceOptions(PageFrameAllocatorTraceOptions options) { NormalAllocator.SetTraceOptions(options); IdentityAllocator.SetTraceOptions(options); }
public static void SetTraceOptions(PageFrameAllocatorTraceOptions options) { Default.SetTraceOptions(options); }