【正文】
separate buffers into just a single etherpacket The ?virt_to_phys()’ macro ? Linux provides a convenient macro which kernelmodule code can employ to obtain the physicaladdress for a memoryregion from its virtualaddress – but it only works for addresses that aren?t in ?high? memory ? For ?normal? memoryregions, conversion between ?virtual? and ?physical? addresses amounts to a simple addition/subtraction Linux memorymapping user space kernel space CPU’s virtual addressspace HMA 896MB physical RAM There is more physical RAM in our classroom?s systems than can be ?mapped? into the 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