Make bootable .elf file!

Hello. I just ended a project of mine using RIOT OS. I produced the .elf file and now I want to make this bootable, in order to start at QEMU autonomus. How can this be possible? Do I need to make an .img file? And if yes, how? Thanks!

Hello.

I just ended a project of mine using RIOT OS. I produced the .elf file and now I want to make this bootable, in order to start at QEMU autonomus. How can this be possible? Do I need to make an .img file? And if yes, how? Thanks!

Hi,

I just ended a project of mine using RIOT OS.

that's cool!

I produced the .elf file and now I want to make this bootable, in order to start at QEMU autonomus.

You mean you want to run your project on native? Have you tried to run 'make term'?

Best, Michael

Hi,

for the future, could you please just write to _one_ mailing list. Thanks!

Best, Michael

Hello and sorry for that multi-sending mails!

I have done this ‘make term’ and ‘make all’ processes. I have produced .elf and .hex files.

Now I want that .elf file to somehow boot on QEMU. Do I have to convert it to .bin and do the process? I am not sure how to do this. My .elf file runs fine on native debian. I try to boot from .elf wirh qemu-system-i386 command but nothing happens. Every solution you can come up with, would be a huge boost for me! Thanks!

Hello,

I am not sure of what you are doing with qemu, but, even if RIOT is called an OS, it can’t be executed on i386 without a mainstream OS (=Linux, Windows, …). Indeed, the “native” implementation is not a bootloader.

Loïc

Hi,

please compare this answer: https://lists.riot-os.org/pipermail/devel/2016-July/004312.html

Cheers, Ludwig

Hi Loïc!

Ah, ok I understood MiTsArAs was trying to run the native implementation on qemu-i385, which is not possible, right ?

But I did not know this target existed, anyway.

Loïc

Hi,

Ah, ok I understood MiTsArAs was trying to run the native implementation on qemu-i385, which is not possible, right ?

It is not possible to run a 'native' binary directly on 'qemu-i386', correct.

But I did not know this target existed, anyway.

To get an up-to-date overview of supported (to what degree varies a lot) boards:

Cheers, Ludwig

Ok I got it…

Now I get this on make all:

“make” -C /home/dimitris/RIOT/pkg/tlsf “make” -C /home/dimitris/RIOT/boards/qemu-i386 “make” -C /home/dimitris/RIOT/boards/x86-multiboot-common “make” -C /home/dimitris/RIOT/core “make” -C /home/dimitris/RIOT/cpu/x86 “make” -C /home/dimitris/RIOT/drivers “make” -C /home/dimitris/RIOT/sys “make” -C /home/dimitris/RIOT/sys/auto_init “make” -C /home/dimitris/RIOT/sys/quad_math /usr/lib/gcc/x86_64-linux-gnu/5/…/…/…/…/lib32/libm.so: undefined reference to `__get_cpu_features@GLIBC_PRIVATE’

It’s so messed up, I am searching at least for 4 hours now…

Hi!

Now I get this on make all:

[...] /usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib32/libm.so: undefined reference to `__get_cpu_features@GLIBC_PRIVATE'

There seems to be something broken. The linker should not care for provided .so files at all.

Please post *all* the output of

$ git reflog -n10 $ gcc -### $ make BOARD=qemu-i386 QUIET=0 clean all

so we can try to find the error.

But as others already mentioned, the port is not really maintained for a while now. Might be that it is quite broken for everyone right now.

Thanks, René

I got rid of this problem AT LAST!!

Now I have another problem!!

/RIOT/boards/x86-multiboot-common/linker.ld /usr/bin/ld: cannot find -lm collect2: error: ld returned 1 exit status

I opened RIOT/Makefile.include and I removed -lm parameter. It seemed to work. When I do this, the following result is coming to me:

size /home/user/RIOT/examples/time/bin/qemu-i386/time.elf text data bss dec hex filename 122233 2280 68228 192741 2f0e5 /home/user/RIOT/examples/time/bin/qemu-i386/time.elf objcopy -O binary /home/user/RIOT/examples/time/bin/qemu-i386/time.elf /home/user/RIOT/examples/time/bin/qemu-i386/time.hex

Is this the proper result?

P.S as for the prints Rene asked:

$git reflog -n10:

6dfec48 HEAD@{0}: clone: from https://github.com/RIOT-OS/RIOT

$ gcc -###

Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper Target: x86_64-linux-gnu Configured with: …/src/configure -v --with-pkgversion=‘Debian 5.3.1-13’ --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --with-arch-32=i586 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 5.3.1 20160323 (Debian 5.3.1-13)

$ make BOARD=qemu-i386 QUIET=0 clean all

SO MUCH TO PRINT!!!

Hi, can you please clarify what you are trying to achive? As Ludwig already pointed out to you [1] RIOT isn’t meant to run in a VM (or on a PC for that matter). Running RIOT as native (in a normal process, not in a VM!) should suffice for most use-cases that involve virtualization, and for running on real hardware we would really recommend to get your hands on some.

So before you stray into the wrong direction with your experiments (and getting more and more frustrated in the process), maybe it would be more helpful for you if we actually would know what you are trying to do.

Cheers, Martine

[1] https://lists.riot-os.org/pipermail/devel/2016-July/004337.html

All I want to do is boot an app that runs on a RTOS , from a VM without another OS running on it!!

So I found RIOT OS, I created the app, and I managed to run it through terminal, on native architecture.

Now I want to do the same with qemu-i386 architecture! That’s all!

Hi, RIOT is an RTOS targeted at embedded devices (even smaller in capacity than e.g. a Raspberry Pi), so I think you are trying something that isn’t really possible (yet) with RIOT. As mentioned previously, our QEMU port is more than experimental and currently the only port that supports x86 architecture (apart from native, which technically could also run on ARM architecture). Out-of-the-box we run at the moment on ARM Cortex-M, ARM7, AVR (Atmega), and MSP-430 architectures.

If you want to contribute so RIOT could run on other platforms than the mentioned above, you are welcome, but for now the support is at is.

Best regards, Martine