<div dir="ltr">Dear Sir,<div><br></div><div>I am doing interesting approach for testing samples/fileio ram disk in case of restoring disk image from NAND to SRAM.</div><div><br></div><div>On referencing, my target is sparc v8 compatible architecture.</div><div>Also, YAFFS file system is already ported on my target system.</div><div>But, because YAFFS file system spend some times on start-up, I am tring to change other approach for fasting file system start-up.</div><div><br></div><div>NAND Flash 64MB area have MS-DOS FAT32 Disk image.</div><div>and, my bootloader copy NAND flash 64MB area to SRAM from 0x0 to 0x4000000.</div><div><br></div><div>I modified cpukit/libblock/src/ramdisk-config.c in below;</div><div><br></div><div><font color="#0000ff">rtems_device_driver</font></div><div><font color="#0000ff">ramdisk_initialize(</font></div><div><font color="#0000ff">    rtems_device_major_number major,</font></div><div><font color="#0000ff">    rtems_device_minor_number minor __attribute__((unused)),</font></div><div><font color="#0000ff">    void *arg __attribute__((unused)))</font></div><div><font color="#0000ff">{</font></div><div><font color="#0000ff">     ....</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff">#if 0 // original code</font></div><div><font color="#e06666">            r->area = malloc(r->block_size * r->block_num);</font></div><div><font color="#e06666">            if (r->area == NULL) /* No enough memory for this disk */</font></div><div><font color="#e06666">            {</font></div><div><font color="#e06666">                r->initialized = false;</font></div><div><font color="#e06666">                continue;</font></div><div><font color="#e06666">            }</font></div><div><font color="#e06666">            else</font></div><div><font color="#e06666">            {</font></div><div><font color="#e06666">                r->initialized = true;</font></div><div><font color="#e06666">            }</font></div><div><font color="#ff0000">#else // modified. RAM disk image is mapping at 0x0 address</font></div><div><font color="#ff0000">            r->area = c->location;</font></div><div><font color="#ff0000">            r->initialized = true;</font></div><div><font color="#ff0000">#endif</font></div><div><font color="#0000ff">        }</font></div><div><font color="#0000ff">        else</font></div><div><font color="#0000ff">        {</font></div><div><font color="#0000ff">            r->malloced = false;</font></div><div><font color="#0000ff">            r->initialized = true;</font></div><div><font color="#0000ff">            r->area = c->location;</font></div><div><font color="#0000ff">        }</font></div><div><font color="#0000ff">        rc = rtems_disk_create_phys(dev, c->block_size, c->block_num,</font></div><div><font color="#0000ff">                                    ramdisk_ioctl, r, name);</font></div><div><font color="#0000ff">    ....<br></font></div><div><font color="#0000ff">    return RTEMS_SUCCESSFUL;</font></div><div><font color="#0000ff">}</font></div><div> </div><div>After this modification, I tested this.</div><div><br></div><div>In shell command, mkrd is executed successfully. and, ls command is OK  in mount point.</div><div>but, cp, cat, mv command is failed(crashed).</div><div><br></div><div>Or, after mkrd is executed successfully, I tried to executed mkdos command.</div><div>In this case, software is failed(crashed), too.</div><div><br></div><div>I guess that there is a problem in my modification or there is another approach method regarding this.</div><div><br></div><div>Please let me know how to resolve this.</div><div><br></div><div>Best Regards</div><div>Thomas Kim</div></div>