Forum Discussion

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

How to reserve memory at fixed address

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 ?

2 Replies

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

    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.