samples/fileio - ram disk testing failure in case of restoring disk image from NAND to SRAM.

Thomas Kim at
Mon Oct 20 09:07:12 UTC 2014

Dear Sir,

I am doing interesting approach for testing samples/fileio ram disk in case
of restoring disk image from NAND to SRAM.

On referencing, my target is sparc v8 compatible architecture.
Also, YAFFS file system is already ported on my target system.
But, because YAFFS file system spend some times on start-up, I am tring to
change other approach for fasting file system start-up.

NAND Flash 64MB area have MS-DOS FAT32 Disk image.
and, my bootloader copy NAND flash 64MB area to SRAM from 0x0 to 0x4000000.

I modified cpukit/libblock/src/ramdisk-config.c in below;

    rtems_device_major_number major,
    rtems_device_minor_number minor __attribute__((unused)),
    void *arg __attribute__((unused)))

#if 0 // original code
            r->area = malloc(r->block_size * r->block_num);
            if (r->area == NULL) /* No enough memory for this disk */
                r->initialized = false;
                r->initialized = true;
#else // modified. RAM disk image is mapping at 0x0 address
            r->area = c->location;
            r->initialized = true;
            r->malloced = false;
            r->initialized = true;
            r->area = c->location;
        rc = rtems_disk_create_phys(dev, c->block_size, c->block_num,
                                    ramdisk_ioctl, r, name);

After this modification, I tested this.

In shell command, mkrd is executed successfully. and, ls command is OK  in
mount point.
but, cp, cat, mv command is failed(crashed).

Or, after mkrd is executed successfully, I tried to executed mkdos command.
In this case, software is failed(crashed), too.

I guess that there is a problem in my modification or there is another
approach method regarding this.

Please let me know how to resolve this.

Best Regards
Thomas Kim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list