David Howells wrote:
Erwin Authried <[email protected]> wrote:

I have used XIP with armnommu on mtd devices with 2.4, and I want to use XIP
with 2.6 now. I have seen David Howell's patches from 2008-9-24 that add the
necessary support in MTD. In arch/arm, it looks like arch_get_unmapped_area()
is available for arm with mmu only, is it required to implement this for nommu
as well to be able to use XIP?

arch_get_unmapped_area() find a piece of unmapped _virtual_ memory space that
can then be mapped to a physical area, so it doesn't make sense to have an
overriding arch one for the NOMMU case: virtual memory is more or less
identical with physical memory - and where in virtual memory a mappable object
will be places depends entirely on where in physical memory it is.

For XIP in NOMMU mode, the device or filesystem driver needs to provide the
get_unmapped_area() file op so that the driver can tell mmap() where the
object exists physically.  This is really an abuse of the API, but it seems to
work.

David
Hi David,
thanks a lot for your help!!
I applied the patches to my 2.6.25 kernel. I'm using the cfi_cmdset0002 driver, and I added the get_unmapped_area function here too. Finally, I can mount the romfs, and verified that the text segment is really mapped to flash. There's just one thing that I'd like to know: When I use the original cfi_cmdset0002 driver (with get_unmapped_area=NULL), I get an error when I run an application with the new romfs source:

root@(none):~# /mnt/hello Unable to mmap process text, errno 38
munmap of non-mmaped memory by process 640 (hello): 01a4de60
munmap of non-mmaped memory by process 640 (hello): 01a4dd00

Shouldn't the application's text segment be loaded to ram in this case?

-Erwin

_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to