User Tools

Site Tools


openwrt_coding

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
openwrt_coding [2009/06/11 03:48]
eric
openwrt_coding [2013/05/21 16:12] (current)
eric
Line 3: Line 3:
 //Written by Eric Bishop <eric[AT]gargoyle-router.com>// //Written by Eric Bishop <eric[AT]gargoyle-router.com>//
  
-Part I: A Simple Program In C added 8/23/2007+[[openwrt_coding#Part I: A Simple Program In C -- 8/23/2007]]
  
-Part II: C++ and the Standard Template Library (STL) added 10/10/2007+[[openwrt_coding#Part II: C++ and the Standard Template Library (STL) -- 10/10/2007]]
  
-Part III: Building and Using the Kamikaze SDK added 12/9/2007+[[openwrt_coding#Part III: Building and Using the Kamikaze SDK -- 12/9/2007]]
  
 =====Tutorial Moved To New Location -- 7/26/2008===== =====Tutorial Moved To New Location -- 7/26/2008=====
  
-I haven't updated this document in a while so be aware that some of the information here may be a bit out of date. I wrote this document almost a year ago now, but it still contains useful information about programming in C/C++ for OpenWrt. I recently released Gargoyle, a new web interface for OpenWrt, and I've moved this tutorial onto the official Gargoyle website. My old, website (which was kind of pathetic) is now obsolete, and has been taken down. I apologize for any inconvenience this may cause.+I haven't updated this document in a while so be aware that some of the information here may be a bit out of date. I wrote this document almost a year ago now, but it still contains useful information about programming in C/C++ for OpenWrt.  I recently released Gargoyle, a new web interface for OpenWrt, and I've moved this tutorial onto the official Gargoyle website. My old, website (which was kind of pathetic) is now obsolete, and has been taken down. I apologize for any inconvenience this may cause.
  
  
-This tutorial now makes use of external stylesheets to fit in with the Gargoyle website theme. I realize this may make it more difficult to download and easily reference on your local computer, so I will continue to make the old version of this tutorial available. This version can be found here.+This tutorial now makes use of external stylesheets to fit in with the Gargoyle website theme. I realize this may make it more difficult to download and easily reference on your local computer, so I will continue to make the old version of this tutorial available. This version can be found [[http://gargoyle-router.com/old-openwrt-coding.html|here]].
  
  
Line 51: Line 51:
  
 helloworld: helloworld.o helloworld: helloworld.o
-     $(CC) $(LDFLAGS) helloworld.o -o helloworld helloworld.o: +     $(CC) $(LDFLAGS) helloworld.o -o helloworld 
-     helloworld.c $(CC) $(CFLAGS) -c helloworld.c + 
 +helloworld.o: helloworld.c  
 +     $(CC) $(CFLAGS) -c helloworld.c 
  
 # remove object files and executable when user executes "make clean" # remove object files and executable when user executes "make clean"
Line 286: Line 288:
 </shell>  </shell> 
  
-Now, ssh into the router. We just copied the package to root's home directory so we are finally ready to install our program. In root's home directory, (where we end up immediately after connecting to the router via ssh) type "ipkg install helloworld_1_mipsel.ipk" and the ipkg system will do the rest.+Now, ssh into the router. We just copied the package to root's home directory so we are finally ready to install our program. In root's home directory, (where we end up immediately after connecting to the router via ssh) type "ipkg install helloworld_1_mipsel.ipk" [NOTE: on OpenWrt 8.09 and later you need to run opkg install helloworld_1_mipsel.ipk, as ipkg has been replaced with a new, improved utility called opkg] and the ipkg system will do the rest.
  
 <shell> <shell>
Line 704: Line 706:
 Once again, please do **not** contact me about any issues you might have with your own programs.  If,however, you think there is an error in one of my examples or that I have omitted a critical detail, please contact me and I will try to resolve the issue as soon as possible. Once again, please do **not** contact me about any issues you might have with your own programs.  If,however, you think there is an error in one of my examples or that I have omitted a critical detail, please contact me and I will try to resolve the issue as soon as possible.
  
-=====PART III: Building and Using the Kamikaze SDK=====+=====PART III: Building and Using the Kamikaze SDK -- 12/9/2007=====
  
 The OpenWrt SDK for Kamikaze is available only for 64 bit processors. If you're one of us mere mortals who posesses only one of those antique 32 bit processors, you have a problem. You can sometimes get away with using the //White Russian// SDK if you only need your program to run on the MIPS architecture, but the new architectures supported only by Kamikaze require you to use a //Kamikaze// SDK. The solution is to compile the SDK yourself. This is actually fairly simple, provided you have a couple of gigabytes of disk space and an hour or two to spare.  The OpenWrt SDK for Kamikaze is available only for 64 bit processors. If you're one of us mere mortals who posesses only one of those antique 32 bit processors, you have a problem. You can sometimes get away with using the //White Russian// SDK if you only need your program to run on the MIPS architecture, but the new architectures supported only by Kamikaze require you to use a //Kamikaze// SDK. The solution is to compile the SDK yourself. This is actually fairly simple, provided you have a couple of gigabytes of disk space and an hour or two to spare. 
openwrt_coding.1244692119.txt.gz · Last modified: 2009/06/11 03:48 by eric