Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12603 Discussions

How do I rebuild the ramfs.img file?

Altera_Forum
Honored Contributor II
1,587 Views

I am doing this development using a cyclone board with a custom FPGA configuration. With this build the kernel and ROM file system seem to work fine but I have no access to the ram file system. I assume I need to rebuild the RAMFS.IMG file but it is unclear to me how to do it. Any help would be appreciated.

0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
910 Views

Hello Halfdome, 

 

Are you using Nios II with the MicroC-OS/II Software Component Read-only file system? This file system only runs out of flash, not out of RAM. The Webserver example in the Nios II IDE is an example of how to use that read-only filesystem. If not, what ram file system are you referring to? 

 

Best regards, 

Stephen O'Reilly 

Altera Embedded Applications Engineering
0 Kudos
Altera_Forum
Honored Contributor II
910 Views

Hello HalfDome, 

 

If you're talking about Linux the procedure is something like this: 

 

dd from /dev/zero to /dev/ram0 

mke2fs on /dev/ram0 

tune2fs on /dev/ram0 

dd from /dev/ram0 to ramfs.img 

run 'holes' on ramfs.img (this last step is required so that the reverse 'expand' command works) 

 

I think the ramfs.img that is included with distribution is a couple of years old so I'll run through the procedure today and elaborate a bit on the above steps. If you have access to a Linux Host workstation, check out /usr/src/linux/Documentation/ramdisk.txt (i think) -- there should be some overlap. 

 

mike
0 Kudos
Altera_Forum
Honored Contributor II
910 Views

How does one locate the RAMDISK? We have several possible locations in different RAMs: SDRAM, Staic RAM, internal ram. Where does the physical address of the /dev/RAM0..RAM16 get specified so we can locate it where we want?

0 Kudos
Reply