FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [July 2016 Threads] romFS or read-only RAM/ROM diskPosted by rasty1 on July 25, 2016 Hi,
I'm curious if someone tried (or can suggest any tool or ide) to create an image of RAM/ROM-disk that can be mounted by freeRTOS fs.
I'd like to create a disk image with files (for Web server) on my host and statically link it to application code.
Thanks
Rasty
romFS or read-only RAM/ROM diskPosted by rtel on July 25, 2016 FreeRTOS+FAT is a standard FAT file system, so any FAT image should
work. However I use a simpler approach whereby I create C structures
from the files I want on the disk, then during initialisation just copy
those structures onto the disk. You can see this being done in the
Win32 demo, where a RAM disk is created then the files from the
FreeRTOS-PlusDemoCommonFreeRTOSPlusTCP_DemosincludeDefaultWebPages.h
header file are copied onto the RAM disk. The bottom of the header file
has the following structure that describes the files being copied.
const xFileToCopy_t xHTTPFilesToCopy[] =
{
{ "freertos.html", sizeof( pcFreeRTOS_HTML_Data ), pcFreeRTOS_HTML_Data },
{ "logo.jpg", sizeof( pcLogo_JPG_Data ), pcLogo_JPG_Data },
{ "ftp.png", sizeof( pcFTP_PNG_Data ), pcFTP_PNG_Data }
};
I use a hex editor (hexedit) to create the structures - you just open
the file in the editor, copy it to the clipboard, then save the
clipboard as a C structure (which is one of the save options). It is
just a byte for byte copy so I'm sure you could create a very simple
script to do the same thing and thus have it automated.
romFS or read-only RAM/ROM diskPosted by rasty1 on July 25, 2016 Hi,
I see what you do in demo, that is nice, but requires RAM disk and Flash - 2 times more memory. Plus I'm not able to make a small RAM-disk (separate thread).
Under linux I'd create a virtual device, copy all files and dd'd it to a file, which can be converted to initilized C-array.
Above metioned can be done in script.
At run-time I'd just mount file system (RAM-disk) to that array.
Unfortunately we work with Windows and I did not discover yet how to do the same.
romFS or read-only RAM/ROM diskPosted by rasty1 on July 30, 2016 Hi
I found how to make an image of disk.
Is there any example how to mount file system to something like:
const char romfs[]={
0xeb,0x3c,0x90,0x4d,0x53,0x44,0x4f,0x53,0x35,0x2e,0x30,0x00,0x02,0x01,0x06,0x00,0x02,0x00,0x02,0xc3,0x00,0xf8,0x01,0x00,0x3f,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x80,0x00,0x29,0x12..
Thanks
Rasty
romFS or read-only RAM/ROM diskPosted by rtel on July 30, 2016 This is not something I have every attempted to do, but presumably if
you have suitable read and write functions, which no doubt would be very
similar to the RAM disk read and write functions (which just see the
disk as an array of bytes), then you could mount it in a very similar
way to the RAM disk.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|