【正文】
available addressrange for kernel virtual addresses = persistent mapping = transient mappings TwoLevel Translation Scheme PAGE DIRECTORY CR3 PAGE TABLES PAGE FRAMES Linear to Physical physical addressspace offset tableindex linear address CR3 dirindex page frame page directory page table Addresstranslation ? The CPU examines any virtual address it encounters, subdividing it into three fields offset into pageframe index into pagedirectory index into pagetable 31 22 21 12 11 0 10bits 10bits 12bits This field selects one of the 1024 arrayentries in the PageDirectory This field selects one of the 1024 arrayentries in that PageTable This field provides the offset to one of the 4096 bytes in that PageFrame Format of a PageTable entry PAGEFRAME BASE ADDRESS P W U P W T P C D A D 0 0 31 12 11 10 9 8 7 6 5 4 3 2 1 0 AVAIL LEGEND P = Present (1=yes, 0=no) W = Writable (1 = yes, 0 = no) U = User (1 = yes, 0 = no) A = Accessed (1 = yes, 0 = no) D = Dirty (1 = yes, 0 = no) PWT = Page WriteThrough (1=yes, 0 = no) PCD = Page CacheDisable (1 = yes, 0 = no) Finding the userbuffer?s PFN ? To program the ?baseaddress? field in the second TXDescriptor, our driver?s ?write()? function will need to know which physical PageFrame the application?s buffer lies in ? And its PFN (PageFrame Number) can be found from its virtual address by ?walkingthecpupagetables? – even when Linux puts some pagetables in ?high? memory Performing ?vi