2011-04-19 06:02:17

by Jongman Heo

[permalink] [raw]
Subject: How to mount filesystem from RAM ?

Dear all,

I have a flash device and it will store cramfs or squashfs filesystem
in one of its partition.

I can't directly mount it using normal way, for example, "mount
/dev/mtdblock0 /mnt", due to some other constraint.
(And initrd is not an option for me.)

Instead, I can load the data from the partition into RAM, which means
whole filesystem data is copied into some location of RAM. ( I know
the physical address, for the data to be loaded.) This copy operation
is done by bootloader side, not in Linux.

In this case, how can I mount the filesystem from RAM? Is there any
way to do this?

And I think the memory location of filesystem data should be reserved
not to be used by Linux kernel and user space application, am I right?


Thanks in advance,
Jongman.


2011-04-19 13:49:46

by Rabin Vincent

[permalink] [raw]
Subject: Re: How to mount filesystem from RAM ?

On Tue, Apr 19, 2011 at 11:32, Jongman Heo <[email protected]> wrote:
> Instead, I can load the data from the partition into RAM, which means
> whole filesystem data is copied into some location of RAM. ( I know
> the physical address, for the data to be loaded.) This copy operation
> is done by bootloader side, not in Linux.
>
> In this case, how can I mount the filesystem from RAM? Is there any
> way to do this?

Have a look at slram or phram in drivers/mtd/devices/.

> And I think the memory location of filesystem data should be reserved
> not to be used by Linux kernel and user space application, am I right?

One way to do this is by passing appropriate mem= arguments.

2011-04-20 01:05:33

by Jongman Heo

[permalink] [raw]
Subject: Re: How to mount filesystem from RAM ?

2011/4/19 Rabin Vincent <[email protected]>:
> On Tue, Apr 19, 2011 at 11:32, Jongman Heo <[email protected]> wrote:
>> Instead, I can load the data from the partition into RAM, which means
>> whole filesystem data is copied into some location of RAM. ( I know
>> the physical address, for the data to be loaded.) This copy operation
>> is done by bootloader side, not in Linux.
>>
>> In this case, how can I mount the filesystem from RAM? Is there any
>> way to do this?
>
> Have a look at slram or phram in drivers/mtd/devices/.
>
>> And I think the memory location of filesystem data should be reserved
>> not to be used by Linux kernel and user space application, am I right?
>
> One way to do this is by passing appropriate mem= arguments.
>

Hi, Rabin.

I think that is what I've been looking for. I'll try phram.

Thanks and regards,
Jongman.