Forum Discussion

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

ERROR:"BINFMT_FLAT: bad magic/rev"

When I run a application program on nios II system,

the sdk shell show :

BINFMT_FLAT: bad magic/rev (0x3000000, need 0x4)
BINFMT_FLAT: bad magic/rev (0x3000000, need 0x4)

why?????

2 Replies

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

    The kernel is reporting that the file you're running isn't a valid executable file format. For all Nios II Linux systems, each executable must be in a flat binary format. This usually entails running elf2flt on any applications that you build.

    If you'd like I can take a look at the Makefile you're using and try to figure out what's going on. If so, please pm me or post it here in the forum.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    if you run a shellscript you get the same error message.

    To run shellscripts following option must be compiled into the kernel:

    Executable file formats ===> [*] Kernel support for MISC binaries