[Linux-Xtensa] Require: Simdisk realization file

Hao Shen william.shen at gmail.com
Thu Apr 23 02:59:16 PDT 2009


Hi, Marc,

I have spent some time to try the simdisk function and I found this
/dev/simdisk is more like a file device which can be used to
read/write some data. I don't know if /dev/simdisk can be mount like a
block device such as hard disk and so on? Is there anyone has the
experience to use this simdisk as a filesystem?

Best regards,
Hao

On Wed, Apr 15, 2009 at 5:00 PM, Hao Shen <william.shen at gmail.com> wrote:
> Hi, Marc,
>
> On Wed, Apr 15, 2009 at 4:15 PM, Marc Gauthier <marc at tensilica.com> wrote:
>> Hi Hao,
>>
>> (Apologies for delayed responses, am on vacation right now :-)
> Thanks a lot for your help.
>>
>> Hao Shen wrote:
>>> In the linux code for the xtensa ISS porting, I found there is a
>>> simdisk module which need the support from the host simulation
>>> environment (maybe XTSC).
>>> For following functions: SYS_lseek, SYS_write, SYS_read and so on.
>>
>> These should be standard ISS simcalls.  I don't remember offhand any
>> additions to ISS necessary to support simdisk, though I could be wrong.
>
> Yes, it uses ISS simcalls and the host XTSC should realize some file
> operations on the host machine.
>>
>>> After some search works, I still can not get it from the official wiki
>>> website. Is there anyone who has such code and can open to academic
>>> users?
>>
>> The one person most familiar with it is no longer here.
>> Looking at it very briefly, seems you have to set SIMDISK0_FILENAME
>> (and SIMDISK1_FILENAME if you want two of them) in your kernel's
>> .config file, pointing at a file on the simulator host that contains
>> the disk image.  The file is typically e.g. an ext2 filesystem or
>> similar.
>>
>> You also need a device in the target's /dev to represent the simdisk(s).
>> I think the latest version of buildroot for Xtensa on linux-xtensa.org
>> already creates these devices.
>
> Yes, you are right. The simdisks are already in the /dev directory.
>>
>> And on your target, you need to mount this filesystem.
>> (You can even use it as your root fs, if specified in the kernel
>> cmdline, e.g. rootfs=/dev/... )
>>
>> Now, I don't think anyone's ever tried using simdisk for a swap file.
>> In fact, I'm not sure whether we've really tried swapping at all yet.
>> So, first try simdisk as a mounted fs.  And only once that works,
>> try swapping to it (note that for swapping, you also need to create
>> a file of the proper size on the host, before starting simulation;
>> and you need mkswap, etc).  That way if it only fails with swapping,
>> we'll know what to debug  :-)
>
> OK, I will try realize the simcall for filesystem on host machine first.
>
>>
>> I vaguely recall Piet looking into these things and possibly fixing
>> something related to swapping recently, but I don't know for sure.
>
> Thanks a lot for your help.
>
>>
>> Thanks,
>> -Marc
>>
>
> Best regards,
> --
> Hao Shen
>



-- 
Hao Shen


More information about the linux-xtensa mailing list