Forum Discussion

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

How to write elf file to a certain address?

any reference?

or suggestions?

3 Replies

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

    <div class='quotetop'>QUOTE (babysnow @ Jul 19 2009, 12:49 PM) <{post_snapback}> (index.php?act=findpost&pid=23196)</div>

    --- Quote Start ---

    any reference? or suggestions?[/b]

    --- Quote End ---

    Do you already use the upcoming MMU-enabled "full" version of Linux on NIOS (right now available only from WindRiver) ? Otherwise elf format is not supported anyway, but "flat" is used.

    AFAIK, elf format does use a fixed (virtual) load address for the executable, which is assigned to a physical address by the MMU hardware. Without an MMU, the flat format allows for relocating the executable onto a free address area while loading it into memory. The load address can&#39;t be fixed, as of course this address might not be free when loading the executable, This this does not seem to make sense.

    -Michael

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

    <div class='quotetop'>QUOTE (mschnell @ Jul 19 2009, 07:04 AM) <{post_snapback}> (index.php?act=findpost&pid=23197)</div>

    --- Quote Start ---

    <div class='quotetop'>QUOTE (babysnow @ Jul 19 2009, 12:49 PM) <{post_snapback}> (index.php?act=findpost&pid=23196)

    --- Quote End ---

    --- Quote Start ---

    any reference? or suggestions?[/b]

    --- Quote End ---

    Do you already use the upcoming MMU-enabled "full" version of Linux on NIOS (right now available only from WindRiver) ? Otherwise elf format is not supported anyway, but "flat" is used.

    AFAIK, elf format does use a fixed (virtual) load address for the executable, which is assigned to a physical address by the MMU hardware. Without an MMU, the flat format allows for relocating the executable onto a free address area while loading it into memory. The load address can&#39;t be fixed, as of course this address might not be free when loading the executable, This this does not seem to make sense.

    -Michael

    [/b]

    --- Quote End ---

    Thank you for your reply!

    I am confused. &#956;Clinux system is without MMU, How can I add MMU to the project?

    What about some system-basic level methods? Such as use the function IOWR,IORD of fwrite(),fread() series?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    <div class='quotetop'>QUOTE (babysnow @ Jul 20 2009, 10:30 AM) <{post_snapback}> (index.php?act=findpost&pid=23205)</div>

    --- Quote Start ---

    I am confused. &#956;Clinux system is without MMU, How can I add MMU to the project?[/b]

    --- Quote End ---

    If you have a Quartus Version >= 8.1 or so, you can add an MMU to the NIOS CPU. But beware, MMU-based Linux for NIOS is not publicly available (yet),

    <div class='quotetop'>QUOTE (babysnow @ Jul 20 2009, 10:30 AM) <{post_snapback}> (index.php?act=findpost&pid=23205)</div>

    --- Quote Start ---

    What about some system-basic level methods? Such as use the function IOWR,IORD of fwrite(),fread() series?[/b]

    --- Quote End ---

    I don&#39;t understand the relation of this question to the original post. With Linux you always should write portabnle software. i.e. to access hardware from user land you should write Kernel I/O-drivers or at least use uio. see e.g. http://www.nioswiki.com/accessing_hardware..._space_programs (http://www.nioswiki.com/accessing_hardware_registers_from_user_space_programs) .

    File i/o is not related at all.

    -Michael