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 to reserve memory at fixed address

Altera_Forum
Honored Contributor II
1,008 Views

Hi, 

 

I would like to reserve SDRAM memory for traces at a fixed address, so that I can examine this memory after an uncontrolled reboot of Linux. 

 

I used to set the option MEM=(totalMemory - MyTraceSize) in the kernel boot command with a "standard" Linux, in order to prevent Linux to access to the upper section of memory, reserving it for my traces. 

 

With µCLinux, this parameter seems to be ignored. So I tried to find out where the defines "na_ext_ram_end" or "na_ext_ram_size" were used. I found them only in "arch/nios2nommu/kernel/asm-offsets.c" : DEFINE(LINUX_SDRAM_END.... I change the value of the define, but it has no effect : when I dump /proc/meminfo, I have always 64Mb ! 

 

Where am I wrong ? Is there an other way to do it ?
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
300 Views

There is one line in the kernel linker script (arch/nios2nommu/kernel/vmlinux.lds.S): 

    eram    : ORIGIN = nasys_program_mem_end, LENGTH = 0 

 

or you can modify memory_end in arch/nios2nommu/kernel/setup.c to make it smaller.
0 Kudos
Altera_Forum
Honored Contributor II
300 Views

OK,  

 

thanks for the info. It works fine.
0 Kudos
Reply