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++

Changing ROMFS start in flash

Altera_Forum
Honored Contributor II
961 Views

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
0 Kudos
8 Replies
Altera_Forum
Honored Contributor II
264 Views

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

0 Kudos
Altera_Forum
Honored Contributor II
264 Views

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?
0 Kudos
Altera_Forum
Honored Contributor II
264 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
264 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
264 Views

Hopefully, someone here will be able to help me out with this one http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif

0 Kudos
Altera_Forum
Honored Contributor II
264 Views

You&#39;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.
0 Kudos
Altera_Forum
Honored Contributor II
264 Views

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

0 Kudos
Altera_Forum
Honored Contributor II
264 Views

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
0 Kudos
Reply