The virtual address space of Linux is divided into two parts Ox00000000 to PAGE_OFFSET-i can be for process user space. PAGE_OFFSET to Oxifififif can be addressed only In kernel mode, PAGE_OFFSF1 Is usually Oxc00000000 ln kernel mode, Linux Physical RAM address have a constant offset to virtual address, the constant is PAGE_OFFSET PHYS_OFFSET. Linux Kernel spIel physical memory into page, page size usually 4KB size, Linux physical memory management Is Page-based. The boot-time allocator is kernel boot-time page allocator, It allocate physical contiguous page. Boot- time allocator is destroyed when buddy system initialized. The buddy system the kernel core page allocator. it allocate physical conteguoLs page The slab system Is a cached object pro-allocated system, slab call buddy page allocator to buikng a slab, a slab Is one or more physical contiguous page , contain many pro-allocated objects. Kmalloc return object in physical contiguous addrres vmalloc is usefull when need virtual contiguous page only. loremap Is not allocator, It only map specIal physical address to a virtual address, usually for I/O registers. You should access the address wIth wrlteb/readb/wrltew/readw. |