Forum Discussion

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

BINFMT_FLAT: bad header magic

Hello everyone

When I want to run a application software on NIOS II & uCLiunx, I got these fault message, how could I solve it?

<div class='quotetop'>QUOTE </div>

--- Quote Start ---

BINFMT_FLAT: bad header magic

BINFMT_FLAT: bad header magic

app_name:applet not found[/b]

--- Quote End ---

THX!

9 Replies

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

    --- Quote Start ---

    originally posted by goral@May 2 2006, 03:26 PM

    hello everyone

    when i want to run a application software on nios ii & ucliunx, i got these fault message, how could i solve it?

    <div class='quotetop'>quote

    --- quote end ---

    --- quote start ---

    binfmt_flat: bad header magic

    binfmt_flat: bad header magic

    app_name:applet not found

    --- Quote End ---

    THX!

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

    [/b]

    --- Quote End ---

    You application should be converted to FLAT format with -elf2flt link flag.

    Please check step11 and step15 in the buildroot guide.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    You application should be converted to FLAT format with -elf2flt link flag.

    Please check step11 and step15 in the buildroot guide.[/b]

    --- Quote End ---

    Thanks for youy reply!

    But the application software not include in busybox, such as servfox or other application, how do I change the Makefile.

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

    --- Quote Start ---

    originally posted by goral@May 2 2006, 08:50 PM

    <div class='quotetop'>quote

    --- quote end ---

    --- quote start ---

    you application should be converted to flat format with -elf2flt link flag.

    please check step11 and step15 in the buildroot guide.

    --- Quote End ---

    Thanks for youy reply!

    But the application software not include in busybox, such as servfox or other application, how do I change the Makefile.

    Thans!

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

    [/b]

    --- Quote End ---

    You have to find out link command, and add the elf2flt flags.

    You can take the patches for others applications as examples, in step13 of the guide.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    Mem-info:

    DMA per-cpu:

    cpu 0 hot: high 0, batch 1 used:0

    cpu 0 cold: high 0, batch 1 used:0

    DMA32 per-cpu: empty

    Normal per-cpu: empty

    HighMem per-cpu: empty

    Free pages: 596kB (0kB HighMem)

    Active:95 inactive:254 dirty:0 writeback:0 unstable:0 free:149 slab:996 mapped:0

    pagetables:0

    DMA free:596kB min:360kB low:448kB high:540kB active:380kB inactive:1016kB prese

    nt:8192kB pages_scanned:1600 all_unreclaimable? yes

    lowmem_reserve[]: 0 0 0 0

    DMA32 free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB page

    s_scanned:0 all_unreclaimable? no

    lowmem_reserve[]: 0 0 0 0

    Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pag

    es_scanned:0 all_unreclaimable? no

    lowmem_reserve[]: 0 0 0 0

    HighMem free:0kB min:128kB low:128kB high:128kB active:0kB inactive:0kB present:

    0kB pages_scanned:0 all_unreclaimable? no

    lowmem_reserve[]: 0 0 0 0

    DMA: 3*4kB 5*8kB 8*16kB 1*32kB 0*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB

    0*4096kB = 596kB

    DMA32: empty

    Normal: empty

    HighMem: empty

    2048 pages of RAM

    149 free pages

    518 reserved pages

    0 pages shared

    0 pages swap cached

    scheduling while atomic: servfox/0x0000000a/38

    Stack from 00285d14:<0>

    <0> 0000000a<0> 001a1438<0> 00000000<0> 00000000<0> 0003a7e8<0> 00000000<

    0> 00000010<0> 001c8bf4<0>

    <0> 00000010<0> 00000042<0> 00000000<0> 001c6c90<0> 00285d88<0> 0044f8c0<

    0> 001c8bf4<0> ffffc79b<0>

    <0> 00000001<0> 001a29f8<0> 00000000<0> 00200200<0> ffffc79b<0> 000195d4<

    0> 0044f340<0> 0023d644<0>

    <0> 0044f600<0> ffffe000<0> 000200d0<0> 001a2aac<0> 00033614<0> 0000000a<

    0> 0000009b<0> 24f47300<0>

    <0> 001c9564<0> 00000006<0> 00000000<0> 000000d0<0> 0044f340<0> 00000000<

    0> 00034bc4<0> 00000000<0>

    <0> 00000001<0> 000000d0<0> 000000d0<0> 00000000<0> 00248c00<0> 00000006<

    0> 000000d0<0> 00000000<0>

    Call Trace:<0>

    <0> [<0003f644>]<0> [<00000010>]<0> [<00000002>]<0> [<00000000>]<0>

    <0> [<00028c39>]<0> [<00000000>]<0> [<00000077>]<0> [<00000001>]<0>

    <0> [<0003fa5c>]<0> [<00000004>]<0> [<0003d4e0>]<0> [<00000000>]<0>

    <0> [<00000004>]<0> [<00000007>]<0> [<00003f01>]<0> [<0000000c>]<0>

    <0> [<00000004>]<0> [<00000001>]<0> [<00000000>]<0> [<00019230>]<0>

    <0> [<00008629>]<0> [<00077b54>]<0> [<00000002>]<0> [<00000000>]<0>

    <0> [<00032360>]<0> [<00000000>]<0> [<00000000>]<0> [<00000000>]<0>

    <0> [<00000000>]<0> [<00000000>]<0> [<00000000>]<0> [<00000000>]<0>

    <0> [<00003f01>]<0> [<00000000>]<0> [<00000005>]<0> [<00000044>]<0>

    <0> [<000200d2>]<0> [<00000044>]<0> [<00000000>]<0> [<00000001>]<0>

    <0> [<00000000>]<0> [<00000014>]<0> [<00000001>]<0> [<000073dc>]<0>

    <0> [<00004728>]<0> [<000009ec>]<0> [<0000000a>]<0> [<00010000>]<0>

    <0> [<00000030>]<0> [<00020000>]<0> [<00020000>]<0> [<00003e00>]<0>

    <0> [<00000080>]<0> [<00028c39>]<0> [<0001fff2>]<0> [<000027b0>]<0>

    <0> [<0000000a>]<0> [<00000000>]<0> [<000773f0>]<0> [<00053720>]<0>

    <0> [<00000000>]<0> [<00000000>]<0> [<00000000>]<0> [<00053a2c>]<0>

    <0> [<00000000>]<0> [<00002400>]<0> [<00000f00>]<0> [<00000000>]<0>

    <0> [<00000000>]<0> [<00000000>]<0> [<00000938>]<0> [<00000006>]<0>

    <0> [<00000000>]<0> [<00000000>]<0> [<00000018>]<0> [<00000000>]<0>

    <0> [<0000000b>]<0> [<00000000>]<0> [<00000000>]<0> [<00000001>]<0>

    <0> [<00000000>]<0>

    oom-killer: gfp_mask=0xd0, order=6

    Stack from 00285d80:<0>

    <0> 00000006<0> 00033604[/b]

    --- Quote End ---

    Hi

    After I compile my application software, I copy it into the /tmp folder, when I run it, I got so many message, could tell me why?

    The memory problem or others?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It looks like run out of memory. The DE2 has only 8M sdram.

    Try remove used file in ~/rootfs, remove unused devices in ~/download/rootfs_list, disable unused options in kernel, disable used options in busybox, use jffs2 on cfi mtd to store files or rootfs... all that help to reduce memory usage.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    It looks like run out of memory. The DE2 has only 8M sdram.

    Try remove used file in ~/rootfs, remove unused devices in ~/download/rootfs_list, disable unused options in kernel, disable used options in busybox, use jffs2 on cfi mtd to store files or rootfs... all that help to reduce memory usage.[/b]

    --- Quote End ---

    Hi hippo

    Can I using my application on my usb flash disk? I know a little about such as rootfs and jffs2.

    Thanks for your reply! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by goral@May 3 2006, 12:02 PM

    <div class='quotetop'>quote

    --- quote end ---

    --- quote start ---

    it looks like run out of memory. the de2 has only 8m sdram.

    try remove used file in ~/rootfs, remove unused devices in ~/download/rootfs_list, disable unused options in kernel, disable used options in busybox, use jffs2 on cfi mtd to store files or rootfs... all that help to reduce memory usage.

    --- Quote End ---

    Hi hippo

    Can I using my application on my usb flash disk? I know a little about such as rootfs and jffs2.

    Thanks for your reply! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif

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

    [/b]

    --- Quote End ---

    Yes, you can use usb disk.

    If you want jffs2, read step7,8 in the buildroot guide. You have to edit drivers/mtd/maps/alters.c .
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    Yes, you can use usb disk.

    If you want jffs2, read step7,8 in the buildroot guide.[/b]

    --- Quote End ---

    Hi hippo

    But when I run it on my usb disk, I got the same message, how I config it?

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

    --- Quote Start ---

    originally posted by goral@May 3 2006, 12:12 PM

    <div class='quotetop'>quote

    --- quote end ---

    --- quote start ---

    yes, you can use usb disk.

    if you want jffs2, read step7,8 in the buildroot guide.

    --- Quote End ---

    Hi hippo

    But when I run it on my usb disk, I got the same message, how I config it?

    Thanks!

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

    [/b]

    --- Quote End ---

    Check jay&#39;s thread,

    http://forum.niosforum.com/forum/index.php?showtopic=3763 (http://forum.niosforum.com/forum/index.php?showtopic=3763)

    First check your apps size,

    niso2-linux-uclibc-flthdr apps

    check your memory usage with "free" or "cat /proc/meminfo"

    Did the apps fail in program loading or runtime?