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++
공지
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 토론

Linux - running kernel from flash to free ram

Altera_Forum
명예로운 기여자 II
1,091 조회수

Hello, is it possible to run the kernel directly from the flash? It seems the kernel is currently copied to SDRAM before being executed, but my system has very little RAM so I would like to be able to run the kernel directly from flash if possible. This is just during development to begin with, because my custom board is only equipped with 2MB RAM.  

 

....or if anyone has a better idea to minimize the RAM consumption I would very much like to hear it :-) 

 

Currently my kernel takes up 813kb in RAM. But when I try to run a program like mount it says there aren't enough RAM free. 

 

A few things I have tried: 

- I've tried to change the Memory Device to "ext_flash" instead of "sdram under" "kernel options" under "Nios II Linux Kernel" but this doesn't seem to be the way to do it since it results in a compiler error ....something about undefine flash-thing....and furthermore it seems Linux wants to use flash as program-memory and that was not what I was looking for. I only wanted the kernel to execute from flash ;-) 

 

- I&#39;ve tried to modify the kconfig-file (<- the one with all the options for the kernel - used by menuconfig I believe). I saw this file had a few lines that was commented out. One of them said something like:  

 

config ROMKERNEL 

 

I modified the file to include this option......ugly but hey - I had to try it, right? It didn&#39;t work - big surprise ....guess there was a reason why this was commented out in the first place http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/cool.gif . 

 

My custom board consist of: 2MB flash/2MB SDRAM/Cyclone EP1C6/...and some other stuff not relevant here. 

 

Hope you guys have a few suggestions for me. 

 

Regards  

 

Goon http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/blink.gif
0 포인트
2 응답
Altera_Forum
명예로운 기여자 II
379 조회수

Hi Goon, 

 

If you want the kernel to execute in place, the following should be looked after (many of them needs changes on source code or Makefiles): 

1. when building the kernel, give the Text a flash address, and give data and bss ram addresses. Probably you need to change the makefiles and linker script. 

2. when loading the kernel, the bootstrap code has to copy the data to the ram address where they are linked to. Probably you need to change head.S 

3. Special attention to the vector. The simplest way is change the core: set that address 0x20 from the start of kernel in flash. 

 

Good luck,
0 포인트
Altera_Forum
명예로운 기여자 II
379 조회수

Goon, 

 

Have you made progress on this? I&#39;m interested in this, too.
0 포인트
응답