Re: get the reserved memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Saroj Kumar Mohapatra a écrit :



On 5/23/05, *nicolas Wilczak* <wilczak@xxxxxxxxx <mailto:wilczak@xxxxxxxxx>> wrote:


>>Using LILO and the mem=40M to allow 40M for the system, and I would like >>to access the memory after. >>I've read that I have to do : ioremap(0x2800000/*40M*/, ... but I'm not >>sure I access to the good memory region. >> >> > >Yes, you can now access the RAM above 40MB with ioremap ..... what do >you mean by good memory regoin ? > > > The thing I realy does understand it's: - when I get 1 page from get_free_page , and I give the address to the device ( for a PCI device driver ) : page = alloc_page(GFP_KERNEL); pci_write_config_dword(dev,0xa8, virt_to_bus(page_address(page))); It works, I can access the this space from pci device.

        - when I do : buf = ioremap(0x2800000,0x100000);



on waht address you are trying to run ioremap.
its meant for PCI device address space. and not below that. memory below that is the point where it gets remaped


I'm trying to run ioremap on the memory location I reserved from the lilo command, that is to say , the memory above 40M.
And I want use it as shared memory for a pci device....



        pci_write_config_dword(dev,0xa8, virt_to_bus(buf));
           It doesn't work ....
    So do I have to use some function like io_remap_page_range or
    something
    else. I don't well understant why I can access this
    memory space from the device?


>>Does somebody know the good method to reserve large memory region ? >>I'm using 2.6 kernel. >> >> > >As you already reserved the RAM above 40MB through mem=40M option, now >you can use it freely through ioremap and you can consider this region >as usable regoing for you ...... You have to use ioremap to map memory >in chunks, map a chunk of memory let say 4KB (a page) use it, unmap it >and then map other 4KB and so on ....... then you can access whole >memory above 40M or your reserved memory. > > >


-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ <http://mail.nl.linux.org/kernelnewbies/> FAQ: http://kernelnewbies.org/faq/




--
!!!!! When I was a kid I used to pray every night for a new bike. Then I realized, God doesn't work that way,so I stole one and asked him to forgive me !!!!!



-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux