Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-06

how to generate Free Pascal program for Open source router OpenWrt?

4 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dennis

I wrote a free pascal program in ubuntu Linux and wanted to deploy it to run in a netgear router through open router firmware OpenWrt. To test it, I copied the program into a OpenWrt virtualbox virtual machine but when I ran it, it said:
[ 1891.890545] MyprogramName[1573] general protection ip:bf8e3f86 sp:bf8e2cd4 error:0 Segmentation fault

I suspect it's because my compile target is wrong but I thought OpenWrt is already based on linux.
Please, in the CPU family, I cannot find the one used by Netgear router which is Atheros AR7161

Can anyone give me some directions ?

Thanks a lot.

Dennis

Mark Morgan Lloyd
to Dennis
Dennis wrote 11 lines
I wrote a free pascal program in ubuntu Linux and wanted to deploy it to run in a netgear router through open router firmware OpenWrt. To test it, I copied the program into a OpenWrt virtualbox virtual machine but when I ran it, it said: [ 1891.890545] MyprogramName[1573] general protection ip:bf8e3f86 sp:bf8e2cd4 error:0 Segmentation fault I suspect it's because my compile target is wrong but I thought OpenWrt is already based on linux. Please, in the CPU family, I cannot find the one used by Netgear router which is Atheros AR7161

Just to keep things going since I'm in no way an expert: Google suggests that's MIPS24k, what's the output from cat /proc/cpuinfo on that box? What does the file command have to say about your binary? What version of FPC are you using?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]
Unknown author
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 8 lines
Dennis wrote: >I wrote a free pascal program in ubuntu Linux and wanted to deploy >it to run in a netgear router through open router firmware >OpenWrt. >To test it, I copied the program into a OpenWrt virtualbox virtual >machine but when I ran it, it said: >[ 1891.890545] MyprogramName[1573] general protection ip:bf8e3f86 >sp:bf8e2cd4 error:0 Segmentation fault

AFAIK VirtualBox is Intel x86 and AMD64 compatible. It will not run code for any other architecture. I couldn't understand your post but if you're trying to run MIPS code under VirtualBox, it will not work no matter what OS.

Then again maybe I am wrong and somebody ported VirtualBox to MIPS...

Dennis Poon
to Unknown author

I did some search and it seems the CPU Atheros used by Netgear is MIPS. I will try to learn how to cross compile into MIPS. If it does not work on the virtual box, I will try to run it directly in the router via ssh. (the virtual box virtual machine image was provided by the OpenWrt web site. The machine ran ok, just not ok with my free pascal compiled program).

Thanks for all your feedback.

Dennis

Show quoted text 31 lines
On Tue, Jun 04, 2013 at 03:09:07PM +0000, Mark Morgan Lloyd wrote: > Dennis wrote: > >> I wrote a free pascal program in ubuntu Linux and wanted to deploy >> it to run in a netgear router through open router firmware >> OpenWrt. >> To test it, I copied the program into a OpenWrt virtualbox virtual >> machine but when I ran it, it said: >> [ 1891.890545] MyprogramName[1573] general protection ip:bf8e3f86 >> sp:bf8e2cd4 error:0 Segmentation fault >> AFAIK VirtualBox is Intel x86 and AMD64 compatible. It will not run code for any other architecture. I couldn't understand your post but if you're trying to run MIPS code under VirtualBox, it will not work no matter what OS. Then again maybe I am wrong and somebody ported VirtualBox to MIPS... _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2013.0.3343 / Virus Database: 3184/6381 - Release Date: 06/03/13