Re: how to reserve memory in linux?

2006-10-22 Thread Rahul
On 10/21/06, Ming Liu [EMAIL PROTECTED] wrote:
Dear sudheer,About the mem=xx argument, I checked it from the website and got such aexplanation:This argument has several purposes: The original purpose was to specify theamount of installed memory (or a value less than that if you wanted to
limit the amount of memory available to linux).From the argument above, it says mem=xx is to specify the amount ofmemory available to Linux. I am not sure if I am right, but I think if Iuse such an argument, that reserved part (that 5MB you mentioned), is not
available any more for Linux to access it.My original meaning is: specify a fixed physical address for a mount ofmemory for reserved use. The point is to make this part of memory fixed inthe memory of physical address, and then another I/O peripheral could use
DMA to access such a fixed physical address memory. However if I don'treserve such a part, I must let Linux to allocate such a memory part. Andthen Linux will not put it in a fixed physical address 

yes 
and then theperipheral will not know where is this part.

why do you think so ?
Can't you give the physical address of the allocated memory from linux kernel to peripheral's DMA.?
Unless you need to hardcode the physicall address i hope virt_to_phys(kmalloc_address) can be given to DMA.
Sorry if i am still wrong in understanding your requirement.

Am I right? Thanks for your idea.Also other ideas are appreciated.
RegardsMingConsidering your setup as normal desktop, I hope this can be done bygivingmem= xxmas the boot arguments.Say the dmesg in your systemshows 495MB LOWMEM available..In the boot arguments you can give
mem=490msaying the linux to use only 490MB . The rest 5MB can be used lateras youwish._享用世界上最大的电子邮件系统― MSN Hotmail。
http://www.hotmail.com___Linuxppc-embedded mailing listLinuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

Re: how to reserve memory in linux?

2006-10-22 Thread Ming Liu

Dear Rahul,


why do you think so ?
Can't you give the physical address of the allocated memory from 
linux

kernel to peripheral's DMA.?
Unless you need to hardcode the physicall address i hope
virt_to_phys(kmalloc_address) can be given to DMA.
Sorry if i am still wrong in understanding your requirement.



In fact, I have considered this method before. Just to dynamically allocate 
such a memory buffer and then tell the peripheral its physical address for 
accessing. However, because I really know little about the memory 
management in Linux, so I am not sure if the following question could be 
guaranteed:
Q. When I dynamically allocate a large amount of memory, I am not sure if I 
can allocate a physically continous large amount of memory. For the 
peripheral, it hopes the continous physical address, unless it has 
scatter-gather function. 

I think I must dig deeply into LDD memory management chapter to find the 
answer. :)


Of course, I appreciate your idea and suggestion. This is really a 
candidate method to solve my problem.


Thanks a lot.
Regards
Ming

_
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  

___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

Re: how to reserve memory in linux?

2006-10-22 Thread Eric Nuckols

Dear Eric,



Have you tried the function

alloc_bootmem_low() early in the boot process in main.c ?

Yes, it sounds reasonable. With this function, I can reserve a large amount 
of buffer during booting time. But I think maybe it will be better to put 
this function in the device driver and when booting time, the driver is 
loaded and the memory part is reserved for later use, right?


Actually, you can only do this at boot time before any of the standard 
memory setup routines run.
Consult the linux device drivers book and also do some internet research on 
the subject to get the official documentation of this functionality.  I'd 
rather you get the information from these sources than from me, since there 
is plenty of room for error when using these functions.


Here's a link I found to the book: (the 2nd Edition)
http://www.xml.com/ldd/chapter/book/ch07.html




Thanks for your idea so much. It's really helpful.



Regards
Ming


_
Ãâ·ÑÏÂÔØ MSN Explorer:   http://explorer.msn.com/lccn

_
All-in-one security and maintenance for your PC.  Get a free 90-day trial! 
http://clk.atdmt.com/MSN/go/msnnkwlo005002msn/direct/01/?href=http://www.windowsonecare.com/?sc_cid=msn_hotmail


___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded