Forum Discussion

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

Question on Git Branches to use [nios2mmu vs unstable-nios2mmu]

Hi everyone

I'm currenlty looking into using Linux on the NIOS for my company. Will be getting a DE4 from Terassic shortly but in the meantime I'm doing all the prepwork to understand as much as possible beforehand. I'm a complete newbie to this whole NIOS/Linux dev so please bear with me...

I'll be using MMU support. I have been trying the build with MMU support using the following git branches:

"unstable-nios2mmu" in linux-2.6

"trunk" in uClinux-dist

after setting Vendor=>Altera, Product=>nios2 and then defaulting config settings, building the project has always failed. I have followed the alterawiki instructions as I understand them.

Today after reading the info carefully on this page [alterawiki.com/wiki/Downloading_Linux_Distribution ], specifically the last paragraph, I realised that perphaps the "nios2mmu" branch should be checked out instead of "unstable-nios2mmu" as the shell segment on that page suggests. I then managed to complete a succesful build by again just using default config settings.

The last paragraph on the index nios/linux webpage [alterawiki.com/wiki/Linux_for_the_Nios_II_Processor] however suggests that the "unstable-nios2mmu" is the branch be used (to get a current build). I appreciate that the "unstable-nios2mmu" branch is at kernel rev 2.6.39 and "nios2mmu" branch at 2.6.35.

So, my questions are:

1: Should I be concerned about the "unstable-nios2mmu" branch not compiling

2: Assuming I can get "unstable-nios2mmu" to compile, which branch is the correct/better one to use

Cheers

Tones

36 Replies

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

    Hi everyone,

    I want to compile nios2-linux with mmu for Stratix 2. My linux-2.6 branch is nios2 with 3.1.0-rc7. In make menuconfig. In uClinux Distribution Configuration, under the Vendor/Product Selection Category I select Altera as Vendor and nios2 as Altera Products. In Kernel/Library/Defaults Selection i chhose Customize Kernel Settings.

    In Kernel Configuration, in Platform Options, i set the Memory base address and memory size. I also Select Compile and link device tree into kernel image and set the path to .dts file. In Device Drivers, i select Memory Technology Device(MTD) support and in it under Mapping drivers for chip access and in it I select Flash device physical memory based on OF description. In Character Devices-> Serial drivers i select Altera UART support and Altera UART console support. This is based on bootrags from .dts file. For Led Support I deslect it. The selection all based on http://www.alterawiki.com/wiki/devicetree. Every other selection is default.

    I save it. But make it cause errors.

    
    make -f tools/autotools.mk autotools-cache
    make: Entering directory `/home/nuar/Programs/nios2-linux/uClinux-dist'
    make: Nothing to be done for `autotools-cache'.
    make: Leaving directory `/home/nuar/Programs/nios2-linux/uClinux-dist'
    chmod +x tools/romfs-inst.sh tools/modules-alias.sh tools/build-udev-perms.sh
    . linux-2.6.x/.config; if ; then 
            mkdir -p `dirname $CONFIG_INITRAMFS_SOURCE`; 
            touch $CONFIG_INITRAMFS_SOURCE || exit 1; 
        fi
    rm -f linux-2.6.x/usr/initramfs_data.cpio
    make ARCH=nios2   CROSS_COMPILE=nios2-linux-gnu- O=/home/nuar/Programs/nios2-linux/uClinux-dist/linux-2.6.x -j8 -C ../linux-2.6  || exit 1
    make: Entering directory `/home/nuar/Programs/nios2-linux/linux-2.6'
      GEN     /home/nuar/Programs/nios2-linux/uClinux-dist/linux-2.6.x/Makefile
      CHK     include/linux/version.h
      Using /home/nuar/Programs/nios2-linux/linux-2.6 as source for kernel
      /home/nuar/Programs/nios2-linux/linux-2.6 is not clean, please run 'make mrproper'
      in the '/home/nuar/Programs/nios2-linux/linux-2.6' directory.
    make: ***  Error 1
    make: ***  Error 2
    make: Leaving directory `/home/nuar/Programs/nios2-linux/linux-2.6'
    make: ***  Error 1
    

    How to successfully compile nios2-linux with mmu? Having alot of trouble. Any help would be appreciated. Thank you.

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

    Hello Moganesh,

    I had the same problem, and I solved it by typing make mrproper.

    However, you will loose the configurations you have made, and possible some files that you have added in the folders. I would say make a backup of all the files you have changed, run make mrproper, and then restore the files.

    I hope this will be helpful. It solved the problem in my case.

    All the best,

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

    Hi Turhan,

    After struggling for hours and with help I managed to make it. I cd to linux-2.6 and make mrproper. Cd to uclinux-dist and make. I downloaded to FPGA. But the following error occur at nios2-terminal:

    nuar@nuar-desktop:~/Programs/nios2-linux/uClinux-dist/images$ nios2-download -g zImage.initramfs.gz

    rpm: Command not found.

    Using cable "USB-Blaster [USB 5-1.1]", device 1, instance 0x00

    Pausing target processor: OK

    Initializing CPU cache (if present)

    OK

    Downloaded 3942KB in 34.5s (114.2KB/s)

    Verified OK

    Starting processor at address 0xC3500000

    nuar@nuar-desktop:~/Programs/nios2-linux/uClinux-dist/images$ nios2-terminalnios2-terminal: connected to hardware target using JTAG UART on cable

    nios2-terminal: "USB-Blaster [USB 5-1.1]", device 1, instance 0

    nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate)

    Linux version 3.1.0-rc7-01765-g9b1c815 (nuar@nuar-desktop) (gcc version 4.1.2)# 18 Thu Sep 29 13:50:51 MYT 2011

    bootconsole [early0] enabled

    early_console initialized at 0xe4001020

    On node 0 totalpages: 8192

    free_area_init_node: node 0, pgdat c2550f8c, node_mem_map c25667a0

    DMA zone: 64 pages used for memmap

    DMA zone: 0 pages reserved

    DMA zone: 8128 pages, LIFO batch:0

    pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768

    pcpu-alloc: [0] 0

    Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128

    Kernel command line: init=/bin/init

    PID hash table entries: 128 (order: -3, 512 bytes)

    Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)

    Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)

    Memory available: 26920k/5522k RAM (2189k kernel code, 3332k data)

    NR_IRQS:32

    Calibrating delay loop... 77.82 BogoMIPS (lpj=155648)

    pid_max: default: 32768 minimum: 301

    Mount-cache hash table entries: 512

    NET: Registered protocol family 16

    bio: create slab <bio-0> at 0

    Switching to clocksource timer

    NET: Registered protocol family 2

    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

    TCP established hash table entries: 1024 (order: 1, 8192 bytes)

    TCP bind hash table entries: 1024 (order: 0, 4096 bytes)

    TCP: Hash tables configured (established 1024 bind 1024)

    TCP reno registered

    UDP hash table entries: 256 (order: 0, 4096 bytes)

    UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

    NET: Registered protocol family 1

    RPC: Registered named UNIX socket transport module.

    RPC: Registered udp transport module.

    RPC: Registered tcp transport module.

    RPC: Registered tcp NFSv4.1 backchannel transport module.

    JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.

    msgmni has been set to 52

    Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)

    io scheduler noop registered

    io scheduler deadline registered

    io scheduler cfq registered (default)

    ttyJ0 at MMIO 0x4001020 (irq = 1) is a Altera JTAG UART

    console [ttyJ0] enabled, bootconsole disabled

    console [ttyJ0] enabled, bootconsole disabled

    mousedev: PS/2 mouse device common for all mice

    TCP cubic registered

    NET: Registered protocol family 17

    Freeing unused kernel memory: 2740k freed (0xc2225000 - 0xc24d2000)

    Oops: Exception in kernel mode, sig: 4

    r1: c2000cc0 r2: 00000000 r3: 00004ff8 r4: 80000000

    r5: 00004b98 r6: 00000468 r7: ffffe000 r8: 00000002

    r9: c381c8e8 r10: c255bfe0 r11: 00000000 r12: 00000001

    r13: c3058de0 r14: c255cbb4 r15: 00000001

    ra: c0001004 fp: 00000006 sp: c3c19d5c gp: 00000000

    ea: c20b5d24 estatus: 00000001

    Kernel panic - not syncing: Attempted to kill init!

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

    This is about the timer you have used in your system. Please check the earlier posts in this thread. There is a detailed explanation for how to create the clock for the system. Cheers.

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

    Hi,

    The timer is fully featured and the period is in ms. But still having the same error.

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

    I had the same error because of the timer (kernel panic). I don't have any idea if it is caused by something else. I am sorry.

    Only think that pops to my mind is: "Oops: Exception in kernel mode, sig: 4"

    Do you follow the menuconfig settings as posted on the wiki? The problem occurs after freeing unused memory. You can perhaps try to understand what that means.