Software tools and hardware platform: I run with KDS3.0.0 and SDK library 1.1, and run this on a Freescale K64F.
I created the following simplified code snippet, with all error checking removed. First a ram disk is created, then a file is written to it. Writing goes very slow:
| //Simplified version of creating ramdisk without error checking | | |
const NIO_MEM_INIT_DATA_STRUCT NIO_MEM = { (uint32_t) myData, 8192};
_nio_dev_install(A_DEVICE, &nio_mem_dev_fn, (void *) &NIO_MEM) == NULL);
file_desc = open(A_DEVICE, 0);
io_mfs_install(file_desc, DISK, (_file_size) 0);
disk_file_desc = open(DISK, O_RDWR);
_io_register_file_system(disk_file_desc, DISK);
//write to a_file without error checking
a_file = fopen(a_file_name, "w");
fwrite(data_to_write, sizeof(char), size_of_data, a_file);
fclose(a_file)
Hope this code snippet helps.