Discussion:
samples/fileio - ram disk testing failure in case of restoring disk image from NAND to SRAM.
Thomas Kim
2014-10-20 09:07:12 UTC
Permalink
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_driver
ramdisk_initialize(
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;
continue;
}
else
{
r->initialized = true;
}
#else // modified. RAM disk image is mapping at 0x0 address
r->area = c->location;
r->initialized = true;
#endif
}
else
{
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);
....
return RTEMS_SUCCESSFUL;
}

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
Sebastian Huber
2014-10-20 12:07:21 UTC
Permalink
Post by Thomas Kim
NAND Flash 64MB area have MS-DOS FAT32 Disk image.
FAT32 is unsuitable for NAND flash devises unless you use a flash translation
layer.
--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber-L1vi/***@public.gmane.org
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Thomas Kim
2014-10-21 01:35:39 UTC
Permalink
Dear Sebastian,

NAND flash is only used for storing FAT32 disk image.
After this disk image of flash is copied on SRAM by bootloader, RTEMS DOS
file system is mounted for disk clone image on SRAM.

Best Regards,
Thomas

2014-10-20 21:07 GMT+09:00 Sebastian Huber <
Post by Sebastian Huber
Post by Thomas Kim
NAND Flash 64MB area have MS-DOS FAT32 Disk image.
FAT32 is unsuitable for NAND flash devises unless you use a flash
translation layer.
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
PGP : Public key available on request.
Diese Nachricht ist keine geschÀftliche Mitteilung im Sinne des EHUG.
Hoefle Marco
2014-10-21 08:14:26 UTC
Permalink
Hello Thomas,

How do you create the FATFS image? I have also an issue with FAT image linked into the application.

In my case getcwd() is not working correctly after being deeper than 3 subfolders.

But the rest seems to work ok.

I filed this bug

https://www.rtems.org/bugzilla/show_bug.cgi?id=2190

with a test case.



For us only Fat12 or FAT16 work, FAT32 didn't work with the image generation process described in the bug report.

Best regards,

Marco





________________________________

From: users [mailto:users-bounces-***@public.gmane.org] On Behalf Of Thomas Kim
Sent: Dienstag, 21. Oktober 2014 03:36
To: Sebastian Huber
Cc: rtems-users-***@public.gmane.org
Subject: Re: samples/fileio - ram disk testing failure in case of restoring disk image from NAND to SRAM.



Dear Sebastian,



NAND flash is only used for storing FAT32 disk image.

After this disk image of flash is copied on SRAM by bootloader, RTEMS DOS file system is mounted for disk clone image on SRAM.



Best Regards,

Thomas



2014-10-20 21:07 GMT+09:00 Sebastian Huber <sebastian.huber-L1vi/***@public.gmane.org>:

On 20/10/14 11:07, Thomas Kim wrote:


NAND Flash 64MB area have MS-DOS FAT32 Disk image.


FAT32 is unsuitable for NAND flash devises unless you use a flash translation layer.
--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber-L1vi/***@public.gmane.org
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Thomas Kim
2014-10-21 08:32:48 UTC
Permalink
Dear Marco,

I created FATFS disk image using OSFMount tool. you can download OSFMount
free version in below URL.
http://www.osforensics.com/tools/mount-disk-images.html

In my case, I created FAT16 image and FAT32 image for 64MB using raw image
type.

I did not test getcwd() directly. but, when I test in shell, there is no
problem using pwd, cd, ls.
but, I still have a problem for using file I/O command(cp, mv, rm, etc).

On referencing, there is not this problem in original fileio code(ram disk
area is allocated using malloc).

Best Regards,
Thomas.
Post by Hoefle Marco
Hello Thomas,
How do you create the FATFS image? I have also an issue with FAT image
linked into the application.
In my case getcwd() is not working correctly after being deeper than 3 subfolders.
But the rest seems to work ok.
I filed this bug
https://www.rtems.org/bugzilla/show_bug.cgi?id=2190
with a test case.
For us only Fat12 or FAT16 work, FAT32 didn’t work with the image
generation process described in the bug report.
Best regards,
Marco
------------------------------
*Sent:* Dienstag, 21. Oktober 2014 03:36
*To:* Sebastian Huber
*Subject:* Re: samples/fileio - ram disk testing failure in case of
restoring disk image from NAND to SRAM.
Dear Sebastian,
NAND flash is only used for storing FAT32 disk image.
After this disk image of flash is copied on SRAM by bootloader, RTEMS DOS
file system is mounted for disk clone image on SRAM.
Best Regards,
Thomas
2014-10-20 21:07 GMT+09:00 Sebastian Huber <
NAND Flash 64MB area have MS-DOS FAT32 Disk image.
FAT32 is unsuitable for NAND flash devises unless you use a flash translation layer.
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
PGP : Public key available on request.
Diese Nachricht ist keine geschÀftliche Mitteilung im Sinne des EHUG.
Loading...