[uClinux-dev] XIP broken in 2.4.31-uc0 ? (fwd)

David Howells dhowells at redhat.com
Fri Oct 7 08:20:58 EDT 2005


David McCullough <davidm at snapgear.com> wrote:

> Not currently,  this is still working with the old romptr code in
> conjunction with the new mmap stuff.

It should be possible to dispense with the romptr op, at least in the 2.6
kernel.

You should be able to do it by:

 (1) Return the address at which the data lives through the
     file->f_op->get_unmapped_area() operation.

 (2) Set:

	BDI_CAP_NO_WRITEBACK

		- Can't write back to ROM.

	BDI_CAP_MAP_COPY

		- Copying the data is permitted for MAP_PRIVATE/PROT_WRITE.

	BDI_CAP_MAP_DIRECT

		- Mapping the data in place is permitted for
                  MAP_SHARED/PROT_READ.

	BDI_CAP_READ_MAP

		- PROT_READ is permissible directly.

	BDI_CAP_EXEC_MAP

		- PROT_EXEC is permissible directly.

     In the capabilities field of the backing_dev_info structure pointed to by
     the address_space (i_host) - you should only need one of these for an
     entire mount, and should be able to share them.

> A question for you though, romfs could be on a disk, ram, flash or any
> number of things.  It could only report membacked if the device it is
> running on is membacked.  Does this point towards membacked being a function
> rather than a boolean ?

No. I think it's invariant for a file, and so can be set when the inode and
the address_space is created.

> romfs may be able to determine membacked at mount/init time I guess by
> checking the underlying device.  I haven't looked at it in detail yet, but
> it might save me some time if you know the answer off the top of your head
> :-)

Yes. You should be able to find out by looking in the address_space attached
to the inode attached to the blockdev - if you have a blockdev. I assumed
ROMFS would be like JFFS2 or NFS, but I suppose that isn't required.

David



More information about the uClinux-dev mailing list