Memory mapping

Kernel architecture questions
  • I found. I should use get_pg_addr.
    to infinity and beyond
  • Either you did not describe the problem accurately, or the proposed solution is wrong.

    My answer to your original question would be, use "MapIoMem" from driver or "map_io_mem" from inside kernel.
    An example can be found in drivers that use memory mapped I/O such as i8254x network driver line 414.

    Code: Select all

            invoke  MapIoMem, eax, 10000h, PG_SW+PG_NOCACHE     
    
    If however you just want to know the "real" address of some pre-allocated memory (by using kernel_alloc for example), you can use "GetPhysAddr" aka get_phys_addr for any address location, or "GetPgAddr" and "get_pg_addr" when it is aligned on a page boundary (4096 bytes in current kernel).
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • Who is online

    Users browsing this forum: No registered users and 4 guests