Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

How do I rebuild the ramfs.img file?

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.

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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?