[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] mmap on petalinux-v0.10-rc1
Hi Leonardo,
Leonardo Pereira Santos wrote:
I'm having some trouble using the mmap function on petalinux-v0.10-rc1. I
googled around but only found references to mmap not working with the
MAP_SHARED on uClinux-2.4.31-uc0 (
http://mailman.uclinux.org/pipermail/uclinux-dev/2005-August/034004.html )
and the kernel version on petalinux-v0.10-rc1 is 2.4.32-uc0, so I tried mmap
with MAP_PRIVATE, but then I get
Allocation of length 3319166 from process 54 failed
In uClinux, a MAP_PRIVATE will cause the kernel to allocate a memory
buffer of the desired size, and read the file into that buffer. This
has resulted in an attempted memory allocation of approx 3mbyte, and
that has failed in your example.
My situation is exactly like Arnaud Lagger's (
http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/archive/2006/01/msg00064.html ),
I have a file sitting on a RAMFS dir and I want to write it to flash
directly. Reading uClinux for Linux Programmers, I found out that the only
filesystem that mmap actually does what I expect it to do is ROMFS, which is
not my case.
Even on ROMFS, it requires the use of the MAGIC_ROM_PTR hack - I'll
check to see if it is enabled, or what is required to get it going for
MicroBlaze.
So I guess I'll have to find a workaround so not to allocate a buffer to the
file, as I don't have the memory to have the file twice in RAM, like reading
the file in small chunks. That's it ? Any suggestions are welcome!
Certainly spliting up your file reads is one solution. Not as
convenient as an mmap() but workable.
Regards,
John
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/