On 02/21/14 13:43, Sebastian Huber wrote:
On 2014-02-21 14:38, Andre Marques wrote:
I tried to create a ramdisk as in
http://www.rtems.org/onlinedocs/doxygen/cpukit/html/group__rtems__ramdisk.html#gac6c99eed9f3b92bb4cf5184b25972e65
but the program exits during the rtems_blkdev_create() call, if I use
"/dev/rda" as the device path.
How does the code look like?
With
rtems_status_code sc;
ramdisk *rd;
const char device [] = "/dev/rda";
uint32_t media_block_size = 512;
rtems_blkdev_bnum media_block_count = 4000;
So this are 2048000 bytes. Has your target this amount of RAM?
I'm running qemu with -m 256M, so that should be plenty?
rd = ramdisk_allocate(NULL, media_block_size, media_block_count,
false);
if (rd != NULL) {
sc = rtems_blkdev_create(
device,
media_block_size,
media_block_count,
ramdisk_ioctl,
rd);
perror("rtems_blkdev_create -> ");
}
the program just exits without giving any reason before the
perror() call. I
assumed it was because the /dev directory wasn't there, so I created
the /dev
directory before the rtems_blkdev_create() call and then it gives
rtems_blkdev_create -> : Not supported
You get a status code as the return value. Use something like this
assert(sc == RTEMS_SUCCESSFUL)
I moved on from this to test_initialize_filesystem () and
test_shutdown_filesystem () instead, which seem to be working as I
wanted. I've made some questions at the very end of my previous e-mail
regarding that, don't know if you saw them.
_______________________________________________
rtems-devel mailing list
rtems-devel@rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel