Hi all,
I've been investigating a bit to understand whether it's possible to compile for AR7 without crosscompiling. The goal would be having an AR7-compatible virtual machine, running for example Debian, where compile process is easier and can leverage tools like apt-get for libraries, etc.
The QEMU http://wiki.qemu.org project looks interesting since it can emulate a lot of RISC platforms: I tried to compile a simple hello world on Debian running on MIPSEL, but my executable doesn't run on G624T.
Somehow it's possible, since some german guys made a VM emulating an AR7 router running OpenWRT http://ar7-firmware.berlios.de/qemu/index.html.en
My goal would be far simpler: not emulating the router itself, but simply creating a compiling environment that allows direct compiling of source code.
Did you ever think of such an option? For other RISC platform it works quite well (ie. for home/smb nas's running on some SPARC processors).. do you have an idea of which emulation should one be looking for? Have you ever tried it?
I think it would be great to have a standard virtual machine image that allows compiling for AR7/routertech!
cheers
d
Compile for AR7-MIPSEL under QEMU - possible?
- rokafeller
- Regular
- Posts: 71
- Joined: Wed Jul 22, 2009 8:57 pm
- Location: Italy
Compile for AR7-MIPSEL under QEMU - possible?
Running D-Link DSL-G624T, PSP bootloader in place of the original Adam2, RouterTech Firmware v2.97. OpenVPN and port knocking services activated.
Re: Compile for AR7-MIPSEL under QEMU - possible?
AR7 emulation does sort of work run under QEMU, I have used my router bootloader mtd2 etc, but failed trying to load the atm/dsp drivers - if you remove those it could boot to a serial console command line I recall, but no Ethernet emulation either so all pretty academic only!
Routers with hard-drives can use optware to install native compile environments - I have one on my Linksys NSLU2 - but only needed because the cross-compile tools I tried not compatible with modern 64 bit Linux host. I am not familiar with any AR7 routers with usb hard-drives that are supported by OpenWrt, but if you had one (fritz-box?) you could do this with OpenWrt - but then you don't need it because OpenWrt has such a great buildroot tool to build a cross-compiler!
I don't see any mileage in trying to run this native under QEMU. A more realistic option is a standard 32-bit old Linux kernel virtual machine that works with a standard cross-compiling toolchain, without any special dependencies on system libraries, host 'make', 'bash', 'path' etc.
Should be easy to compile a "Hello World" with the pre-built "Hard-Hat" toolchain, not sure if the Acorp/mcmcc links still alive, but Linksys WAG200G GPL distros include one (GPL may be available from OpenWAG2000 sourceforge website). Compiling modern apps for AR7 is much harder, need to know all about the old kernel/library limitations - its too difficult to support on this site!
Routers with hard-drives can use optware to install native compile environments - I have one on my Linksys NSLU2 - but only needed because the cross-compile tools I tried not compatible with modern 64 bit Linux host. I am not familiar with any AR7 routers with usb hard-drives that are supported by OpenWrt, but if you had one (fritz-box?) you could do this with OpenWrt - but then you don't need it because OpenWrt has such a great buildroot tool to build a cross-compiler!
I don't see any mileage in trying to run this native under QEMU. A more realistic option is a standard 32-bit old Linux kernel virtual machine that works with a standard cross-compiling toolchain, without any special dependencies on system libraries, host 'make', 'bash', 'path' etc.
Should be easy to compile a "Hello World" with the pre-built "Hard-Hat" toolchain, not sure if the Acorp/mcmcc links still alive, but Linksys WAG200G GPL distros include one (GPL may be available from OpenWAG2000 sourceforge website). Compiling modern apps for AR7 is much harder, need to know all about the old kernel/library limitations - its too difficult to support on this site!
- thechief
- RouterTech Team
- Posts: 12067
- Joined: Wed Feb 01, 2006 10:22 pm
- Location: England, the Centre of Africa
- Contact:
Re: Compile for AR7-MIPSEL under QEMU - possible?
I agree that it is not a viable proposition to do it this way. Cross compilation is not complicated if you are freed from host system dependencies. We hope to release such a self-contained build system when we release firmware v2.96.
The Chief: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
No support via PM. Ask all questions on the open forum.
Re: Compile for AR7-MIPSEL under QEMU - possible?
That would be remarkable!thechief wrote:We hope to release such a self-contained build system when we release firmware v2.96.
- rokafeller
- Regular
- Posts: 71
- Joined: Wed Jul 22, 2009 8:57 pm
- Location: Italy
Re: Compile for AR7-MIPSEL under QEMU - possible?
totally agree.geekgirl wrote:That would be remarkable!thechief wrote:We hope to release such a self-contained build system when we release firmware v2.96.
Crosscompiling is not a difficult procedure itself, but due to the variety of involved components it can become really time consuming for non xcompilation experienced users.
thanks
d
Running D-Link DSL-G624T, PSP bootloader in place of the original Adam2, RouterTech Firmware v2.97. OpenVPN and port knocking services activated.