On Sunday 09 May 2004 11:42, Nachum Kanovsky wrote:
> Success! This has been painful, and I appreciate the help from the list. I
> just have one more question.
>
> I am not using 2.6 anymore, I had to switch to 2.4 b/c of glibc issues.
>
> In kernel 2.4.26 I do not need to perform ioremap on memory not used due to
> the mem bootparam. I just need to run remap_page_range with the actual
> physical address in the mmap function. Why is this? Why don't I have to
> call ioremap and iounmap on memory above the amount set in mem= bootparam?
> Does this have to do with high_memory support for this kernel?


It has nothing to do with 2.6 vs. 2.4 (except that I believe that 2.6 the mem= 
syntax is much imporved).

The mem= parameter tells the kernel which memory is it's own to manage and 
which isn't. The artifical "hole" you've created is a bunch of physical 
memory which isn't being used by the kernel and looks to it just like any 
device that is mapped "in parrallel" as this thing is sometime called, to the 
main memory bus  - like a lot on devices on embedded boards for DSP are (and 
judging from your employer name I assume you know something about DSP boards 
:-) You're actually treating that bunch of SDRAM as a though it is some 
different device on the memory bus.

The reason you needed to do ioremap and friends before is because 
remap_page_range will ONLY work on memory which the kernel memory map 
descirbes as reserved. 

Since the memory map wasn't right for it you had to "fool" the kernel it into 
thinking so by creating a kernel mapping for these pages with ioremap and 
setting the VM_RESERVED flag on them and then you could remap_page_range it. 
If you haven't the remap_page_range call will fail [1]

Since you're now using the mem= param you explictly removed that memory region 
from the kernel view of it's "own" memory, so this stage isn't needed as 
those pages are already marked reserved to begin with.


Hope this sheds some light on the matter,
Gilad

[1] Actually, I lied - remap_page_range will succeed but will map the NULL 
page (page number zero) instead of the physical page you wanted - check the 
source code for the gory details... :-)







-- 
Gilad Ben-Yossef <[EMAIL PROTECTED]>
Codefidence. A name you can trust (tm)
http://www.codefidence.com

"I am Jack's Overwritten Stack Pointer"
        -- Hackers Club, the movie


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to