Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


romFS or read-only RAM/ROM disk

Posted 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 disk

Posted 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.


alternate (1777 bytes)

romFS or read-only RAM/ROM disk

Posted 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.


alternate (1046 bytes)

romFS or read-only RAM/ROM disk

Posted 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 disk

Posted 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.

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists