Forum Discussion

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

linux/cygwin build difference

Hi, guys,

I'm trying to build a new kernel for my Nios II Dev board with PCI support. I am using the patch from Microtronix and here comes the problem.

I was able to compile a kernel with initramfs on Linux and loaded to the Nios board, but during booting, it gave these messages:

uClinux/Nios II
Altera Nios II support (C) 2004 Microtronix Datacom Ltd.
Built 1 zonelists
Kernel command line:
PID hash table entries: 128 (order: 7, 2048 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory available: 15080k/16384k RAM, 0k/0k ROM (678k kernel code, 432k data)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Linux NoNET1.0 for Linux 2.6
Linux version 2.6.11-uc0 (bdu@Ben) (gcc version 3.4.5)# 9 Tue Mar 14 14:01:38 MS
T 2006 
uClinux/Nios II
Altera Nios II support (C) 2004 Microtronix Datacom Ltd.
Built 1 zonelists
Kernel command line:
PID hash table entries: 256 (order: 8, 4096 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory available: 15052k/16384k RAM, 0k/0k ROM (678k kernel code, 432k data)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Kernel panic - not syncing: Can't create rootfs

It seems like it booted twice and double the memory and got a kernel panic.

The engineer from Microtronix claimed that it's working with their cygwin/IDE 5.1. So I tried and it and it looks working, but I cannot compile initramfs with it. Following this link (http://forum.niosforum.com/forum/index.php?showtopic=3461&hl=romfs) I see it's almost mission impossible.

So I am wondering, what makes the difference between linux build and cygwin/IDE build? How can I fix my problem. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif

Any help or suggestion will be appreciated.

7 Replies

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

    I would suggest sticking with the linux build tree.. once you get it working, it will be well worth it. However, regarding your problem... it does seem odd. Have you ruled out hardware as being faulty? Try compiling in initramfs in the linux build and paste your boot output... your problem is rather odd.

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

    I did one more compile with initramfs and here is the boot message:

    Linux version 2.6.11-uc0 (bdu@Ben) (gcc version 3.4.5)# 8 Thu Mar 16 13:58:10 MST 2006
    
    uClinux/Nios II
    Altera Nios II support (C) 2004 Microtronix Datacom Ltd.
    Built 1 zonelists
    Kernel command line: 
    PID hash table entries: 128 (order: 7, 2048 bytes)
    Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
    Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
    Memory available: 14476k/16384k RAM, 0k/0k ROM (828k kernel code, 884k data)
    Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
    Linux NoNET1.0 for Linux 2.6
    Autoconfig PCI channel 0x010d5c00
    Scanning bus 00, I/O 0x00000000:0x00000001, Mem 0x90000000:0xa0000001
    00:00.0 Class 0600: 1939:1002 (rev 01)
            I/O unavailable -- skipping
            Mem at 0x90000000 
            Mem at 0x91000000 
    00:01.0 Class 0c00: 104c:8025 (rev 01)
            Mem at 0x92000000 
            Mem at 0x92004000 
    found at 2, start 0x91000000, end 0x91ffffff
    pci_fixup_irqs(010e6128, 010e6130)
    pcibios_map_irq(dev:011e8400, slot:1, pin:1) returning irq:5
    pcibios_map_irq: PCI_MEM_START:0x90000000 PCI_MEM_END:0xA0000000
                     ****Warning: Hard coded****
    pcibios_map_irq(dev:011e8800, slot:1, pin:1) returning irq:5
    pcibios_map_irq: PCI_MEM_START:0x90000000 PCI_MEM_END:0xA0000000
                     ****Warning: Hard coded****
    Linux version 2.6.11-uc0 (bdu@Ben) (gcc version 3.4.5)# 8 Thu Mar 16 13:58:10 MST 2006
    
    uClinux/Nios II
    Altera Nios II support (C) 2004 Microtronix Datacom Ltd.
    Built 1 zonelists
    Kernel command line: 
    PID hash table entries: 256 (order: 8, 4096 bytes)
    Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
    Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
    Memory available: 14464k/16384k RAM, 0k/0k ROM (828k kernel code, 884k data)
    Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
    Kernel panic - not syncing: Can&#39;t create rootfs

    You can see the PCI is working at some level. Also it took a few seconds to issue the second boot message after it gave warnings about "hard coded".

    Any idea? Thanks!

    --- Quote Start ---

    originally posted by jdhar@Mar 16 2006, 11:19 AM

    i would suggest sticking with the linux build tree.. once you get it working, it will be well worth it. however, regarding your problem... it does seem odd. have you ruled out hardware as being faulty? try compiling in initramfs in the linux build and paste your boot output... your problem is rather odd.

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=13512)

    --- quote end ---

    --- Quote End ---

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

    it really does seem like a hardware issue... especially if you have tried a minimum build and it still does it. Have you tried running out of flash maybe to see if it still happens?

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

    But I ftped the kernel binary file from Microtronix and tested on the same board and it&#39;s working fine. They claimed it&#39;s built on cygwin/IDE 5.1.

    I wish I could build from toolchain and eventually add my part of modules. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif

    --- Quote Start ---

    originally posted by jdhar@Mar 16 2006, 03:26 PM

    it really does seem like a hardware issue... especially if you have tried a minimum build and it still does it. have you tried running out of flash maybe to see if it still happens?

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=13519)

    --- quote end ---

    --- Quote End ---

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

    Is it a custom board? As a general rule, just because one piece of software works, doesn&#39;t mean your hardware is good... when I design custom hardware, I subject it to extensive hardware tests beforehand to make sure it&#39;s functional.

    I agree that it&#39;s unlikely to be hardware, but any custom hardware should be thoroughly tested before loading something like linux on it. I can&#39;t tell you how many times I have pulled my non-existant hair out because software wasn&#39;t working, and it was a hardware issue.

    I don&#39;t know if this is it or not, but once, I got weird results building on my linux machine when I Was running a 64-bit kernel - because gcc wasn&#39;t setup correctly. Just thought I would mention that. Other than that, the other linux gurus can help you out more... sorry http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Did you get error message when applying the patches?

    Or you can try out altera pci core, which is supported in the new kernel.

    Check post#52 in the buildroot guide.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It&#39;s not a customized board and I didn&#39;t have error during the patches.

    I asked Microtronix and received a packet with their own cross compiler (not free!!). I simply changed my PATH to their compiler. It&#39;s compiled well and worked!

    I&#39;d bet they tweak their compiler for the board somehow. Unfortnately no source code sent to me. I&#39;ll try to diff the toolchain when I pass this project.

    Thanks for all the help!

    --- Quote Start ---

    originally posted by hippo@Mar 16 2006, 10:51 PM

    did you get error message when applying the patches?

    or you can try out altera pci core, which is supported in the new kernel.

    check post#52 in the buildroot guide.

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=13536)

    --- quote end ---

    --- Quote End ---