Walking all the physical memory in an x86 system

From: Hanson, Jonathan M (jonathan.m.hanson_at_intel.com)
Date: 11/30/04

  • Next message: Rui Nuno Capela: "Re: Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.31-7"
    Date:	Tue, 30 Nov 2004 08:41:17 -0700
    To: <linux-kernel@vger.kernel.org>
    
    

            I've written a 2.4 kernel module where I'm trying to walk and
    record all of the physical memory contents in an x86 system. I have the
    following code fragment that does it but I suspect I'm missing a portion
    of the memory:

    unsigned long memory_address = PAGE_OFFSET;
    struct sysinfo RC_sys_info;

    si_meminfo(&RC_sys_info);

    while (__pa(memory_address) < RC_sys_info.totalram * PAGE_SIZE)
    {
            /* Read and record memory contents here. */
            memory_address += 4;
    }

    Is there a better way to record all of the contents of physical memory
    since what I have above doesn't seem to get everything?

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Rui Nuno Capela: "Re: Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.31-7"

    Relevant Pages