Forum Discussion

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

Changing ROMFS start in flash

Hi:

I'm using the Nios2 IDE / Microtronix 1.4 dist.

I an currently loading my romfs.flash image starting at 0x200000 in my flash. I have a need to relocate the image and I now want to place it at 0x300000. When I do, the kernel boots and appears to moutn the filesystem but I get a "Kernel Panic: No init found..." message. When I relocate the FS image back to 200000, all is well. In looking at the kernel "system.map" file and other header files, it looks like 0x200000 is fixed as the start of the romfs.

How / where do I change this?

Thanks in advance

Nick

8 Replies

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

    it was defined in kernel arch/nios2nommu/kernel/vmlinux.lds.S line 12.

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

    Hi Hippo!

    Thanks for responding! In looking at the file "vmlinux.lds" I found the following...

    MEMORY {

    ram : ORIGIN = 0000000000, LENGTH = 0x08000000

    eram : ORIGIN = 0x08000000, LENGTH = 0

    romfs : ORIGIN = 0x08000000 + 0x200000, LENGTH = 0x00800000 - 0x200000

    }

    This file appears to be automatically generated though and I don't know what generates it. Should I modify it here and, if I do, will I need to recompile the kernel?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It was generated by IDE. You can try modify it and recompile kernel. But it may not work because the IDE might regenerate it. Maybe some one better in IDE help out.

    Why do you want to relocate it?

    Another old advice, work on Linux and build tools.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I want to move the FS further up in Flash to make room for a larger kernel (> 2MB). I am loading the kernel image starting at 0x0.

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

    You'd better add a PC to run Linux, and follow,

    http://forum.niosforum.com/forum/index.php?showtopic=3174 (http://forum.niosforum.com/forum/index.php?showtopic=3174)

    There are many people using the tools on Linux successfully. It is easy to use and customize. We are porting more apps and drivers. The file system is already compressed into kernel using initramfs. And I will post a compressed kernel this week. These will cut the flash usage a lot.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Maybe you used the mtd , if it is mtd1 -> kernel, mtd0-> romfs, then your change the <drivers>/mtd/maps/altera.c properly

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

    Hi Mount!

    I always wondered in which source file they have those 4 MTD partitions defined! In Altera.c! I changed the partition boundaries here it seems to work. Thnaks!

    Nick