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

uC Linux question

Altera_Forum
Honored Contributor II
2,032 Views

I have made a bootloader, but when I start up the kernel it says the following. Somebody who knows what's wrong? 

 

Console output: 

------------------------------------------------------------------------------------------- 

 

Have copied data to SDRAM!!! 

Linux version 2.6.5-uc0 (MSE@ECT-MSE) (gcc version 3.3.3 (Altera Nios II 1.0 b316))# 7 Tue Aug 31 08:58:41 WEDT 2004 

 

 

uClinux/Nios II 

 

Altera Nios II support © 2004 Microtronix Datacom Ltd. 

 

 

setup_arch: No persistant network settings signature at 007F0000 

 

On node 0 totalpages: 3840 

 

DMA zone: 0 pages, LIFO batch:1 

 

Normal zone: 3840 pages, LIFO batch:1 

 

BUG: wrong zone alignment, it will crash 

 

HighMem zone: 0 pages, LIFO batch:1 

 

Built 1 zonelists 

 

Kernel command line: root=/dev/mtdblock0 ro 

 

PID hash table entries: 16 (order 4: 128 bytes) 

 

Memory available: 13636k/3840k RAM, 0k/0k ROM (1250k kernel code, 283k data) 

 

Calibrating delay loop... 

 

 

------------------------------------------------------------------------------- 

 

Regards 

GreateWhite.DK
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
622 Views

Hi GreateWhite.DK

 

Not sure how your bootloader works. Just remind you that after the copy, the text and data must be in the place they are linked. And when the bootloader copys them, watch out the alignment, since the source address might not align with the destination. 

 

Regards,
0 Kudos
Altera_Forum
Honored Contributor II
622 Views

Hi and thx for your answer 

 

I have changed a little bit in the nios2_system.h file. The SDRAM adr is by default 0x1000000. I have now set that to 0x1100000 and corrected the two other varibles so that they have the new correct values. Now the system.map of my linux project says that it begins at 0x1100000(which it should). So the vmlinux.bin file is just copied to my SDRAM starting at 0x1100000 and until the end of the binary data. After this I just execute the kernel. 

I have come a bit futher with execution now. Now it freezes in the ASM code at line aprox 166 in the linux-2.6.x/arch/nios2nommu/kernel/process.c file.  

I am really new at this kernel stuff so plz dazzle me with your knowledge http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/ohmy.gif ) 

 

Regards 

GreateWhite.DK
0 Kudos
Altera_Forum
Honored Contributor II
622 Views

dont know why you keep 1M memory (I assume for the loader, since 1M is too small to contain the bin file). I would like to run the loader in flash and leave all the memory to kernel. 

 

The fact that the clone system call float away suggests that your exception handler is not in the right place. I just learned that the current kernel port assumes the exception offset (from the starting of the sdram) is 0x20 (the default value in the core). In your case, since you moved the kernel 1M forward, you need to change that value to 0x100020 in the core. 

 

Hope this helps,
0 Kudos
Reply