Hi,

I am trying to get a page from RAM write some values in it in kernel
space and then read them in user space using mmap.
Below is the code i use, to fill the memory with a pattern in kernel space.

        ptr =get_zeroed_page (__GFP_DMA);

        printk("Peerless:The Virtual addr ptr: %08lx \n",ptr);
        phyaddr = virt_to_phys(ptr);
        printk("Phy addr is :%08lx \n",phyaddr);
        printk(" Virtual addr s :%08lx \n",phys_to_virt(phyaddr) );
        printk("At %x is %x \n",phyaddr,(*ptr));
        memset(ptr,0xaabb,4096);

         printk("At %ld is %x \n",phyaddr,(*ptr));
        printk("At %ld is %x \n",++phyaddr,++(*ptr));


But when i insmod the above module I dont see the pattern 0xaabb in
the printk's. Guess I am missing the basics.Help will be greatly
appreciated.

Thanks
Deepak

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to